/*
 * Santamaria Homepage Pro — V4.18.0
 * Consolidation mobile commune.
 * Ce fichier est volontairement chargé en dernier.
 */

/* Garde-fous communs */
body.smhp-page,
body.smhp-shop-native-page,
body.smhp-product-native-page,
body.smhp-cart-native-page,
body.smhp-checkout-native-page,
body.smhp-account-native-page,
body.smhp-rental-native-page,
body.smhp-appointment-native-page,
body.smhp-stores-native-page,
body.smhp-advice-native-page,
body.smhp-content-native-page,
body.sme-page{
    overflow-x:clip;
    -webkit-text-size-adjust:100%;
}
body.smhp-page img,
body.smhp-shop-native-page img,
body.smhp-product-native-page img,
body.smhp-cart-native-page img,
body.smhp-checkout-native-page img,
body.smhp-account-native-page img,
body.smhp-rental-native-page img,
body.smhp-appointment-native-page img,
body.smhp-stores-native-page img,
body.smhp-advice-native-page img,
body.smhp-content-native-page img,
body.sme-page img{
    max-width:100%;
}
body.smhp-page button,
body.smhp-page a,
body.smhp-shop-native-page button,
body.smhp-shop-native-page a,
body.smhp-product-native-page button,
body.smhp-product-native-page a,
body.smhp-cart-native-page button,
body.smhp-cart-native-page a,
body.smhp-checkout-native-page button,
body.smhp-checkout-native-page a,
body.smhp-account-native-page button,
body.smhp-account-native-page a,
body.smhp-rental-native-page button,
body.smhp-rental-native-page a,
body.smhp-appointment-native-page button,
body.smhp-appointment-native-page a,
body.smhp-stores-native-page button,
body.smhp-stores-native-page a,
body.smhp-advice-native-page button,
body.smhp-advice-native-page a,
body.smhp-content-native-page button,
body.smhp-content-native-page a,
body.sme-page button,
body.sme-page a{
    -webkit-tap-highlight-color:transparent;
}

/* Tablettes */
@media(max-width:900px){
    .smhp-shared-header{
        width:100%;
    }
    .smhp-shared-actions{
        gap:7px;
    }
    .smhp-shared-menu,
    .smhp-shared-account,
    .smhp-shared-cart{
        min-width:44px;
        min-height:44px;
        flex:0 0 44px;
    }

    /* WooCommerce : évite les colonnes étroites impraticables */
    .smhp-checkout-native-page .col2-set,
    .smhp-checkout-native-page .woocommerce-billing-fields__field-wrapper,
    .smhp-checkout-native-page .woocommerce-shipping-fields__field-wrapper,
    .smhp-account-native-page .u-columns,
    .smhp-account-native-page .woocommerce-Addresses{
        min-width:0!important;
    }

    /* Produits */
    .smhp-product-native-page .smp-information,
    .smhp-product-native-page .smp-confidence-head{
        min-width:0;
    }
    .smhp-product-native-page .smp-help-inner{
        min-width:0;
    }

    /* Boutique */
    .smhp-shop-native-page .smn-shop,
    .smhp-shop-native-page .smn-products,
    .smhp-shop-native-page .smn-toolbar{
        min-width:0;
    }
}

/* Mobile principal */
@media(max-width:700px){
    /* iOS : 16px empêche le zoom automatique des champs */
    body.smhp-page input,
    body.smhp-page select,
    body.smhp-page textarea,
    body.smhp-shop-native-page input,
    body.smhp-shop-native-page select,
    body.smhp-shop-native-page textarea,
    body.smhp-product-native-page input,
    body.smhp-product-native-page select,
    body.smhp-product-native-page textarea,
    body.smhp-cart-native-page input,
    body.smhp-cart-native-page select,
    body.smhp-cart-native-page textarea,
    body.smhp-checkout-native-page input,
    body.smhp-checkout-native-page select,
    body.smhp-checkout-native-page textarea,
    body.smhp-account-native-page input,
    body.smhp-account-native-page select,
    body.smhp-account-native-page textarea,
    body.smhp-appointment-native-page input,
    body.smhp-appointment-native-page select,
    body.smhp-appointment-native-page textarea{
        font-size:16px!important;
    }

    /* Header partagé */
    .smhp-shared-header{
        min-height:68px;
        padding-inline:14px;
        grid-template-columns:minmax(0,1fr) auto;
        gap:8px;
    }
    .smhp-shared-brand{
        min-width:0;
    }
    .smhp-shared-brand img{
        max-width:142px;
        height:34px;
    }
    .smhp-shared-actions{
        gap:6px;
    }
    .smhp-shared-nav{
        top:68px;
        max-height:calc(100dvh - 68px);
        overflow-y:auto;
        overscroll-behavior:contain;
        padding:8px 16px 18px;
    }
    .smhp-shared-nav a{
        min-height:48px;
        display:flex;
        align-items:center;
        padding:12px 3px;
    }

    /* Tous les boutons importants restent facilement cliquables */
    .smhp-page .smhp-btn,
    .smhp-shop-native-page .smn-filter-open,
    .smhp-shop-native-page .smn-product a,
    .smhp-product-native-page .smp-add-cart,
    .smhp-product-native-page .smp-help-actions a,
    .smhp-cart-native-page .smc-update,
    .smhp-cart-native-page .smc-checkout,
    .smhp-checkout-native-page #place_order,
    .smhp-rental-native-page .smr-btn,
    .smhp-stores-native-page .sms-primary,
    .smhp-stores-native-page .sms-store-actions a,
    .smhp-advice-native-page .smad-primary,
    .smhp-advice-native-page .smad-secondary,
    .smhp-appointment-native-page .elementor-button,
    .smhp-content-native-page .smhc-404-actions a,
    .sme-page .sme-primary,
    .sme-page .sme-secondary{
        min-height:46px;
    }

    /* Accueil */
    .smhp-page .smhp-hero,
    .smhp-page .smhp-section,
    .smhp-page .smhp-advisor,
    .smhp-page .smhp-game{
        max-width:100%;
    }
    .smhp-page .smhp-hero h1{
        overflow-wrap:anywhere;
    }
    .smhp-page .smhp-advisor-options{
        grid-template-columns:1fr!important;
        width:100%!important;
        max-width:none!important;
    }
    .smhp-page .smhp-advisor-option{
        width:100%;
        min-height:68px;
    }
    .smhp-page .smhp-advisor-result-actions,
    .smhp-page .smhp-advisor-controls{
        width:100%;
        flex-wrap:wrap;
    }
    .smhp-page .smhp-advisor-result-actions a,
    .smhp-page .smhp-advisor-controls button{
        max-width:100%;
    }

    /* Boutique */
    .smhp-shop-native-page .smn-hero{
        min-height:0;
    }
    .smhp-shop-native-page .smn-toolbar{
        align-items:stretch;
        gap:12px;
    }
    .smhp-shop-native-page .smn-tools{
        width:100%;
        display:grid;
        grid-template-columns:1fr;
        gap:9px;
    }
    .smhp-shop-native-page .smn-search,
    .smhp-shop-native-page .smn-sort,
    .smhp-shop-native-page .smn-sort select{
        width:100%;
        min-width:0;
    }
    .smhp-shop-native-page .smn-products{
        grid-template-columns:1fr!important;
    }
    .smhp-shop-native-page .smn-product{
        min-width:0;
    }
    .smhp-shop-native-page .smn-product-visual{
        min-height:250px;
    }
    .smhp-shop-native-page .smn-sidebar{
        max-width:100%;
    }

    /* Fiche produit */
    .smhp-product-native-page .smp-product,
    .smhp-product-native-page .smp-information,
    .smhp-product-native-page .smp-confidence-grid{
        grid-template-columns:1fr!important;
    }
    .smhp-product-native-page .smp-product{
        gap:24px!important;
    }
    .smhp-product-native-page .smp-gallery{
        min-width:0;
    }
    .smhp-product-native-page .smp-main-image{
        min-height:0!important;
        height:auto!important;
        aspect-ratio:1/1;
    }
    .smhp-product-native-page .smp-main-product-image{
        max-height:78vw;
        object-fit:contain;
    }
    .smhp-product-native-page .smp-thumbnails{
        display:flex!important;
        overflow-x:auto;
        gap:8px;
        padding-bottom:5px;
        scrollbar-width:thin;
        scroll-snap-type:x proximity;
    }
    .smhp-product-native-page .smp-thumbnail{
        flex:0 0 74px;
        scroll-snap-align:start;
    }
    .smhp-product-native-page .smp-buy-row,
    .smhp-product-native-page .smp-cart-form{
        width:100%;
        align-items:stretch;
        flex-wrap:wrap;
    }
    .smhp-product-native-page .smp-buy-row .quantity,
    .smhp-product-native-page .smp-cart-form .quantity{
        flex:0 0 100%;
    }
    .smhp-product-native-page .smp-buy-row .qty,
    .smhp-product-native-page .smp-cart-form .qty{
        width:100%!important;
        min-height:46px;
    }
    .smhp-product-native-page .smp-add-cart{
        width:100%;
        justify-content:center;
    }
    .smhp-product-native-page .smp-specs{
        min-width:0;
        overflow-wrap:anywhere;
    }
    .smhp-product-native-page .smp-technical-source,
    .smhp-product-native-page .smp-tech-meta-row{
        overflow-wrap:anywhere;
    }
    .smhp-product-native-page .smp-technical-source table{
        display:block;
        max-width:100%;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
    }
    .smhp-product-native-page .smp-help-actions{
        width:100%;
        display:grid;
        grid-template-columns:1fr;
    }
    .smhp-product-native-page .smp-help-actions a{
        width:100%;
        white-space:normal;
        text-align:center;
    }

    /* Panier */
    .smhp-cart-native-page .smc-item{
        min-width:0;
    }
    .smhp-cart-native-page .smc-product{
        min-width:0;
    }
    .smhp-cart-native-page .smc-product-copy{
        min-width:0;
        overflow-wrap:anywhere;
    }
    .smhp-cart-native-page .smc-coupon{
        display:grid;
        grid-template-columns:1fr;
        gap:8px;
    }
    .smhp-cart-native-page .smc-coupon input,
    .smhp-cart-native-page .smc-coupon button{
        width:100%!important;
    }
    .smhp-cart-native-page .smc-checkout{
        width:100%;
        justify-content:center;
    }

    /* Commande */
    .smhp-checkout-native-page .smco-checkout-shell,
    .smhp-checkout-native-page .woocommerce-checkout,
    .smhp-checkout-native-page #customer_details,
    .smhp-checkout-native-page .col2-set{
        min-width:0!important;
    }
    .smhp-checkout-native-page .form-row,
    .smhp-checkout-native-page .form-row-first,
    .smhp-checkout-native-page .form-row-last{
        width:100%!important;
        float:none!important;
        margin-right:0!important;
    }
    .smhp-checkout-native-page .select2-container{
        width:100%!important;
    }
    .smhp-checkout-native-page #order_review,
    .smhp-checkout-native-page .woocommerce-checkout-review-order-table{
        min-width:0!important;
    }
    .smhp-checkout-native-page .woocommerce-checkout-review-order-table{
        table-layout:fixed;
        width:100%;
    }
    .smhp-checkout-native-page .woocommerce-checkout-review-order-table th,
    .smhp-checkout-native-page .woocommerce-checkout-review-order-table td{
        overflow-wrap:anywhere;
    }
    .smhp-checkout-native-page #place_order{
        width:100%!important;
    }

    /* Compte */
    .smhp-account-native-page .woocommerce-MyAccount-navigation ul{
        scroll-snap-type:x proximity;
        -webkit-overflow-scrolling:touch;
    }
    .smhp-account-native-page .woocommerce-MyAccount-navigation li{
        scroll-snap-align:start;
    }
    .smhp-account-native-page .woocommerce-MyAccount-navigation a{
        min-height:44px;
        display:flex!important;
        align-items:center;
    }
    .smhp-account-native-page .woocommerce-MyAccount-content,
    .smhp-account-native-page .woocommerce-Addresses,
    .smhp-account-native-page .woocommerce-Address{
        min-width:0;
        overflow-wrap:anywhere;
    }
    .smhp-account-native-page table.shop_table{
        -webkit-overflow-scrolling:touch;
    }

    /* Location */
    .smhp-rental-native-page .smr-hero-actions{
        display:grid;
        grid-template-columns:1fr;
        width:100%;
    }
    .smhp-rental-native-page .smr-hero-actions .smr-btn{
        width:100%;
        justify-content:center;
    }
    .smhp-rental-native-page .smr-universe-nav{
        grid-template-columns:1fr!important;
        gap:9px;
    }
    .smhp-rental-native-page .smr-card{
        min-width:0;
    }
    .smhp-rental-native-page .smr-card-media{
        height:240px!important;
        padding:18px;
    }
    .smhp-rental-native-page .smr-prices{
        gap:8px;
    }
    .smhp-rental-native-page .smr-contact{
        gap:24px;
    }

    /* Magasins */
    .smhp-stores-native-page .sms-store{
        min-width:0;
    }
    .smhp-stores-native-page .sms-store-top{
        align-items:flex-start;
        gap:10px;
    }
    .smhp-stores-native-page .sms-hours{
        min-width:0;
    }
    .smhp-stores-native-page .sms-store-actions{
        display:grid!important;
        grid-template-columns:1fr;
    }
    .smhp-stores-native-page .sms-store-actions a{
        width:100%;
        justify-content:center;
    }

    /* Conseils */
    .smhp-advice-native-page .smad-hero-actions,
    .smhp-advice-native-page .smad-expert-actions{
        display:grid;
        grid-template-columns:1fr;
        width:100%;
    }
    .smhp-advice-native-page .smad-hero-actions a,
    .smhp-advice-native-page .smad-expert-actions a{
        width:100%;
        justify-content:center;
        text-align:center;
    }
    .smhp-advice-native-page .smad-themes{
        grid-template-columns:1fr!important;
    }
    .smhp-advice-native-page .smad-feature-copy,
    .smhp-advice-native-page .smad-article{
        min-width:0;
        overflow-wrap:anywhere;
    }

    /* Atelier / RDV */
    .smhp-appointment-native-page .sma-rdv-form-card,
    .smhp-appointment-native-page .sma-rdv-original-form,
    .smhp-appointment-native-page .elementor-container,
    .smhp-appointment-native-page .elementor-column,
    .smhp-appointment-native-page .elementor-widget-wrap{
        min-width:0!important;
        max-width:100%!important;
    }
    .smhp-appointment-native-page .sma-rdv-original-form .elementor-field-group,
    .smhp-appointment-native-page .sma-rdv-original-form input,
    .smhp-appointment-native-page .sma-rdv-original-form select,
    .smhp-appointment-native-page .sma-rdv-original-form textarea{
        max-width:100%!important;
    }

    /* Machines d'exception */
    .sme-page .sme-hero h1{
        font-size:clamp(43px,13vw,56px)!important;
        overflow-wrap:anywhere;
    }
    .sme-page .sme-actions{
        display:grid;
        grid-template-columns:1fr;
    }
    .sme-page .sme-actions a{
        width:100%;
        justify-content:center;
    }
    .sme-page .sme-product-foot{
        gap:12px;
    }
    .sme-page .sme-fixed-video-frame,
    .sme-page iframe{
        max-width:100%;
    }

    /* Pages historiques reprises par le plugin + 404 */
    .smhp-content-native-page .smhc-hero h1,
    .smhp-content-native-page .smhc-404 h1{
        font-size:clamp(38px,12vw,54px);
        overflow-wrap:anywhere;
    }
    .smhp-content-native-page .smhc-content{
        font-size:16px;
        overflow-wrap:anywhere;
    }
    .smhp-content-native-page .smhc-content table{
        display:block;
        max-width:100%;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
    }
    .smhp-content-native-page .smhc-404-actions{
        display:grid;
        width:100%;
        grid-template-columns:1fr;
    }
    .smhp-content-native-page .smhc-404-actions a{
        width:100%;
        text-align:center;
    }
}

/* Petits mobiles */
@media(max-width:420px){
    .smhp-shared-header{
        padding-inline:12px;
    }
    .smhp-shared-brand img{
        max-width:126px;
        height:31px;
    }
    .smhp-shared-actions{
        gap:5px;
    }
    .smhp-shared-account{
        display:none!important;
    }

    .smhp-product-native-page .smp-main-image{
        aspect-ratio:1/1.05;
    }
    .smhp-product-native-page .smp-thumbnail{
        flex-basis:66px;
    }
    .smhp-rental-native-page .smr-card-media{
        height:215px!important;
    }
    .sme-page .sme-hero-panel,
    .smhp-stores-native-page .sms-store,
    .smhp-advice-native-page .smad-expert,
    .smhp-product-native-page .smp-confidence-card{
        border-radius:14px;
    }
}

/* Accessibilité : réduction des animations */
@media(prefers-reduced-motion:reduce){
    body.smhp-page *,
    body.smhp-shop-native-page *,
    body.smhp-product-native-page *,
    body.smhp-cart-native-page *,
    body.smhp-checkout-native-page *,
    body.smhp-account-native-page *,
    body.smhp-rental-native-page *,
    body.smhp-appointment-native-page *,
    body.smhp-stores-native-page *,
    body.smhp-advice-native-page *,
    body.smhp-content-native-page *,
    body.sme-page *{
        scroll-behavior:auto!important;
    }
}
