/* ===== product-card: schede .product-card e .mini-card, griglia .product-grid, slider, consegna/quantita' condivise con il carrello. Home, Landing, catalogo, scheda prodotto, carrello ===== */

/* ===== schede prodotto: offerte (.product-card) e più venduti (.mini-card) =====
   Desktop: griglia a 4 colonne. Fino a 1180px (tablet e telefono) le schede scorrono di lato
   con aggancio, come la vetrina in alto, e la successiva si intravede. */
.offers-grid,
.mini-grid {
    --bl: 32px;
    --cw: 28%;
    display: grid;
    grid-template-columns: repeat(4, 1fr)
}

/* gap 16 come le rail di HomeV2 */
.offers-grid,
.mini-grid {
    gap: 16px
}

/* come .rail-card di HomeV2: riquadro r 12 con padding, al passaggio bordo piu' scuro e ombra, senza sollevamento */
.product-card,
.mini-card {
    padding: 12px 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: #fff;
    transition: border-color .3s, box-shadow .3s
}

.product-card:hover,
.mini-card:hover {
    border-color: var(--line2);
    box-shadow: var(--sh)
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden
}

.mini-card {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.product-card.is-hidden,
.product-card.product-card--extra:not(.is-expanded) {
    display: none
}

.product-card.is-entering {
    animation: pop .5s var(--ease) both
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(14px)
    }
}

/* riquadro interno r 10 con la sfumatura di .rail-card__image; l'aspect-ratio resta perche' le colonne della griglia variano */
.card-image {
    position: relative;
    display: block;
    aspect-ratio: 4/3.2;
    border-radius: var(--r-sm);
    background: radial-gradient(ellipse at 50% 65%, #fff 0, var(--ground) 85%);
    overflow: hidden
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;
    transition: transform .5s var(--ease)
}

.product-card:hover .card-image img,
.mini-card:hover .card-image img {
    transform: scale(1.05)
}

.discount-badge {
    display: inline-block;
    align-self: flex-start;
    background: var(--red);
    color: #fff;
    font: 700 19px/1 var(--d);
    font-stretch: 78%;
    letter-spacing: .02em;
    border-radius: 0;
    padding: 5px 10px 4px
}

/* a filo nell'angolo della foto, come .rail-card__image (.card-image c'e' solo nelle card: la base del badge resta) */
.card-image .discount-badge {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
    padding: 4px 10px 3px;
    border-radius: var(--r-sm) 0 var(--r-sm) 0;
    font-size: 17px
}

/* il padding ora e' sulla card */
.product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px
}

.product-card__body h3,
.mini-card h3 {
    font: 700 16px/1.2 var(--d);
    font-stretch: 90%;
    letter-spacing: 0;
    text-transform: none
}

/* tre righe sempre riservate, come .rail-card__title: prezzi e pulsanti allineati fra le card */
.product-card__body h3 a,
.mini-card h3 a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    min-height: 3.6em
}

.product-card__body h3 a:hover,
.mini-card h3 a:hover {
    text-decoration: underline;
    text-underline-offset: 3px
}

.spec-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px
}

.spec-chips li {
    border: 1px solid #b9bdb9;
    border-radius: 0;
    padding: 1px 10px;
    font-family: var(--f);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink)
}

.spec-chips li b {
    font-family: var(--d);
    font-stretch: 78%;
    font-size: 18px;
    font-weight: 700;
    margin-right: 2px
}

/* misure nelle card: testo grigio senza bordo con numero in inchiostro, come .hero-offer__card (la base e' condivisa) */
.product-card .spec-chips,
.mini-card .spec-chips {
    gap: 4px 14px
}

.product-card .spec-chips li,
.mini-card .spec-chips li {
    padding: 0;
    border: 0;
    color: var(--mut);
    font-size: 14px
}

.product-card .spec-chips li b,
.mini-card .spec-chips li b {
    color: var(--ink);
    font-stretch: 88%;
    font-size: 18px
}

.mini-card__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto
}

.price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap
}

.price b {
    font: 700 40px/1 var(--d);
    font-stretch: 78%;
    letter-spacing: .01em;
    color: var(--red)
}

.price s {
    color: var(--mut);
    font-size: 16px
}

/* prezzi nelle card: condensazione 88% come .rail-card; la mini-card e' identica a .rail-card (prezzo e barrato in colonna) */
.product-card .price b {
    font-size: 30px;
    font-stretch: 88%
}

.mini-card .price {
    display: grid;
    gap: 2px;
    line-height: 1
}

.mini-card .price b {
    font-size: 25px;
    font-stretch: 88%
}

.mini-card .price s {
    font-size: 13px
}

.add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 46px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    font: 600 15px var(--f);
    letter-spacing: .01em;
    cursor: pointer;
    margin-top: auto;
    transition: background .2s, color .2s, transform .15s
}

.add-to-cart svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.7
}

.add-to-cart:hover {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--ink)
}

.add-to-cart:active {
    transform: scale(.97)
}

.add-to-cart.add-to-cart--small {
    height: 42px;
    font-size: 14px
}

.add-to-cart.is-done {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--ink)
}

.add-to-cart .add-to-cart__label-short {
    display: none
}

.add-to-cart i {
    font-style: normal
}

/* card dell'archivio: rossa come i pulsanti d'acquisto di HomeV2; il lime resta solo per la conferma (.is-done) */
.product-card .add-to-cart.add-to-cart--outline {
    height: 44px;
    border: 1px solid var(--red);
    border-radius: var(--r-sm);
    background: var(--red);
    color: #fff
}

.product-card .add-to-cart.add-to-cart--outline:hover {
    border-color: var(--red2);
    background: var(--red2);
    color: #fff
}

.product-card .add-to-cart.add-to-cart--outline.is-done {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--ink)
}

.add-to-cart.add-to-cart--square {
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 0;
    padding: 0;
    margin: 0
}

.add-to-cart.add-to-cart--square svg {
    width: 22px;
    height: 22px
}

/* mini-card e product-card: stesso quadrato rosso di .rail-card (HomeV2); solo sotto le card, la base e' condivisa */
.mini-card .add-to-cart.add-to-cart--square,
.product-card .add-to-cart.add-to-cart--square {
    width: 44px;
    height: 44px;
    border-color: var(--red);
    border-radius: var(--r-sm);
    background: var(--red);
    color: #fff
}

.mini-card .add-to-cart.add-to-cart--square:hover,
.product-card .add-to-cart.add-to-cart--square:hover {
    border-color: var(--red2);
    background: var(--red2);
    color: #fff
}

.mini-card .add-to-cart.add-to-cart--square.is-done,
.product-card .add-to-cart.add-to-cart--square.is-done {
    border-color: var(--lime);
    background: var(--lime);
    color: var(--ink)
}

/* misure con icona rossa, come .rail-card__specs di HomeV2 (icone in modules/art_specs.inc.php) */
.spec-chips.spec-chips--icons {
    gap: 4px 14px
}

.spec-chips.spec-chips--icons li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    color: var(--mut);
    font-size: 14px
}

.spec-chips--icons svg {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--red)
}

/* product-card: prezzo (con barrato e risparmio sotto) a sinistra, pulsante quadrato a destra, come .rail-card__row */
.product-card__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto
}

.product-card__price {
    display: grid;
    gap: 4px;
    min-width: 0
}

.product-card .product-card__price .price {
    display: grid;
    gap: 2px;
    line-height: 1
}

.product-card .product-card__price .price b {
    font-size: 25px;
    font-stretch: 88%
}

.product-card .product-card__price .price s {
    font-size: 13px
}

.product-card__price .saving {
    margin-bottom: 0;
    font-size: 13px
}

/* slider: il bordo sfuma fino al margine dello schermo; padding in alto e in basso per non tagliare l'ombra al passaggio (l'overflow taglia al bordo del padding) */
@media (max-width:1180px) {

    .offers-grid,
    .mini-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: var(--cw);
        margin: -4px calc(var(--bl) * -1) -10px;
        padding: 4px var(--bl) 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-left: var(--bl);
        overscroll-behavior-x: contain;
        scrollbar-width: none
    }

    .offers-grid::-webkit-scrollbar,
    .mini-grid::-webkit-scrollbar {
        display: none
    }

    .product-card,
    .mini-card {
        scroll-snap-align: start
    }

    .offers-grid+.slider-dots,
    .mini-grid+.slider-dots {
        margin-top: 8px
    }

    .slider-dots[hidden] {
        display: none
    }
}

@media (max-width:700px) {

    .offers-grid,
    .mini-grid {
        --bl: 16px;
        --cw: 72%;
        gap: 12px
    }

    .card-image {
        aspect-ratio: 16/11
    }

    .product-card,
    .product-card__body {
        gap: 8px
    }

    .product-card__body h3,
    .mini-card h3 {
        font-size: 14px
    }

    .spec-chips {
        gap: 0 10px
    }

    .spec-chips li {
        border: 0;
        padding: 0;
        font-size: 13px
    }

    .product-card .spec-chips li,
    .mini-card .spec-chips li {
        font-size: 13px
    }

    .product-card .spec-chips li b,
    .mini-card .spec-chips li b {
        font-size: 16px
    }

    .product-card .price {
        flex-wrap: nowrap;
        gap: 6px
    }

    .product-card .price b {
        font-size: 25px
    }

    .product-card .price s {
        font-size: 12.5px
    }

    .mini-card .price s {
        font-size: 13px
    }

    .add-to-cart.add-to-cart--square {
        width: 44px;
        height: 44px
    }
}

.fav-button {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 36px;
    height: 36px;
    border-radius: 0;
    border: 1px solid var(--line);
    background: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s, color .2s
}

.fav-button svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.6
}

.fav-button:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff
}

.saving {
    color: var(--g);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px
}

.show-more {
    display: flex;
    justify-content: center;
    margin-top: 28px
}

.show-more[hidden] {
    display: none
}

.empty-message {
    padding: 40px 0;
    color: var(--mut);
    text-align: center
}

.small-note {
    color: var(--mut);
    font-size: 13px;
    margin-top: 18px
}

.slider-dots {
    display: flex;
    gap: 6px
}

.slider-dots button {
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    display: grid;
    align-items: center
}

.slider-dots i {
    display: block;
    height: 3px;
    background: rgba(13, 23, 23, .2);
    transition: background .25s
}

.slider-dots button:hover i {
    background: rgba(13, 23, 23, .5)
}

.slider-dots .is-active i {
    background: var(--ink)
}

@media (max-width:700px) {

    .add-to-cart .add-to-cart__label-long {
        display: none
    }

    .add-to-cart .add-to-cart__label-short {
        display: inline
    }
}

.fav-button {
    width: 44px;
    height: 44px;
    right: 8px;
    top: 8px
}

/* scelta della consegna: due righe selezionabili */
.delivery {
    align-self: stretch;
    display: grid;
    gap: 8px;
    margin-top: 20px;
    padding: 0;
    border: 0;
    min-width: 0
}

.delivery legend {
    padding: 0;
    margin-bottom: 10px;
    font: 700 19px/1 var(--d);
    font-stretch: 78%;
    text-transform: uppercase;
    letter-spacing: .02em
}

.choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 18px 10px 14px;
    border: 1px solid var(--field);
    border-radius: var(--r-card);
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s
}

.choice:hover {
    border-color: var(--ink)
}

.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none
}

.choice:has(input:checked) {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
    background: var(--soft)
}

.choice:has(input:focus-visible) {
    outline: 3px solid var(--ink);
    outline-offset: 3px
}

/* l'icona fa da indicatore di scelta: si riempie di lime quando l'opzione è selezionata */
.choice__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line2);
    border-radius: 50%;
    background: #fff;
    transition: background .2s, border-color .2s
}

.choice__icon svg {
    width: 22px;
    height: 22px
}

.choice:has(input:checked) .choice__icon {
    background: var(--lime);
    border-color: var(--lime)
}

.choice__text {
    flex: 1;
    min-width: 0
}

.choice__text b {
    display: block;
    font-weight: 600;
    line-height: 1.25
}

.choice__text small {
    display: block;
    font-size: 14px;
    line-height: 1.35;
    color: var(--mut)
}

.choice__cost {
    flex: none;
    font: 700 22px/1 var(--d);
    font-stretch: 78%;
    font-variant-numeric: tabular-nums
}

.install-note {
    margin-top: 10px;
    font-size: 15px;
    color: var(--g);
    font-weight: 500
}

.install-note[hidden] {
    display: none
}

.qty-stepper {
    display: flex;
    flex: none;
    border: 1px solid var(--ink);
    border-radius: var(--r-sm)
}

/* niente overflow: hidden (taglierebbe l'anello di fuoco): il fondo in hover segue gli angoli dai pulsanti estremi */
.qty-stepper button:first-child {
    border-radius: calc(var(--r-sm) - 1px) 0 0 calc(var(--r-sm) - 1px)
}

.qty-stepper button:last-child {
    border-radius: 0 calc(var(--r-sm) - 1px) calc(var(--r-sm) - 1px) 0
}

.qty-stepper button {
    display: grid;
    place-items: center;
    width: 44px;
    border: 0;
    background: #fff;
    cursor: pointer;
    transition: background .2s, color .2s
}

.qty-stepper button:hover:not(:disabled) {
    background: var(--ink);
    color: #fff
}

.qty-stepper button:disabled {
    color: #b9bdb9;
    cursor: default
}

.qty-stepper svg {
    width: 16px;
    height: 16px
}

.qty-stepper input {
    width: 44px;
    border: 0;
    text-align: center;
    font: 700 22px var(--d);
    font-stretch: 78%;
    color: var(--ink);
    background: #fff;
    -moz-appearance: textfield;
    appearance: textfield
}

.qty-stepper input::-webkit-inner-spin-button,
.qty-stepper input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0
}

.qty-stepper input:focus {
    outline: none;
    box-shadow: inset 0 -3px 0 var(--lime)
}

.assurances {
    display: grid;
    gap: 12px;
    margin-top: 22px;
    font-size: 15px;
    line-height: 1.4
}

.assurances li {
    display: flex;
    gap: 12px;
    align-items: flex-start
}

.assurances svg {
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--ink)
}

.assurances b {
    font-weight: 600
}

@media (max-width:700px) {

    .choice {
        gap: 12px;
        padding: 10px 14px 10px 12px
    }
}

/* griglia: le card .product-card sono le stesse della home */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px
}

@media (max-width:1180px) {

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media (max-width:900px) {

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }
}

@media (max-width:700px) {

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 10px
    }

    .product-grid .card-image {
        aspect-ratio: 1
    }

    .product-grid .fav-button {
        right: 6px;
        top: 6px
    }

    .product-grid .card-image .discount-badge {
        font-size: 16px
    }

    /* due colonne strette: padding della card un po' ridotto (prima era quello del corpo) */
    .product-grid .product-card {
        padding: 10px 10px 12px
    }

    .product-grid .product-card .price {
        flex-wrap: wrap;
        gap: 0 6px
    }

    .product-grid .saving {
        font-size: 13px;
        margin-bottom: 4px
    }

    .product-grid .add-to-cart {
        height: 44px;
        font-size: 14px
    }
}
