/* ========================================================================
   Hi Afrika — RESPONSIVE & FINITIONS 2026 (chargé en dernier)
   ------------------------------------------------------------------------
   Ce fichier durcit l'affichage mobile là où WooCommerce casse le plus
   souvent (panier, commande, fiche produit, tableaux « Mon compte »),
   agrandit les cibles tactiles, empêche les débordements horizontaux, et
   ajoute quelques finitions « high-tech » à la boutique.

   Il est additif : il ne modifie aucun autre fichier, il surcharge.
   ======================================================================== */

/* ------------------------------------------------------------------
   0. Garde-fous globaux (tous écrans)
   ------------------------------------------------------------------ */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }
*, *::before, *::after { box-sizing: border-box; }

/* Jamais de débordement latéral dû à un média large. */
.hero-section, .our-story-section, .product-feature,
.ha-shop-wrap, .woocommerce, .woocommerce-page { max-width: 100vw; }

/* ==================================================================
   1. COMPOSANT « LIVRAISON OFFERTE » (marché US)
   ================================================================== */
.ha-freeship-bar {
    background: linear-gradient(90deg,
        var(--ha-green, #4A7A3D) 0%,
        var(--ha-green-dark, #2D5A22) 100%);
    color: #fff;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 12px 18px;
    border-radius: 12px;
    margin: 0 0 26px;
    box-shadow: 0 6px 18px rgba(45, 90, 34, 0.18);
}

.ha-freeship-progress {
    background: var(--ha-cream-light, #FAF4E8);
    border: 1px solid rgba(200, 165, 96, 0.35);
    border-radius: 14px;
    padding: 16px 18px;
    margin: 0 0 22px;
}
.ha-freeship-progress__msg {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--ha-text-dark, #2C1810);
    text-align: center;
}
.ha-freeship-progress__msg strong { color: var(--ha-green-dark, #2D5A22); }
.ha-freeship-progress__track {
    height: 10px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.ha-freeship-progress__fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg,
        var(--ha-gold, #C8A560),
        var(--ha-green, #4A7A3D));
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.ha-freeship-progress.is-complete .ha-freeship-progress__fill {
    background: var(--ha-green, #4A7A3D);
}
.ha-freeship-hint {
    color: var(--ha-green-dark, #2D5A22);
    font-weight: 600;
    font-size: 0.9rem;
    margin: 6px 0 14px;
}

/* ==================================================================
   2. FINITIONS « HIGH-TECH » DE LA BOUTIQUE (tous écrans)
   ================================================================== */
/* Carte produit : légère élévation + zoom image au survol. */
.woocommerce ul.products li.product,
.ha-shop-main ul.products li.product {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s ease;
}
@media (hover: hover) {
    .woocommerce ul.products li.product:hover,
    .ha-shop-main ul.products li.product:hover {
        transform: translateY(-6px);
        box-shadow: 0 18px 40px rgba(42, 20, 5, 0.14);
    }
    .ha-card-media img,
    .woocommerce ul.products li.product img {
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: transform;
    }
    .woocommerce ul.products li.product:hover .ha-card-media img,
    .ha-shop-main ul.products li.product:hover img {
        transform: scale(1.06);
    }
    /* Bouton « Ajouter au panier » : ombre douce au survol. */
    .woocommerce a.button.add_to_cart_button:hover,
    .woocommerce ul.products li.product .button:hover {
        box-shadow: 0 8px 20px rgba(200, 165, 96, 0.35);
        transform: translateY(-2px);
    }
}
/* La carte ne rogne pas l'image qui « déborde » au zoom. */
.ha-card-media { overflow: hidden; }

/* Boutons : transition homogène. */
.woocommerce a.button,
.woocommerce button.button,
.btn-primary, .btn-outline {
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

/* ==================================================================
   3. FICHE PRODUIT — mobile
   ================================================================== */
@media (max-width: 768px) {
    /* Deux colonnes (galerie | résumé) → empilées. */
    .woocommerce div.product .woocommerce-product-gallery,
    .woocommerce div.product .summary,
    .woocommerce-page div.product .woocommerce-product-gallery,
    .woocommerce-page div.product .summary {
        width: 100% !important;
        float: none !important;
        margin: 0 0 24px !important;
    }
    .woocommerce div.product .summary { margin-bottom: 0 !important; }

    .woocommerce div.product p.price,
    .woocommerce div.product span.price { font-size: 1.4rem; }

    /* Onglets description : plus lisibles. */
    .woocommerce div.product .woocommerce-tabs ul.tabs { padding-left: 0; }
    .woocommerce div.product .woocommerce-tabs ul.tabs li {
        display: block;
        margin: 0 0 4px;
        border-radius: 8px;
    }

    /* Produits liés : 2 colonnes. */
    .woocommerce .related ul.products,
    .woocommerce .up-sells ul.products,
    .woocommerce-page .related ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 18px !important;
    }
}
@media (max-width: 480px) {
    .woocommerce .related ul.products,
    .woocommerce .up-sells ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* ==================================================================
   4. PANIER — mobile (tableau → cartes)
   ================================================================== */
@media (max-width: 768px) {
    .woocommerce table.cart thead { display: none; }
    .woocommerce table.cart,
    .woocommerce table.cart tbody { display: block; width: 100%; }

    .woocommerce table.cart tr.cart_item {
        display: grid;
        grid-template-columns: 84px 1fr;
        grid-gap: 6px 14px;
        align-items: center;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 14px;
        padding: 14px;
        margin: 0 0 14px;
        background: var(--ha-white, #FFFDF8);
    }
    .woocommerce table.cart tr.cart_item td {
        display: block;
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
    }
    .woocommerce table.cart td.product-remove {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }
    .woocommerce table.cart td.product-thumbnail {
        grid-column: 1;
        grid-row: 1 / span 3;
    }
    .woocommerce table.cart td.product-thumbnail img { width: 84px; border-radius: 10px; }
    .woocommerce table.cart td.product-name { grid-column: 2; font-weight: 600; }
    .woocommerce table.cart td.product-price::before { content: "Price: "; opacity: 0.6; }
    .woocommerce table.cart td.product-subtotal::before { content: "Subtotal: "; opacity: 0.6; }
    .woocommerce table.cart td.product-quantity { grid-column: 2; margin-top: 6px; }

    /* Bloc « code promo » + « mettre à jour » : pleine largeur. */
    .woocommerce .cart .actions,
    .woocommerce .cart .actions .coupon { display: block; width: 100%; }
    .woocommerce .cart .actions .coupon input#coupon_code {
        width: 100% !important;
        margin: 0 0 10px !important;
    }
    .woocommerce .cart .actions .coupon .button,
    .woocommerce .cart .actions > .button {
        width: 100%;
        float: none;
        margin: 0 0 10px;
    }

    /* Totaux : pleine largeur. */
    .woocommerce .cart-collaterals .cart_totals { width: 100% !important; float: none !important; }
}

/* ==================================================================
   5. COMMANDE (checkout) — mobile
   ================================================================== */
@media (max-width: 768px) {
    .woocommerce .col2-set .col-1,
    .woocommerce .col2-set .col-2,
    .woocommerce-page .col2-set .col-1,
    .woocommerce-page .col2-set .col-2 {
        width: 100% !important;
        float: none !important;
        margin: 0 0 18px !important;
    }
    .woocommerce form .form-row-first,
    .woocommerce form .form-row-last,
    .woocommerce-page form .form-row-first,
    .woocommerce-page form .form-row-last {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
    }
    #order_review, #order_review_heading { width: 100% !important; float: none !important; }
}

/* Champs de formulaire lisibles & sans zoom iOS (16px mini). */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-page form .form-row input.input-text,
input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="search"], input[type="number"], select, textarea {
    font-size: 16px;
    max-width: 100%;
}

/* ==================================================================
   6. « MON COMPTE » — mobile
   ================================================================== */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce-MyAccount-navigation,
    .woocommerce-account .woocommerce-MyAccount-content {
        width: 100% !important;
        float: none !important;
        margin: 0 0 18px !important;
    }
    .woocommerce table.shop_table_responsive tr,
    .woocommerce-page table.shop_table_responsive tr {
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 12px;
        margin-bottom: 12px;
        display: block;
        padding: 6px 12px;
    }
}

/* ==================================================================
   7. CIBLES TACTILES & EN-TÊTE — mobile
   ================================================================== */
@media (max-width: 768px) {
    /* Boutons d'action confortables au doigt (>= 44px). */
    .header-actions button,
    .header-actions a,
    .menu-toggle,
    .search-toggle,
    .cart-toggle {
        min-width: 44px;
        min-height: 44px;
    }
    /* Boutons WooCommerce pleine largeur & hauts. */
    .woocommerce a.button,
    .woocommerce button.button,
    .woocommerce input.button,
    .woocommerce #respond input#submit {
        min-height: 46px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    .woocommerce div.product form.cart .button,
    .single_add_to_cart_button {
        width: 100%;
        display: block;
        text-align: center;
    }
    .woocommerce div.product form.cart .quantity {
        float: none;
        margin: 0 0 12px;
        display: flex;
        justify-content: center;
    }
    .woocommerce div.product form.cart .quantity .qty {
        width: 88px;
        height: 46px;
        text-align: center;
    }

    /* Le menu mobile coulissant s'adapte aux très petits écrans. */
    .main-navigation { width: min(86%, 340px); }
}

/* ==================================================================
   8. TABLETTE — grille boutique intermédiaire
   ================================================================== */
@media (min-width: 561px) and (max-width: 900px) {
    .ha-shop-main ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Très grand écran : la boutique respire un peu plus. */
@media (min-width: 1500px) {
    .ha-container, .container { max-width: 1360px; }
}

/* ==================================================================
   9. DIVERS — évite les débordements de tableaux hérités
   ================================================================== */
.woocommerce table.shop_table { width: 100%; }
@media (max-width: 560px) {
    .woocommerce table.shop_table { font-size: 0.9rem; }
    .ha-freeship-bar { font-size: 0.82rem; padding: 10px 14px; }
}
