/*
 * SenzaFronzoli – pagina prodotto mobile
 * Attivo solamente fino a 767px.
 */

@media (max-width: 767px) {

    body.catalog-product-view {
        background: #f4f6f4;
    }

    body.catalog-product-view main.page-main,
    body.catalog-product-view .page-main {
        width: 100% !important;
        padding-right: 8px !important;
        padding-left: 8px !important;
    }

    body.catalog-product-view .column.main {
        min-width: 0 !important;
    }

    /*
     * Nasconde l'eventuale titolo Magento duplicato
     * sopra la struttura personalizzata.
     */
    body.catalog-product-view
    .column.main > .page-title-wrapper {
        display: none !important;
    }

    body.catalog-product-view .breadcrumbs {
        margin: 0 -8px 8px !important;
        padding: 8px 12px !important;
        overflow-x: auto;
        font-size: 10px;
        white-space: nowrap;
        scrollbar-width: none;
    }

    body.catalog-product-view
    .breadcrumbs::-webkit-scrollbar {
        display: none;
    }

    .sfpdp-page {
        padding: 0 0 26px;
    }

    /*
     * Un'unica scheda per gallery e dati prodotto.
     */
    .sfpdp-top {
        display: block !important;
        width: 100%;
        padding: 7px;
        border: 1px solid #e4eae6;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 7px 22px rgba(25, 46, 33, .055);
    }

    .sfpdp-media {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 12px !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .sfpdp-media .gallery-placeholder,
    .sfpdp-media
    [data-gallery-role="gallery-placeholder"] {
        border-radius: 11px !important;
        background: #fff !important;
    }

    .sfpdp-media img {
        background: #fff !important;
        object-fit: contain;
    }

    /*
     * Miniature gallery.
     */
    .sfpdp-media button img,
    .sfpdp-media [role="button"] img {
        border-radius: 7px;
    }

    .sfpdp-summary {
        position: static !important;
        width: 100%;
        padding: 12px 5px 4px;
    }

    .sfpdp-category-badge {
        margin-bottom: 5px;
        padding: 4px 7px;
        font-size: 8px;
    }

    .sfpdp-title h1,
    .sfpdp-title .page-title,
    .sfpdp-title .page-title .base {
        font-size: 24px !important;
        line-height: 1.08 !important;
        letter-spacing: -.035em !important;
    }

    .sfpdp-sku {
        margin-top: 4px;
        font-size: 9px;
    }

    /*
     * Descrizione breve inizialmente compressa.
     */
    .sfpdp-short-description {
        margin-top: 8px;
        color: #566159;
        font-size: 12px;
        line-height: 1.45;
    }

    .sfpdp-short-description.nwc-mobile-short-content {
        display: -webkit-box;
        max-height: 69px;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .sfpdp-short-description.nwc-mobile-short-content.is-expanded {
        display: block;
        max-height: none;
        overflow: visible;
        -webkit-line-clamp: initial;
    }

    .nwc-mobile-inline-toggle {
        display: inline-flex;
        margin-top: 5px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #287447;
        font-size: 10px;
        font-weight: 800;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .sfpdp-rating {
        margin-top: 8px;
    }

    /*
     * Prezzo e disponibilità.
     */
    .sfpdp-price-stock {
        align-items: center;
        gap: 8px;
        margin-top: 10px;
    }

    .sfpdp-price .price {
        font-size: 28px !important;
    }

    .sfpdp-tax-label {
        margin-top: 2px;
        font-size: 9px;
    }

    .sfpdp-stock .stock {
        padding: 5px 8px;
        font-size: 9px;
    }

    .sfpdp-stock small {
        margin-top: 3px;
        font-size: 8px;
    }

    /*
     * Vantaggi commerciali compatti.
     */
    .sfpdp-benefits {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        margin-top: 11px;
        overflow: hidden;
        border: 1px solid #e0e7e2;
        border-radius: 10px;
        background: #fff;
    }

    .sfpdp-benefit {
        display: flex;
        min-width: 0;
        min-height: 63px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        padding: 7px 5px;
        border-right: 1px solid #e0e7e2;
        border-bottom: 0 !important;
        text-align: center;
    }

    .sfpdp-benefit:last-child {
        border-right: 0;
    }

    .sfpdp-benefit svg {
        width: 21px;
        height: 21px;
    }

    .sfpdp-benefit span {
        font-size: 8px;
        line-height: 1.2;
    }

    /*
     * Selettore prezzi quantità ultracompatto.
     */
    .nwc-tier-selector {
        margin: 10px 0 11px !important;
    }

    .nwc-tier-selector__heading {
        margin-bottom: 6px;
    }

    .nwc-tier-selector__heading h3 {
        font-size: 11px;
    }

    .nwc-tier-selector__grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 5px !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .nwc-tier-choice {
        min-width: 0 !important;
        min-height: 59px !important;
        flex: initial !important;
        gap: 5px !important;
        padding: 7px 6px !important;
        border-radius: 8px !important;
    }

    .nwc-tier-choice.is-active {
        padding: 6px 5px !important;
    }

    .nwc-tier-choice__top {
        gap: 3px;
    }

    .nwc-tier-choice__top strong {
        overflow: hidden;
        font-size: 9px !important;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nwc-tier-choice__badge {
        min-width: 30px !important;
        min-height: 17px !important;
        padding: 2px 4px !important;
        font-size: 7px !important;
    }

    .nwc-tier-choice__price-row {
        gap: 3px;
    }

    .nwc-tier-choice__price .price {
        font-size: 14px !important;
    }

    .nwc-tier-choice__price-row small {
        font-size: 7px;
    }

    /*
     * Quantità, carrello, wishlist e confronto.
     */
    body.catalog-product-view .sfpdp-buy-row {
        display: grid !important;
        grid-template-columns:
            42px
            minmax(0, 1fr)
            auto !important;
        gap: 6px !important;
        width: 100% !important;
        margin-top: 10px !important;
    }

    body.catalog-product-view .sfpdp-qty,
    body.catalog-product-view
    .sfpdp-qty .field.qty,
    body.catalog-product-view .sfpdp-cart,
    body.catalog-product-view
    .sfpdp-cart .actions {
        height: 44px !important;
        min-height: 44px !important;
    }

    body.catalog-product-view
    .sfpdp-qty input.qty {
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 3px !important;
        border-radius: 8px !important;
        font-size: 14px !important;
        line-height: 44px !important;
    }

    body.catalog-product-view
    .sfpdp-cart .action.tocart,
    body.catalog-product-view
    .sfpdp-cart button.tocart,
    body.catalog-product-view
    .sfpdp-cart .btn-primary {
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 8px !important;
        border-radius: 8px !important;
        font-size: 11px !important;
        box-shadow: 0 6px 13px rgba(40, 116, 71, .16) !important;
    }

    body.catalog-product-view
    .sfpdp-combined-actions {
        grid-template-columns: 38px 38px !important;
        gap: 5px !important;
        width: 81px !important;
        height: 44px !important;
    }

    body.catalog-product-view
    .sfpdp-combined-actions a,
    body.catalog-product-view
    .sfpdp-combined-actions button,
    body.catalog-product-view
    .sfpdp-combined-actions .action,
    body.catalog-product-view
    .sfpdp-combined-actions .btn {
        width: 38px !important;
        min-width: 38px !important;
        height: 44px !important;
        min-height: 44px !important;
        border-radius: 8px !important;
    }

    body.catalog-product-view
    .sfpdp-combined-actions svg {
        width: 18px !important;
        height: 18px !important;
    }

    /*
     * Countdown ridotto a una riga commerciale.
     */
    .sfpdp-countdown {
        grid-template-columns: 29px minmax(0, 1fr);
        gap: 7px;
        margin-top: 10px;
        padding: 7px 8px;
        border-radius: 9px;
    }

    .sfpdp-countdown > svg {
        width: 29px;
        height: 29px;
        padding: 6px;
    }

    .sfpdp-countdown p {
        gap: 2px 4px;
        font-size: 8px;
        line-height: 1.35;
    }

    .sfpdp-countdown small {
        display: none;
    }

    /*
     * Pagamento visibile ma compatto.
     */
    .sfpdp-payment-line {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 7px;
        margin-top: 8px;
        padding: 8px;
        border-radius: 9px;
    }

    .sfpdp-payment-line svg {
        width: 29px;
        height: 29px;
        padding: 6px;
    }

    .sfpdp-payment-line strong {
        font-size: 10px;
    }

    .sfpdp-payment-line small {
        font-size: 8px;
    }

    /*
     * Pulsanti per sezioni comprimibili.
     */
    .nwc-mobile-disclosure {
        display: flex;
        width: 100%;
        min-height: 39px;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 8px;
        padding: 8px 10px;
        border: 1px solid #dfe6e1;
        border-radius: 9px;
        background: #fff;
        color: #354139;
        font-size: 10px;
        font-weight: 800;
        text-align: left;
    }

    .nwc-mobile-disclosure::after {
        content: "+";
        display: inline-flex;
        width: 21px;
        height: 21px;
        flex: 0 0 21px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #edf5ef;
        color: #287447;
        font-size: 16px;
        font-weight: 500;
        line-height: 1;
    }

    .nwc-mobile-disclosure[aria-expanded="true"]::after {
        content: "−";
    }

    .nwc-mobile-collapsible.nwc-mobile-is-collapsed {
        display: none !important;
    }

    /*
     * Certificazioni compresse.
     */
    .sfpdp-certifications {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 6px;
        border-radius: 9px;
    }

    .sfpdp-certifications > div {
        min-height: 68px;
        gap: 4px;
        padding: 7px 4px;
    }

    .sfpdp-certifications svg {
        width: 23px;
        height: 23px;
    }

    .sfpdp-certifications span {
        font-size: 8px;
    }

    /*
     * Servizi inferiori nascosti dietro un unico pulsante.
     */
    .sfpdp-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        margin: 7px 0 10px;
        padding: 0;
        overflow: hidden;
        border: 1px solid #e0e7e2;
        border-radius: 10px;
    }

    .sfpdp-services > div {
        grid-template-columns: 27px minmax(0, 1fr);
        gap: 6px;
        min-height: 64px;
        padding: 8px;
        border-right: 1px solid #e0e7e2;
        border-bottom: 1px solid #e0e7e2;
    }

    .sfpdp-services > div:nth-child(2n) {
        border-right: 0;
    }

    .sfpdp-services > div:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .sfpdp-services svg {
        width: 24px;
        height: 24px;
    }

    .sfpdp-services strong {
        font-size: 8px;
        line-height: 1.25;
    }

    .sfpdp-services small {
        font-size: 7px;
        line-height: 1.25;
    }

    /*
     * Tab prodotto in una scheda compatta.
     */
    .sfpdp-tabs {
        margin-top: 10px;
        padding: 5px;
        border: 1px solid #e2e8e4;
        border-radius: 12px;
        background: #fff;
    }

    .sfpdp-tabs-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3px;
        padding: 3px;
        border: 0;
        border-radius: 9px;
        background: #f1f4f2;
    }

    .sfpdp-tabs-nav button {
        min-width: 0;
        padding: 8px 3px;
        overflow: hidden;
        border-radius: 7px;
        color: #68736c;
        font-size: 8px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sfpdp-tabs-nav button.is-active {
        background: #fff;
        color: #287447;
        box-shadow: 0 2px 7px rgba(24, 48, 34, .07);
    }

    .sfpdp-tabs-nav button.is-active::after {
        display: none;
    }

    .sfpdp-tab-panel {
        padding: 13px 7px 7px;
        font-size: 11px;
        line-height: 1.55;
    }

    .sfpdp-tab-panel h2 {
        margin: 17px 0 7px;
        font-size: 18px;
    }

    .sfpdp-tab-panel h3 {
        margin: 15px 0 6px;
        font-size: 16px;
    }

    .sfpdp-tab-panel p {
        margin-bottom: 9px;
    }

    /*
     * Descrizione completa inizialmente ridotta.
     */
    .nwc-mobile-description-content {
        position: relative;
        transition: max-height 220ms ease;
    }

    .nwc-mobile-description-content.is-collapsed {
        max-height: 430px;
        overflow: hidden;
        -webkit-mask-image:
            linear-gradient(
                to bottom,
                #000 0,
                #000 84%,
                transparent 100%
            );
        mask-image:
            linear-gradient(
                to bottom,
                #000 0,
                #000 84%,
                transparent 100%
            );
    }

    .nwc-mobile-description-content.is-expanded {
        max-height: none;
        overflow: visible;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .nwc-mobile-description-toggle {
        display: flex;
        width: 100%;
        min-height: 40px;
        align-items: center;
        justify-content: center;
        margin-top: 8px;
        border: 1px solid #cddbd1;
        border-radius: 8px;
        background: #f2f8f4;
        color: #287447;
        font-size: 10px;
        font-weight: 850;
    }

    /*
     * Recensioni più ordinate.
     */
    .sfpdp-tab-panel .review-form,
    .sfpdp-tab-panel form.review-form,
    .sfpdp-tab-panel .block.review-add {
        margin-top: 10px;
        padding: 10px;
        border-radius: 10px;
    }

    /*
     * Prodotti consigliati.
     */
    .nwc-random-upsell {
        margin-top: 18px;
        padding-top: 18px;
    }

    .nwc-random-upsell__header {
        gap: 8px;
        margin-bottom: 12px;
    }

    .nwc-random-upsell__header h2 {
        font-size: 19px;
    }

    .nwc-random-upsell__header p {
        font-size: 9px;
    }

    .nwc-random-upsell__refresh {
        min-height: 32px;
        padding: 0 9px;
        font-size: 8px;
    }

    .nwc-random-upsell__grid {
        gap: 8px;
    }

    .nwc-random-upsell__card {
        border-radius: 11px;
    }

    .nwc-random-upsell__content {
        padding: 8px;
    }

    .nwc-random-upsell__name {
        min-height: 32px;
        font-size: 9px;
        line-height: 1.3;
    }

    .nwc-random-upsell__price {
        margin-top: 6px;
    }

    .nwc-random-upsell__price strong {
        font-size: 14px;
    }

    .nwc-random-upsell__button {
        min-height: 34px;
        padding: 6px;
        border-radius: 7px;
        font-size: 8px;
    }

    /*
     * Riduzione spazio prima del footer.
     */
    .sfpdp-related {
        margin-top: 18px;
    }
}

/* NWC-MOBILE-GALLERY-THUMBS-START */

@media (max-width: 767px) {

    /*
     * Manteniamo le sorgenti a 180px per la nitidezza,
     * ma visualizziamo le miniature a 68px.
     */
    body.catalog-product-view
    .sfpdp-media #thumbs {
        width: 100% !important;
        min-height: 76px !important;
        align-items: center !important;
        gap: 3px !important;
        margin-top: 6px !important;
        overflow: hidden !important;
    }

    /*
     * Contenitore scorrevole delle miniature.
     */
    body.catalog-product-view
    .sfpdp-media #thumbs .thumbs-wrapper,
    body.catalog-product-view
    .sfpdp-media #thumbs .js_thumbs_slides {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 2px 0 5px !important;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    body.catalog-product-view
    .sfpdp-media #thumbs .thumbs-wrapper::-webkit-scrollbar,
    body.catalog-product-view
    .sfpdp-media #thumbs .js_thumbs_slides::-webkit-scrollbar {
        display: none;
    }

    /*
     * Singolo elemento della barra.
     */
    body.catalog-product-view
    .sfpdp-media #thumbs .js_thumbs_slide {
        display: flex !important;
        width: 68px !important;
        min-width: 68px !important;
        max-width: 68px !important;
        height: 68px !important;
        min-height: 68px !important;
        flex: 0 0 68px !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        scroll-snap-align: start;
    }

    body.catalog-product-view
    .sfpdp-media #thumbs .js_thumbs_slide > button {
        display: flex !important;
        width: 68px !important;
        min-width: 68px !important;
        max-width: 68px !important;
        height: 68px !important;
        min-height: 68px !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        padding: 2px !important;
        border-radius: 8px !important;
        background: #ffffff !important;
    }

    /*
     * L'immagine rimane interamente visibile:
     * niente ritagli laterali o verticali.
     */
    body.catalog-product-view
    .sfpdp-media #thumbs .js_thumbs_slide img {
        display: block !important;
        width: 62px !important;
        min-width: 62px !important;
        max-width: 62px !important;
        height: 62px !important;
        min-height: 62px !important;
        max-height: 62px !important;
        margin: 0 !important;
        border-radius: 6px !important;
        background: #ffffff !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    /*
     * Frecce laterali più piccole.
     */
    body.catalog-product-view
    .sfpdp-media #thumbs > button {
        display: flex !important;
        width: 28px !important;
        min-width: 28px !important;
        height: 68px !important;
        min-height: 68px !important;
        flex: 0 0 28px !important;
        align-items: center !important;
        justify-content: center !important;
        align-self: center !important;
        padding: 3px !important;
    }

    body.catalog-product-view
    .sfpdp-media #thumbs > button svg {
        width: 18px !important;
        height: 18px !important;
    }

    /*
     * Evidenziazione della miniatura selezionata.
     */
    body.catalog-product-view
    .sfpdp-media #thumbs
    .js_thumbs_slide > button.border-primary {
        border-width: 2px !important;
        border-color: #287447 !important;
    }

    /*
     * Overlay video proporzionato alla miniatura.
     */
    body.catalog-product-view
    .sfpdp-media #thumbs
    .js_thumbs_slide span.absolute svg {
        width: 25px !important;
        height: 25px !important;
    }
}

/* NWC-MOBILE-GALLERY-THUMBS-END */
