/* ITNETCOM_SHOP_PRODUCT_CARDS_PRO_V1 BEGIN */

.shop-products-grid {
    gap: 18px !important;
}

/* Card prodotto */
.shop-product-card {
    position: relative;
    overflow: hidden;
    box-sizing: border-box;

    border: 1px solid rgba(15, 23, 42, 0.10) !important;
    border-radius: 18px !important;

    background: #ffffff !important;
    background-image: none !important;

    box-shadow:
        0 8px 22px rgba(15, 23, 42, 0.055),
        0 2px 6px rgba(15, 23, 42, 0.035);

    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease;
}

/* Accento superiore rosso/nero */
.shop-product-card::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    left: 18px;
    width: 64px;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background:
        linear-gradient(
            90deg,
            #e30613 0%,
            #e30613 64%,
            #18181b 64%,
            #18181b 100%
        );
}

@media (hover: hover) and (pointer: fine) {
    .shop-product-card:hover {
        transform: translateY(-3px);
        border-color: rgba(15, 23, 42, 0.16) !important;
        box-shadow:
            0 14px 32px rgba(15, 23, 42, 0.09),
            0 3px 9px rgba(15, 23, 42, 0.05);
    }
}

/* Fondo bianco uniforme */
.shop-product-top,
.shop-product-link,
.shop-product-media,
.shop-product-bottom {
    background: #ffffff !important;
    background-image: none !important;
}

/* Immagine centrata e mai tagliata */
.shop-product-media {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    overflow: hidden !important;
    box-sizing: border-box !important;

    border: 0 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
}

.shop-product-media img {
    display: block !important;

    width: auto !important;
    height: auto !important;

    max-width: 100% !important;
    max-height: 100% !important;

    object-fit: contain !important;
    object-position: center center !important;

    margin: auto !important;

    background: #ffffff !important;

    transform: none !important;
    clip-path: none !important;
}

.shop-product-link:hover .shop-product-media img {
    transform: none !important;
}

.shop-product-name {
    line-height: 1.25 !important;
}

.shop-product-tag {
    border-radius: 7px !important;
}

/* Selettore quantità */
.shop-product-qty {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.15) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
}

.shop-product-qty button {
    cursor: pointer !important;
}

.shop-product-qty button:first-child {
    border-radius: 9px 0 0 9px !important;
}

.shop-product-qty button:last-child {
    border-radius: 0 9px 9px 0 !important;
}

/* Pulsante Aggiungi catalogo */
.shop-product-cart {
    position: relative;
    overflow: hidden;

    border: 1px solid rgba(184, 0, 11, 0.38) !important;
    border-radius: 11px !important;

    background:
        linear-gradient(
            180deg,
            #ff161f 0%,
            #f20a14 55%,
            #e30613 100%
        ) !important;

    color: #ffffff !important;

    box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.18),
        0 1px 2px rgba(15, 23, 42, 0.12);

    transform: translateY(0);

    transition:
        transform 120ms ease,
        box-shadow 150ms ease,
        filter 150ms ease;

    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.shop-product-cart::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.17) 0%,
            rgba(255, 255, 255, 0.03) 44%,
            transparent 67%
        );
}

.shop-product-cart > * {
    position: relative;
    z-index: 1;
}

.shop-product-cart svg {
    transition: transform 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .shop-product-cart:hover:not(:disabled) {
        transform: translateY(-1px);

        box-shadow:
            0 7px 16px rgba(15, 23, 42, 0.22),
            0 2px 4px rgba(15, 23, 42, 0.13);

        filter: brightness(1.025);
    }

    .shop-product-cart:hover:not(:disabled) svg {
        transform: translateX(1px) scale(1.04);
    }
}

.shop-product-cart:active:not(:disabled) {
    transform: translateY(2px) scale(0.992);

    box-shadow:
        0 2px 5px rgba(15, 23, 42, 0.16),
        inset 0 2px 5px rgba(15, 23, 42, 0.22);

    filter: brightness(0.96);
}

.shop-product-cart:active:not(:disabled) svg {
    transform: scale(0.94);
}

.shop-product-cart:focus-visible {
    outline: 3px solid rgba(227, 6, 19, 0.22);
    outline-offset: 3px;
}

.shop-product-cart:disabled {
    cursor: not-allowed !important;

    border-color: rgba(100, 116, 139, 0.20) !important;

    background:
        linear-gradient(
            180deg,
            #d7d7d7 0%,
            #c7c7c7 100%
        ) !important;

    color: rgba(30, 41, 59, 0.62) !important;

    box-shadow:
        0 2px 5px rgba(15, 23, 42, 0.08);

    transform: none !important;
    filter: none !important;
}

/* Pulsanti secondari catalogo */
.shop-mobile-filter-toggle,
.shop-filter-submit,
.shop-empty-button,
.shop-pagination a,
.shop-pagination span {
    border-radius: 10px !important;
}

.shop-mobile-filter-toggle,
.shop-filter-submit,
.shop-empty-button,
.shop-pagination a {
    cursor: pointer !important;
}

/* Mobile */
@media (max-width: 720px) {
    .shop-products-grid {
        gap: 14px !important;
    }

    .shop-product-card {
        border-radius: 15px !important;
        box-shadow:
            0 7px 18px rgba(15, 23, 42, 0.055),
            0 2px 5px rgba(15, 23, 42, 0.03);
    }

    .shop-product-card::before {
        left: 14px;
        width: 54px;
    }

    .shop-product-media {
        min-height: 190px !important;
        height: clamp(190px, 52vw, 235px) !important;
        max-height: 235px !important;
        padding: 4px !important;
        border-radius: 10px !important;
    }

    .shop-product-name {
        display: -webkit-box !important;
        overflow: hidden !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3 !important;
        font-size: clamp(17px, 4.6vw, 20px) !important;
        line-height: 1.2 !important;
    }

    .shop-product-actions {
        gap: 8px !important;
    }

    .shop-product-cart {
        min-height: 40px !important;
        border-radius: 10px !important;
        box-shadow:
            0 3px 8px rgba(15, 23, 42, 0.17),
            0 1px 2px rgba(15, 23, 42, 0.10);
    }

    .shop-product-cart:active:not(:disabled) {
        box-shadow:
            0 1px 3px rgba(15, 23, 42, 0.14),
            inset 0 2px 4px rgba(15, 23, 42, 0.20);
    }

    .shop-product-qty {
        min-height: 40px !important;
        border-radius: 10px !important;
    }
}

@media (max-width: 390px) {
    .shop-product-card {
        border-radius: 14px !important;
    }

    .shop-product-media {
        min-height: 180px !important;
        height: 180px !important;
        max-height: 180px !important;
    }

    .shop-product-name {
        font-size: 16.5px !important;
    }
}

/* ITNETCOM_SHOP_PRODUCT_CARDS_PRO_V1 END */

/* ITNETCOM_SHOP_GRID_NO_CARDS_V1 BEGIN */

/*
 * Catalogo come griglia continua:
 * nessuna card autonoma, ombra o riquadro arrotondato.
 */
.shop-products-grid {
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    background: #ffffff;
}

.shop-product-card {
    position: relative;
    overflow: visible !important;

    border: 0 !important;
    border-right: 1px solid #e8e8e8 !important;
    border-bottom: 1px solid #e8e8e8 !important;
    border-radius: 0 !important;

    background: #ffffff !important;
    background-image: none !important;

    box-shadow: none !important;
    transform: none !important;

    transition: none !important;
}

/* Rimuove tutti gli accenti decorativi delle vecchie card. */
.shop-product-card::before,
.shop-product-card::after {
    content: none !important;
    display: none !important;
}

/*
 * Nessun rimbalzo o sollevamento della cella.
 * L'effetto hover rimane soltanto sull'immagine.
 */
@media (hover: hover) and (pointer: fine) {
    .shop-product-card:hover {
        border-color: #e8e8e8 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        transform: none !important;
    }
}

/* Fondo interno sempre bianco. */
.shop-product-top,
.shop-product-link,
.shop-product-media,
.shop-product-bottom {
    background: #ffffff !important;
    background-image: none !important;
}

/*
 * Hover limitato esclusivamente alla fotografia.
 */
.shop-product-media {
    overflow: hidden !important;
}

.shop-product-media img {
    transform: scale(1) !important;
    transition:
        transform 180ms ease,
        filter 180ms ease !important;
}

@media (hover: hover) and (pointer: fine) {
    .shop-product-link:hover .shop-product-media img {
        transform: scale(1.035) !important;
        filter: saturate(1.025);
    }
}

/*
 * Desktop: corregge i bordi esterni della griglia.
 * Il catalogo attuale mostra sette colonne.
 */
@media (min-width: 1181px) {
    .shop-product-card:nth-child(7n) {
        border-right: 0 !important;
    }
}

/*
 * Tablet: normalmente quattro colonne.
 */
@media (min-width: 721px) and (max-width: 1180px) {
    .shop-product-card:nth-child(4n) {
        border-right: 0 !important;
    }
}

/*
 * Mobile: conserva la griglia prevista dal CSS esistente,
 * senza trasformare i prodotti in card isolate.
 */
@media (max-width: 720px) {
    .shop-products-grid {
        gap: 0 !important;
        border-radius: 11px;
    }

    .shop-product-card {
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
    }

    /*
     * Due colonne nella visualizzazione mobile standard.
     */
    .shop-product-card:nth-child(2n) {
        border-right: 0 !important;
    }
}

/*
 * Su telefoni molto stretti, se il catalogo passa a una colonna,
 * non serve il divisore verticale.
 */
@media (max-width: 480px) {
    .shop-product-card {
        border-right: 0 !important;
    }
}

/* ITNETCOM_SHOP_GRID_NO_CARDS_V1 END */

/* ITNETCOM_SHOP_GRID_LINES_AUTO_V1 BEGIN */

/*
 * Divisori automatici indipendenti dal numero di colonne.
 * Il fondo grigio della griglia appare nello spazio di 1px tra i prodotti.
 */
.shop-products-grid {
    gap: 1px !important;
    padding: 1px !important;

    overflow: hidden !important;

    border: 0 !important;
    border-radius: 14px !important;

    background: #e5e7eb !important;

    box-shadow:
        inset 0 0 0 1px #e5e7eb !important;
}

.shop-product-card {
    border: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;

    border-radius: 0 !important;

    background: #ffffff !important;
    box-shadow: none !important;
}

/*
 * Annulla le vecchie eccezioni basate su 7, 4 o 2 colonne.
 */
.shop-product-card:nth-child(7n),
.shop-product-card:nth-child(4n),
.shop-product-card:nth-child(2n) {
    border-right: 0 !important;
}

/* Nessuna variazione del divisore durante hover. */
@media (hover: hover) and (pointer: fine) {
    .shop-product-card:hover {
        border: 0 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        transform: none !important;
    }
}

/* Tablet */
@media (max-width: 1180px) {
    .shop-products-grid {
        gap: 1px !important;
        padding: 1px !important;
        border-radius: 12px !important;
    }
}

/* Mobile */
@media (max-width: 720px) {
    .shop-products-grid {
        gap: 1px !important;
        padding: 1px !important;
        border-radius: 10px !important;
    }

    .shop-product-card {
        border: 0 !important;
        border-radius: 0 !important;
    }
}

/* ITNETCOM_SHOP_GRID_LINES_AUTO_V1 END */

/* ITNETCOM_SHOP_GRID_FEW_RESULTS_WHITE_V1 BEGIN */

/*
 * Correzione griglia con pochi risultati:
 * il contenitore resta bianco e i divisori sono disegnati
 * direttamente all'interno di ogni prodotto.
 */
.shop-products-grid {
    gap: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;

    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;

    background: #ffffff !important;
    background-image: none !important;

    box-shadow: none !important;
}

/*
 * Nessuna card autonoma.
 * I divisori non dipendono dal numero di colonne.
 */
.shop-product-card {
    border: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;

    background: #ffffff !important;
    background-image: none !important;

    box-shadow:
        inset -1px 0 0 #e5e7eb,
        inset 0 -1px 0 #e5e7eb !important;

    transform: none !important;
}

/*
 * Annulla qualsiasi regola precedente basata su nth-child.
 */
.shop-product-card:nth-child(2n),
.shop-product-card:nth-child(4n),
.shop-product-card:nth-child(6n),
.shop-product-card:nth-child(7n) {
    border-right: 0 !important;

    box-shadow:
        inset -1px 0 0 #e5e7eb,
        inset 0 -1px 0 #e5e7eb !important;
}

/*
 * Nessuna variazione della cella durante hover.
 */
@media (hover: hover) and (pointer: fine) {
    .shop-product-card:hover {
        border: 0 !important;
        background: #ffffff !important;

        box-shadow:
            inset -1px 0 0 #e5e7eb,
            inset 0 -1px 0 #e5e7eb !important;

        transform: none !important;
    }
}

/*
 * Mantiene bianco anche tutto lo spazio interno non occupato.
 */
.shop-product-top,
.shop-product-link,
.shop-product-media,
.shop-product-bottom {
    background: #ffffff !important;
    background-image: none !important;
}

/* Tablet */
@media (max-width: 1180px) {
    .shop-products-grid {
        border-radius: 12px !important;
    }
}

/* Mobile */
@media (max-width: 720px) {
    .shop-products-grid {
        gap: 0 !important;
        padding: 0 !important;
        border-radius: 10px !important;
        background: #ffffff !important;
    }

    .shop-product-card {
        border: 0 !important;
        border-radius: 0 !important;

        box-shadow:
            inset -1px 0 0 #e5e7eb,
            inset 0 -1px 0 #e5e7eb !important;
    }
}

/* ITNETCOM_SHOP_GRID_FEW_RESULTS_WHITE_V1 END */
