.woocommerce ul.products li.product.hidden{
    display: none;
}
.woocommerce ul.products li.product{
    height: 200px;
    padding: 0;
}
.woocommerce ul.products li.product figure{
    position: relative;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.woocommerce ul.products li.product img{
    transform-origin: center!important;
    max-width: none!important;
    padding: 0;
}

#infinite-scroll{
    display: flex;
    justify-content: center;
}
.woocommerce ul.products li.product{
    background: transparent;
    height: 220px;
}
.woocommerce ul.products li.product figure{
    height: 220px;
}
.woocommerce ul.products li.product figure.biggerimage__nozoom img{
    position: static!important;
    -webkit-transform: none!important;
    transform: none!important;
}
.woocommerce ul.products li.product a figure.biggerimage__nozoom img{
    height: 100%;
    width: auto;
    object-fit: contain;
    position: static;
}

.single-product .woocommerce-product-gallery__wrapper{
    height: auto;
}
.woocommerce ul.products li.product .button.yith-wcqv-button{
    height: 16px;
}
.woocommerce ul.products li.product .button.yith-wcqv-button{
    background-image: url(../images/icona_plus_nera.png);
    background-size: contain;
}


/* newsletter: su mobile il plugin manda il pulsante a capo a tutta larghezza; email e pulsante restano sulla stessa riga */
@media (max-width: 767px){
    .tnp-subscription-minimal form{
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
    }
    .tnp-subscription-minimal .tnp-email{
        flex: 1 1 0;
        width: auto!important;
        min-width: 0;
        height: 44px;
        margin: 0 8px 0 0;
    }
    .tnp-subscription-minimal .tnp-submit{
        flex: 0 0 auto;
        width: auto!important;
        height: 44px;
        margin: 0;
        padding-left: 16px;
        padding-right: 16px;
    }
    .tnp-subscription-minimal .tnp-privacy-field{
        flex: 0 0 100%;
        min-width: 0;
    }
    /* il testo della privacy andava su una sola riga e allargava la pagina (scroll orizzontale) */
    .tnp-subscription-minimal .tnp-privacy-field,
    .tnp-subscription-minimal .tnp-privacy-field label{
        white-space: normal;
    }
    /* casella della privacy allineata a sinistra, con il testo accanto */
    .tnp-subscription-minimal .tnp-privacy-field{
        margin-top: 10px;
        text-align: left;
    }
    .tnp-subscription-minimal .tnp-privacy-field label{
        display: flex;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        margin: 0;
        text-align: left;
    }
    .tnp-subscription-minimal .tnp-privacy-field input.tnp-privacy{
        flex: 0 0 auto;
        margin: 1px 0 0;
        transform: none!important; /* il widget Elementor della home la sposta in alto di 12px per il vecchio layout */
    }
    .tnp-subscription-minimal .tnp-privacy-field label a{
        display: inline;
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* newsletter nel footer delle home (Elementor): testo e segnaposto erano grigi su fondo grigio, quasi illeggibili */
.elementor .tnp-subscription-minimal input.tnp-email{
    color: #fff!important; /* il widget Elementor imposta #cbcbcb con un selettore più specifico */
}
.elementor .tnp-subscription-minimal input.tnp-email::placeholder{
    color: rgba(255, 255, 255, .85);
    opacity: 1;
}

/* menu mobile B2B: elenco ordinato invece di gruppi sparpagliati su tutta l'altezza */
#mobilemenu{
    justify-content: flex-start;
    padding: 18px 24px 28px;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
}
#mobilemenu #mobile_menu_logo{
    padding-right: 56px;
    margin-bottom: 28px;
}
#mobilemenu #mobile_menu_logo img{
    max-width: 140px;
    height: auto;
}
#mobilemenu #closeMobileMenu{
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    background-size: 18px;
}
#mobilemenu .static-mobilemenu-widget li{
    border-bottom: 1px solid #e6e6e6;
}
#mobilemenu .static-mobilemenu-widget a,
#mobilemenu .static-mobilemenu-widget:nth-child(2) a{
    font-size: 14px;
    letter-spacing: .15em;
    padding: 15px 0;
}
#mobilemenu .static-mobilemenu-widget:nth-child(2) li{
    border-top: 1px solid #e6e6e6;
}
/* "Esci": staccato dalle voci principali e più discreto */
#mobilemenu .static-mobilemenu-widget li.checkuser{
    border-bottom: 0;
    margin-top: 24px;
}
#mobilemenu .static-mobilemenu-widget li.checkuser a{
    color: #8a8a8a;
    font-size: 12px;
    padding: 8px 0;
}
#mobilemenu #mobilemenu_lang_switcher{
    margin-top: 0;
    padding-top: 28px;
    justify-content: flex-start;
    gap: 10px;
}
#mobilemenu #mobilemenu_lang_switcher a{
    width: 56px;
    height: 40px;
    line-height: 38px;
    border-radius: 20px;
    font-size: 13px;
    letter-spacing: .1em;
}

/* ===== Home (Elementor, IT ed EN hanno gli stessi id) — solo mobile ===== */
@media (max-width: 767px){

    /* topbar: lingua a sinistra, a destra solo Termini e FAQ su una riga
       (Homepage è la pagina stessa, Contatti è già nella barra scura) */
    .elementor-element-c8eb5bf{
        flex-wrap: nowrap!important;
        align-items: center!important;
        padding: 0 12px!important;
    }
    .elementor-element-c8eb5bf .elementor-element-7afa8fe{
        width: auto!important;
        flex: 0 0 auto!important;
    }
    .elementor-element-c8eb5bf .elementor-element-a8568f6{
        width: auto!important;
        flex: 1 1 auto!important;
        min-width: 0;
    }
    .elementor-element-c8eb5bf .elementor-element-246d5de{
        display: none!important;
    }
    .elementor-element-a8568f6 .elementor-nav-menu--main > ul{
        flex-wrap: nowrap!important;
        justify-content: flex-end!important;
    }
    .elementor-element-a8568f6 .elementor-nav-menu--main > ul > li:nth-child(1),
    .elementor-element-a8568f6 .elementor-nav-menu--main > ul > li:nth-child(2){
        display: none!important;
    }
    .elementor-element-a8568f6 .elementor-nav-menu--main > ul > li > a{
        font-size: 11px!important;
        letter-spacing: .08em!important;
        padding: 10px 0 10px 14px!important;
        white-space: nowrap;
    }

    /* barra scura About / Gallery / News / Contatti: non tocca più i bordi */
    .elementor-element-4142c3a .elementor-icon-list-text{
        font-size: 12px!important;
        letter-spacing: .12em!important;
    }

    /* footer come quello del B2B: un solo fondo scuro, senza riquadri */
    .elementor-element-9a12453{
        background-color: #2B2E34!important;
        padding: 12px 20px 0!important;
    }
    .elementor-element-9a12453 > .e-con-inner,
    .elementor-element-c903b8c > .e-con-inner,
    .elementor-element-bd7e807 > .e-con-inner{
        padding: 0!important;
        gap: 0!important;
    }
    .elementor-element-497d3d5,
    .elementor-element-01df3fc{
        background-color: transparent!important;
        padding: 20px 0!important;
        margin: 0!important;
    }
    .elementor-element-01df3fc{
        border-top: 1px solid rgba(255, 255, 255, .12);
        align-items: flex-start!important;
    }
    .elementor-element-01df3fc .elementor-widget-heading{
        margin-bottom: 12px!important;
    }
    .elementor-element-01df3fc .elementor-heading-title{
        font-size: 13px!important;
        font-family: Karla, sans-serif!important;
        text-transform: uppercase;
        letter-spacing: .1em;
        text-align: left;
    }
    .elementor-element-01df3fc .elementor-widget-spacer{
        display: none;
    }
    .elementor-element-01df3fc .elementor-social-icons-wrapper{
        justify-content: flex-start!important;
    }
    .elementor-element-01df3fc .elementor-social-icon{
        font-size: 15px!important;
    }

    .elementor-element-c903b8c{
        padding: 20px!important;
        gap: 10px!important;
        border-top: 1px solid rgba(255, 255, 255, .12);
    }
    .elementor-element-c903b8c .e-con{
        padding: 0!important;
        margin-bottom: 10px;
    }
    .elementor-element-c903b8c .elementor-heading-title{
        font-size: 13px!important;
        line-height: 1.5!important;
        text-transform: uppercase;
        letter-spacing: .1em;
        color: #fff!important;
    }
    .elementor-element-c903b8c .elementor-element-33f4293 .elementor-heading-title{
        font-weight: 700!important;
    }

    .elementor-element-bd7e807{
        padding: 16px 20px 24px!important;
        border-top: 1px solid rgba(255, 255, 255, .12);
        gap: 12px!important;
    }
    .elementor-element-bd7e807 .e-con{
        padding: 0!important;
        justify-content: flex-start!important;
        text-align: left!important;
    }
}

/* menu mobile: con la barra di WordPress (utenti loggati come admin) la modale parte sotto la barra */
@media (max-width: 782px){
    body.admin-bar #mobilemenu{
        top: 46px;
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
        min-height: 0;
    }
}
@media (min-width: 783px){
    body.admin-bar #mobilemenu{
        top: 32px;
        height: calc(100vh - 32px);
        min-height: 0;
    }
}

/* area account: voce della pagina corrente */
.woocommerce-MyAccount-navigation .list-group-item.is-active{
    color: #232323;
    font-weight: 700;
}

/* area account su mobile: voci come tab orizzontali scorrevoli invece dell'elenco verticale */
@media (max-width: 767px){
    .woocommerce-MyAccount-navigation{
        position: relative;
        margin: 0 -15px 24px;
        border-bottom: 1px solid #e6e6e6;
    }
    /* sfumatura a destra: fa capire che i tab continuano */
    .woocommerce-MyAccount-navigation:after{
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 1px;
        width: 36px;
        background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff);
        pointer-events: none;
    }
    .woocommerce-MyAccount-navigation .list-group{
        position: relative;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        padding: 0 15px;
        gap: 22px;
    }
    .woocommerce-MyAccount-navigation .list-group::-webkit-scrollbar{
        display: none;
    }
    .woocommerce-MyAccount-navigation .list-group-item{
        flex: 0 0 auto;
        width: auto;
        border: 0;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        background: transparent;
        padding: 14px 0 12px;
        margin: 0;
        font-size: 12px;
        letter-spacing: .1em;
        white-space: nowrap;
        scroll-snap-align: start;
    }
    .woocommerce-MyAccount-navigation .list-group-item:last-child{
        margin-right: 24px; /* l'ultimo tab non resta sotto la sfumatura */
    }
    .woocommerce-MyAccount-navigation .list-group-item.is-active{
        border-bottom-color: #232323;
    }
}

/* dettaglio selezione (ordine) su mobile: indirizzi a tutta larghezza, uno sotto l'altro.
   WooCommerce usa le classi col-1/col-2 che collidono con la griglia Bootstrap del tema */
@media (max-width: 767px){
    .woocommerce-customer-details .woocommerce-columns--addresses{
        display: block;
        margin: 0;
    }
    .woocommerce-customer-details .woocommerce-column{
        float: none;
        width: 100%;
        max-width: 100%!important; /* il tema la limita al 50% con !important */
        flex: none;
        padding: 0;
        margin-bottom: 24px;
    }
    .woocommerce-customer-details .woocommerce-column__title,
    .woocommerce-customer-details > h2{
        font-size: 22px;
        line-height: 1.25;
        margin-bottom: 12px;
    }
    .woocommerce-customer-details address{
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }
    .woocommerce-customer-details address p{
        margin-bottom: 4px;
    }
}

/* ===== Carrello ===== */

/* titolo della pagina: il tema lo nascondeva solo nel carrello */
.woocommerce-cart #after-main-nav,
.woocommerce-cart .entry-header{
    display: block;
}
.woocommerce-cart #main{
    margin-top: 0;
}

/* su mobile ogni articolo diventa una card con immagine (stessa soglia della vista mobile di WooCommerce) */
@media (max-width: 768px){
    .woocommerce-cart table.shop_table_responsive,
    .woocommerce-cart table.shop_table_responsive tbody{
        display: block;
        width: 100%;
        border: 0;
    }
    .woocommerce-cart table.shop_table_responsive thead{
        display: none;
    }
    .woocommerce-cart table.shop_table_responsive tr.cart_item{
        display: grid;
        grid-template-columns: 96px 1fr;
        column-gap: 16px;
        position: relative;
        padding: 18px 0;
        border-bottom: 1px solid #e6e6e6;
        background: transparent!important;
    }
    .woocommerce-cart table.shop_table_responsive tr.cart_item td{
        grid-column: 2;
        display: flex!important;
        align-items: baseline;
        gap: 0;
        padding: 2px 0!important;
        border: 0!important;
        background: transparent!important;
        text-align: left!important;
        font-size: 13px;
        letter-spacing: .04em;
        line-height: 1.5;
    }
    .woocommerce-cart table.shop_table_responsive tr.cart_item td::before{
        content: attr(data-title);
        float: none!important;
        flex: 0 0 88px;
        margin-right: 10px;
        font-size: 10px;
        font-weight: 400;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: #8a8a8a;
    }
    /* immagine a sinistra, per tutta l'altezza della card */
    .woocommerce-cart table.shop_table_responsive tr.cart_item td.product-thumbnail{
        grid-column: 1;
        grid-row: 1 / span 6;
        display: block!important;
        padding: 0!important;
    }
    .woocommerce-cart table.shop_table_responsive td.product-thumbnail figure{
        width: 96px;
        height: 96px;
        margin: 0;
    }
    .woocommerce-cart table.shop_table_responsive td.product-thumbnail figure img{
        max-height: 84px;
        max-width: 84px;
        width: auto;
        height: auto;
    }
    /* codice articolo come titolo della card */
    .woocommerce-cart table.shop_table_responsive tr.cart_item td.product-name{
        font-size: 16px;
        font-weight: 700;
        padding-right: 40px!important;
        margin-bottom: 6px;
    }
    .woocommerce-cart table.shop_table_responsive tr.cart_item td.product-name::before,
    .woocommerce-cart table.shop_table_responsive tr.cart_item td.product-thumbnail::before,
    .woocommerce-cart table.shop_table_responsive tr.cart_item td.product-remove::before,
    .woocommerce-cart table.shop_table_responsive tr.cart_item td.product-notes::before{
        display: none;
    }
    /* rimuovi: in alto a destra */
    .woocommerce-cart table.shop_table_responsive tr.cart_item td.product-remove{
        position: absolute;
        top: 12px;
        right: 0;
        padding: 0!important;
    }
    .woocommerce-cart table.shop_table_responsive td.product-remove a.remove{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        font-size: 22px!important;
        text-decoration: none!important;
        line-height: 1;
    }
    .woocommerce-cart table.shop_table_responsive td.product-quantity .quantity input.qty{
        width: 64px;
        height: 34px;
        text-align: center;
    }
    /* nota a tutta larghezza sotto */
    .woocommerce-cart table.shop_table_responsive tr.cart_item td.product-notes{
        grid-column: 1 / -1;
        display: block!important;
        margin-top: 12px;
    }
    .woocommerce-cart table.shop_table_responsive td.product-notes textarea{
        width: 100%;
        height: 48px;
    }
    /* riga finale: avviso e pulsanti uno sotto l'altro */
    .woocommerce-cart table.shop_table_responsive tr:not(.cart_item){
        display: block;
    }
    .woocommerce-cart table.shop_table_responsive td.actions{
        display: block!important;
        padding: 18px 0 0!important;
        background: transparent!important;
        border: 0!important;
    }
    .woocommerce-cart table.shop_table_responsive td.actions::before{
        display: none;
    }
    .woocommerce-cart table.shop_table_responsive td.actions .disclaimer{
        float: none;
        max-width: none;
        font-size: 13px;
        margin-bottom: 14px;
    }
    .woocommerce-cart table.shop_table_responsive td.actions .btn{
        display: block;
        width: 100%;
        margin: 0 0 10px;
    }
}

/* ===== Elenco selezioni (ordini) ===== */
.woocommerce-orders-table td.order-preview{
    display: none;
}
@media (max-width: 767px){
    table.account-orders-table,
    table.account-orders-table tbody{
        display: block;
        width: 100%;
        border: 0;
    }
    table.account-orders-table thead{
        display: none;
    }
    table.account-orders-table tr.order{
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 16px;
        padding: 16px;
        margin-bottom: 14px;
        border: 1px solid #e6e6e6;
        background: #fff!important;
    }
    table.account-orders-table tr.order td{
        display: block!important;
        padding: 0!important;
        border: 0!important;
        background: transparent!important;
        text-align: left!important;
        font-size: 14px;
        line-height: 1.4;
    }
    table.account-orders-table tr.order td::before{
        content: attr(data-title);
        display: block;
        float: none!important;
        margin-bottom: 2px;
        font-size: 10px;
        font-weight: 400;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: #8a8a8a;
    }
    table.account-orders-table tr.order td.woocommerce-orders-table__cell-order-number a{
        font-size: 16px;
        font-weight: 700;
        color: #232323;
    }
    /* anteprima immagini in alto */
    table.account-orders-table tr.order td.order-preview{
        grid-column: 1 / -1;
    }
    table.account-orders-table tr.order td.order-preview::before,
    table.account-orders-table tr.order td.woocommerce-orders-table__cell-order-actions::before{
        display: none;
    }
    .order-preview__images{
        display: flex;
        gap: 8px;
    }
    .order-preview__image img,
    .order-preview__more{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 64px;
        height: 64px;
        object-fit: contain;
        background: #F8F7F6;
    }
    .order-preview__more{
        font-size: 14px;
        color: #555;
    }
    /* pulsante "Vedi" a tutta larghezza */
    table.account-orders-table tr.order td.woocommerce-orders-table__cell-order-actions{
        grid-column: 1 / -1;
    }
    table.account-orders-table tr.order td.woocommerce-orders-table__cell-order-actions .btn{
        display: block;
        width: 100%;
        margin: 0 0 6px;
        text-align: center;
    }
}

/* carrello da 768 a 1199px: tabella compatta, perché a larghezza piena non ci sta nel contenitore
   (a 980px chiedeva 959px su 690 disponibili e la pagina scorreva di lato) */
@media (min-width: 769px) and (max-width: 1199px){
    .woocommerce-cart .woocommerce-cart-form{
        overflow-x: auto; /* rete di sicurezza: semmai scorre la tabella, non la pagina */
    }
    .woocommerce-cart table.shop_table th{
        font-size: 10px;
        letter-spacing: .04em;
        padding: 10px 4px;
    }
    .woocommerce-cart table.shop_table td{
        font-size: 11px;
        letter-spacing: .02em;
        padding: 8px 4px;
    }
    .woocommerce-cart table.shop_table th.product-thumbnail,
    .woocommerce-cart table.shop_table td.product-thumbnail{
        width: 60px;
    }
    .woocommerce-cart table.shop_table td.product-thumbnail figure{
        width: 56px;
        height: 56px;
    }
    .woocommerce-cart table.shop_table td.product-thumbnail figure img{
        max-height: 50px;
    }
    .woocommerce-cart table.shop_table td.product-notes textarea{
        width: 70px;
        height: 48px;
    }
    .woocommerce-cart table.shop_table td.product-quantity input.qty{
        width: 44px;
    }
}

/* newsletter: il testo della privacy va a capo a ogni larghezza (su tablet allargava ancora la pagina) */
.tnp-subscription-minimal .tnp-privacy-field,
.tnp-subscription-minimal .tnp-privacy-field label{
    white-space: normal;
}

/* header mobile/tablet: l'hamburger era ancorato a destra della sua colonna;
   su tablet e "sito desktop" del telefono finiva accanto al logo invece che sul bordo sinistro */
@media (max-width: 991px){
    #mobilemenu-toggle{
        left: 15px;
        right: auto;
    }
}
