/* ITNETCOM_HOME_PRODUCT_SHELL_PRO_V1 BEGIN */

.latest-products-section .latest-products-shell {
    position: relative;
    isolation: isolate;
    padding: 22px 18px 18px !important;
    overflow: visible;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(248, 250, 252, 0.96) 52%,
            rgba(255, 255, 255, 0.98) 100%
        );
    box-shadow:
        0 14px 38px rgba(15, 23, 42, 0.07),
        0 3px 10px rgba(15, 23, 42, 0.04);
}

/*
 * Griglia tecnica molto leggera:
 * dà struttura senza interferire con immagini e testi.
 */
.latest-products-section .latest-products-shell::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.42;
    background-image:
        linear-gradient(
            rgba(148, 163, 184, 0.055) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(148, 163, 184, 0.055) 1px,
            transparent 1px
        );
    background-size: 28px 28px;
    mask-image:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.38) 48%,
            transparent 100%
        );
    -webkit-mask-image:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.38) 48%,
            transparent 100%
        );
}

/*
 * Accento superiore coerente con ITNETCOM.
 */
.latest-products-section .latest-products-shell::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 22px;
    width: 86px;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background:
        linear-gradient(
            90deg,
            #e30613 0%,
            #e30613 62%,
            #18181b 62%,
            #18181b 100%
        );
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.16);
}

/*
 * Mantiene i prodotti sopra gli elementi decorativi.
 */
.latest-products-section .latest-products-viewport,
.latest-products-section .latest-products-track,
.latest-products-section .latest-product-card,
.latest-products-section .latest-products-dots {
    position: relative;
    z-index: 2;
}

/*
 * Le frecce desktop rimangono esterne e ben visibili.
 */
@media (min-width: 721px) {
    .latest-products-section .latest-products-arrow-prev {
        left: -19px !important;
    }

    .latest-products-section .latest-products-arrow-next {
        right: -19px !important;
    }
}

/*
 * Versione tablet.
 */
@media (max-width: 900px) {
    .latest-products-section .latest-products-shell {
        padding: 18px 14px 15px !important;
        border-radius: 17px;
    }

    .latest-products-section .latest-products-shell::before {
        background-size: 24px 24px;
    }

    .latest-products-section .latest-products-shell::after {
        left: 18px;
        width: 72px;
    }
}

/*
 * Versione mobile:
 * contenitore compatto, senza togliere spazio utile alla card.
 */
@media (max-width: 720px) {
    .latest-products-section .latest-products-shell {
        margin-inline: 0 !important;
        padding: 15px 12px 12px !important;
        overflow: hidden;
        border-radius: 16px;
        border-color: rgba(15, 23, 42, 0.085);
        background:
            linear-gradient(
                145deg,
                #ffffff 0%,
                #f8fafc 55%,
                #ffffff 100%
            );
        box-shadow:
            0 10px 26px rgba(15, 23, 42, 0.065),
            0 2px 7px rgba(15, 23, 42, 0.035);
    }

    .latest-products-section .latest-products-shell::before {
        opacity: 0.34;
        background-size: 22px 22px;
    }

    .latest-products-section .latest-products-shell::after {
        left: 15px;
        width: 62px;
        height: 3px;
    }

    /*
     * Il padding è ora gestito dal contenitore shell.
     */
    .latest-products-section .latest-product-card {
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    .latest-products-section .latest-products-dots {
        padding-bottom: 2px;
    }
}

/*
 * Smartphone stretti.
 */
@media (max-width: 390px) {
    .latest-products-section .latest-products-shell {
        padding: 13px 9px 10px !important;
        border-radius: 14px;
    }

    .latest-products-section .latest-products-shell::after {
        left: 13px;
        width: 54px;
    }
}

/* ITNETCOM_HOME_PRODUCT_SHELL_PRO_V1 END */

/* ITNETCOM_HOME_PRODUCT_SHELL_CARD_GRID_V1 BEGIN */

/*
 * Griglia reale di separazione tra i prodotti.
 */
@media (min-width: 721px) {

    .latest-products-section .latest-products-track {
        align-items: stretch !important;
    }

    .latest-products-section .latest-product-card {
        position: relative;
        box-sizing: border-box;
        padding: 10px 14px 14px !important;
        border-radius: 14px;
        transition:
            background-color 0.2s ease,
            box-shadow 0.2s ease,
            transform 0.2s ease;
    }

    /*
     * Divisore verticale tra una card e la successiva.
     */
    .latest-products-section .latest-product-card::after {
        content: "";
        position: absolute;
        top: 18px;
        right: calc(var(--latest-products-gap, 24px) / -2);
        bottom: 18px;
        width: 1px;
        pointer-events: none;
        background:
            linear-gradient(
                180deg,
                transparent 0%,
                rgba(148, 163, 184, 0.18) 12%,
                rgba(148, 163, 184, 0.32) 50%,
                rgba(148, 163, 184, 0.18) 88%,
                transparent 100%
            );
    }

    /*
     * Evidenziazione molto leggera al passaggio del mouse.
     */
    .latest-products-section .latest-product-card:hover {
        background: rgba(255, 255, 255, 0.72);
        box-shadow:
            0 10px 24px rgba(15, 23, 42, 0.055),
            inset 0 0 0 1px rgba(148, 163, 184, 0.08);
        transform: translateY(-2px);
    }

    /*
     * Piccolo piede visivo sotto ogni prodotto.
     */
    .latest-products-section .latest-product-card::before {
        content: "";
        position: absolute;
        left: 16px;
        right: 16px;
        bottom: 0;
        height: 1px;
        pointer-events: none;
        background:
            linear-gradient(
                90deg,
                transparent 0%,
                rgba(227, 6, 19, 0.22) 22%,
                rgba(24, 24, 27, 0.16) 50%,
                rgba(227, 6, 19, 0.22) 78%,
                transparent 100%
            );
    }
}

/*
 * Tablet: separatori più delicati.
 */
@media (min-width: 721px) and (max-width: 1100px) {

    .latest-products-section .latest-product-card {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .latest-products-section .latest-product-card::after {
        top: 14px;
        bottom: 14px;
        opacity: 0.72;
    }
}

/*
 * Mobile: una sola card visibile, quindi niente divisori verticali.
 * Manteniamo soltanto una cornice interna molto leggera.
 */
@media (max-width: 720px) {

    .latest-products-section .latest-product-card {
        position: relative;
        border-radius: 13px;
        background:
            linear-gradient(
                180deg,
                rgba(255, 255, 255, 0.70) 0%,
                rgba(248, 250, 252, 0.42) 100%
            );
        box-shadow:
            inset 0 0 0 1px rgba(148, 163, 184, 0.075);
    }

    .latest-products-section .latest-product-card::before,
    .latest-products-section .latest-product-card::after {
        display: none !important;
    }
}

/* ITNETCOM_HOME_PRODUCT_SHELL_CARD_GRID_V1 END */

/* ITNETCOM_HOME_MOBILE_PRODUCT_IMAGES_WHITE_V1 BEGIN */

@media (max-width: 720px) {

    /*
     * Fondo totalmente bianco:
     * elimina qualsiasi differenza visibile con le fotografie prodotto
     * che hanno già uno sfondo bianco incorporato.
     */
    .latest-products-section .latest-products-shell,
    .latest-products-section .latest-product-card,
    .latest-products-section .latest-product-link,
    .latest-products-section .latest-product-media {
        background: #ffffff !important;
        background-image: none !important;
    }

    /*
     * In mobile rimuoviamo anche la griglia decorativa dalla shell:
     * restano bordo, angoli e ombra, ma l'area prodotto è bianca uniforme.
     */
    .latest-products-section .latest-products-shell::before {
        display: none !important;
    }

    /*
     * Area immagine più ampia e senza padding che riduce il prodotto.
     */
    .latest-products-section .latest-product-media {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        width: 100% !important;
        height: clamp(175px, 46vw, 220px) !important;
        min-height: 175px !important;
        max-height: 220px !important;

        margin: 0 0 6px !important;
        padding: 2px 4px !important;

        overflow: hidden !important;
        box-sizing: border-box !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    /*
     * Conserva sempre le proporzioni originali.
     * width:auto e height:auto evitano deformazioni e ritagli.
     */
    .latest-products-section .latest-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;
        padding: 0 !important;

        background: #ffffff !important;
        border: 0 !important;
        border-radius: 0 !important;

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

    /*
     * Evita zoom o trasformazioni hover ereditate dal desktop.
     */
    .latest-products-section
    .latest-product-link:hover
    .latest-product-media img {
        transform: none !important;
    }
}

@media (max-width: 390px) {

    .latest-products-section .latest-product-media {
        height: 180px !important;
        min-height: 180px !important;
        max-height: 180px !important;
        padding-inline: 2px !important;
    }
}

/* ITNETCOM_HOME_MOBILE_PRODUCT_IMAGES_WHITE_V1 END */

/* ITNETCOM_HOME_PRODUCT_WHITE_UNIFORM_V1 BEGIN */

.latest-products-section .latest-products-shell,
.latest-products-section .latest-products-viewport,
.latest-products-section .latest-products-track,
.latest-products-section .latest-product-card,
.latest-products-section .latest-product-link,
.latest-products-section .latest-product-media {
    background-color: #ffffff !important;
}

.latest-products-section .latest-products-shell,
.latest-products-section .latest-product-card,
.latest-products-section .latest-product-link,
.latest-products-section .latest-product-media {
    background-image: none !important;
}

/* Rimuove la griglia decorativa sul fondo dei prodotti. */
.latest-products-section .latest-products-shell::before {
    display: none !important;
}

/* Mantiene bianco anche durante hover desktop. */
@media (hover: hover) and (pointer: fine) {
    .latest-products-section .latest-product-card:hover {
        background: #ffffff !important;
        background-image: none !important;
    }
}

/* Immagini sempre contenute e mai ritagliate. */
.latest-products-section .latest-product-media {
    overflow: hidden !important;
}

.latest-products-section .latest-product-media img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #ffffff !important;
}

/* Conferma esplicita per mobile. */
@media (max-width: 720px) {
    .latest-products-section .latest-products-shell,
    .latest-products-section .latest-products-viewport,
    .latest-products-section .latest-products-track,
    .latest-products-section .latest-product-card,
    .latest-products-section .latest-product-link,
    .latest-products-section .latest-product-media {
        background: #ffffff !important;
        background-image: none !important;
    }
}

/* ITNETCOM_HOME_PRODUCT_WHITE_UNIFORM_V1 END */

/* ITNETCOM_HOME_PRODUCT_CARD_BOTTOM_LINE_REMOVE_V1 BEGIN */
@media (min-width: 721px) {
    .latest-products-section .latest-product-card::before {
        display: none !important;
        content: none !important;
    }
}
/* ITNETCOM_HOME_PRODUCT_CARD_BOTTOM_LINE_REMOVE_V1 END */

/* ITNETCOM_HOME_PRODUCT_SHELL_NO_CARD_V1 BEGIN */

/*
 * Mantiene la stessa larghezza e lo stesso allineamento
 * delle altre sezioni Home, ma elimina l'aspetto card
 * dal contenitore esterno del carosello prodotti.
 */
.latest-products-section .latest-products-shell,
.latest-products-section.home-product-section-latest_products_b2b .latest-products-shell,
.home-product-section-latest_products_b2b .latest-products-shell {
    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;
    background-image: none !important;

    box-shadow: none !important;
}

/*
 * Il viewport mantiene il ritaglio necessario al carosello,
 * ma non assume l'aspetto di una card.
 */
.latest-products-section .latest-products-viewport,
.latest-products-section.home-product-section-latest_products_b2b .latest-products-viewport,
.home-product-section-latest_products_b2b .latest-products-viewport {
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/*
 * Mantiene invariati:
 * - larghezza della sezione
 * - container generale
 * - frecce
 * - divisori tra prodotti
 * - scorrimento
 * - allineamento con le altre sezioni
 */

/* ITNETCOM_HOME_PRODUCT_SHELL_NO_CARD_V1 END */
