/*
 * BACKDIGIT Amazon Product Block – Front-end styles
 * Version: 6.5
 */

.amzn-box *,
.amzn-box *::before,
.amzn-box *::after {
    box-sizing: border-box;
}

.amzn-box {
    --c-border:  #D5D9D9;
    --c-text:    #0F1111;
    --c-muted:   #565959;
    --c-bg:      #FFFFFF;
    --c-amazon:  #FF9900;
    --c-ebay:    #E53238;

    display:         flex;
    align-items:     stretch;
    background:      var(--c-bg);
    border:          1px solid var(--c-border);
    border-radius:   10px;
    overflow:        hidden;
    width:           100%;
    max-width:       680px;
    font-family:     Arial, sans-serif;
    color:           var(--c-text);
    transition:      .2s;
    cursor:          pointer;
    box-shadow:      0 2px 5px rgba(0,0,0,.06);
    text-decoration: none;
}

.amzn-box:hover {
    transform:  translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

/* LAYOUT VERTICALE */

.amzn-vertical {
    flex-direction: column;
    max-width: 320px;
}

.amzn-vertical .amzn-image-wrap {
    width:         100%;
    border-right:  0;
    border-bottom: 1px solid var(--c-border);
}

/* IMAGE */

.amzn-image-wrap {
    width:           140px;
    flex-shrink:     0;
    display:         flex;
    align-items:     center;
    justify-content: center;
    background:      #fff !important;
    border-right:    1px solid var(--c-border);
    padding:         14px;
    position:        relative;  /* ancora per il badge assoluto */
    overflow:        visible;
}

.amzn-image-wrap img {
    width:        100%;
    height:       auto;
    aspect-ratio: 1/1;
    max-height:   180px;
    object-fit:   contain;
    display:      block;
}

/* BODY */

.amzn-body {
    display:        flex;
    flex-direction: column;
    gap:            10px;
    padding:        16px;
    flex:           1;
}

/* TITLE */

.amzn-title {
    font-size:           17px;
    font-weight:         600;
    line-height:         1.4;
    display:             -webkit-box;
    -webkit-box-orient:  vertical;
    overflow:            hidden;
}

/* FEATURES */

.amzn-features {
    margin:         0;
    padding-left:   18px;
    display:        flex;
    flex-direction: column;
    gap:            2px;
}

.amzn-features li {
    font-size:   12px;
    color:       var(--c-muted);
    line-height: 1.2;
}

/* BOTTOM */

.amzn-bottom {
    display:     flex;
    align-items: center;
    gap:         8px;
    flex-wrap:   wrap;
    margin-top:  auto;
}

/* PRICE */

.amzn-price-row {
    display:     flex;
    align-items: center;
    gap:         6px;
    flex-wrap:   wrap;
}

.amzn-price-current {
    font-size:   24px;
    font-weight: 700;
}

.amzn-price-original {
    font-size:       13px;
    color:           var(--c-muted);
    text-decoration: line-through;
}

.amzn-badge-discount {
    color:       orangered;
    font-size:   20px;
    font-weight: 700;
}

/* MARKETPLACE */

.amzn-marketplace-wrap {
    display:     flex;
    align-items: center;
    gap:         6px;
    flex-wrap:   wrap;
}

.amzn-marketplace-logo {
    max-height:  28px;
    width:       auto;
    max-width:   70px;
    display:     block;
    object-fit:  contain;
}

.amzn-prime-logo {
    height:     18px;
    width:      auto;
    display:    block;
    object-fit: contain;
}

.amazon-logo {
    border-radius: 3px;
}

.amzn-prime-svg {
    max-width: 58px;
}


/* ════════════════════════════════════════════
   MODALITÀ RICERCA
   ════════════════════════════════════════════ */

/* Il box ricerca non è un <a> cliccabile in toto,
   quindi disabilitiamo il cursor pointer sul wrapper */
.amzn-search-box {
    cursor:   default;
    overflow: visible;
}

.amzn-search-box:hover {
    transform:  none;
    box-shadow: 0 2px 5px rgba(0,0,0,.06);
}

/* BADGE */

.amzn-search-badge {
    position:       absolute;
    top:            0;
    left:           16px;
    transform:      translateY(-50%);
    display:        inline-block;
    background:     #E02020;
    color:          #fff;
    font-size:      9px;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding:        5px 8px;
    line-height:    normal;
    border-radius:  3px;
    white-space:    nowrap;
    z-index:        10;
    box-shadow:     0 1px 4px rgba(0,0,0,.18);
}

/* NOTE */

.amzn-search-note {
    margin:      0;
    font-size:   13px;
    color:       var(--c-muted);
    font-style:  italic;
    line-height: 1.4;
}

/* BOTTOM RICERCA – tutto su una riga */

.amzn-search-bottom {
    flex-direction: row;
    align-items:    center;
    flex-wrap:      wrap;
    gap:            10px;
}

/* FASCIA PREZZO */

.amzn-search-range {
    font-size:   13px;
    color:       var(--c-muted);
    font-weight: 600;
    white-space: nowrap;
}

/* LABEL CTA */

.amzn-search-cta-label {
    font-size:      13px;
    font-weight:    700;
    color:          var(--c-text);
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space:    nowrap;
}

/* BOTTONI RICERCA */

.amzn-search-buttons {
    display:     flex;
    gap:         8px;
    flex-wrap:   nowrap;
    align-items: center;
    margin-left: auto;  /* spinge i bottoni a destra */
}

.amzn-search-btn {
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         6px 12px;
    border-radius:   8px;
    border:          1px solid var(--c-border);
    background:      #fff;
    text-decoration: none;
    transition:      border-color .15s, transform .15s, box-shadow .15s;
    cursor:          pointer;
    min-width:       80px;
}

.amzn-search-btn:hover {
    transform:   translateY(-2px);
    box-shadow:  0 4px 12px rgba(0,0,0,.12);
}

.amzn-search-btn--amazon:hover {
    border-color: var(--c-amazon);
}

.amzn-search-btn--ebay:hover {
    border-color: var(--c-ebay);
}

.amzn-search-logo {
    height:     24px;
    width:      auto;
    max-width:  80px;
    object-fit: contain;
    display:    block;
}


/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */

@media (max-width: 480px) {

    .amzn-box {
        max-width: 100%;
    }

    .amzn-image-wrap {
        width: 110px;
    }

    .amzn-title {
        font-size: 15px;
    }

    .amzn-price-current {
        font-size: 20px;
    }

    .amzn-features {
        display: none;
    }

    .amzn-vertical {
        max-width: 100%;
    }

    .amzn-search-buttons {
        gap: 8px;
    }

    .amzn-search-btn {
        padding:   5px 8px;
        min-width: 70px;
    }
}


/* ════════════════════════════════════════════
   DARK MODE
   ════════════════════════════════════════════ */

.custom-dark .amzn-box,
body.custom-dark .amzn-box {
    --c-bg:     #1C1C1E;
    --c-text:   #E5E5E7;
    --c-muted:  #98989D;
    --c-border: #38383A;
}

.custom-dark .amzn-search-btn,
body.custom-dark .amzn-search-btn {
    background: #2C2C2E;
}
