/* ============================================================
   RESPONSIVE — L'as du goût
   ============================================================
   Ce fichier gère TOUTE la responsivité du site.
   Il doit être chargé EN DERNIER dans le <head> de chaque page.

   Breakpoints :
     Desktop  : > 1024px  → styles de base (Mobile First d'abord ici)
     Tablette : 768px – 1024px
     Mobile   : < 768px
     XS       : < 480px

   Contenu :
     [1] Utilitaires globaux
     [2] Navbar & Hamburger menu
     [3] Hero
     [4] Sections générales (padding, titres)
     [5] Section À Propos
     [6] Grille Catégories
     [7] Section Chef
     [8] Grille Raisons
     [9] Section Avis & Reviews
    [10] Section Anciennes Enseignes
    [11] Section Partenaires
    [12] Galerie Défilante
    [13] Pages Catalogue (Grille Produits & CTA)
    [14] Modale Produit & Partenaire
    [15] Page Contact (Formulaire)
    [16] Footer
    [17] Panier (Cart)
    [18] Cookies Modal
    [19] Panier — XS
    [20] Header Spécialité — XS
   ============================================================ */


/* ============================================================
   [1] UTILITAIRES GLOBAUX
   ============================================================ */

/* Assure que les images, iframes et vidéos ne débordent jamais */
img, iframe, video {
    max-width: 100%;
}

/* Scrollbar invisible sur mobile */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    /* Réduit les paddings du conteneur principal */
    .contenu-principal {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ── Sur mobile, la navbar passe en sticky → pas besoin
   du grand margin-top desktop (120px). On le réduit. ── */
@media (max-width: 900px) {
    .contenu-principal {
        margin-top: 0;
        padding-top: 30px;
        padding-bottom: 40px;
    }
    /* Compense le scroll-margin pour les ancres */
    section {
        scroll-margin-top: 80px;
    }
}

@media (max-width: 560px) {
    .contenu-principal {
        padding-top: 20px;
        padding-left: 14px;
        padding-right: 14px;
    }
}


/* ============================================================
   [2] NAVBAR & HAMBURGER MENU
   ============================================================ */

/* Le bouton hamburger est caché par défaut (desktop) */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

/* Les 3 barres du hamburger */
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--c-or-vif);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animation en "X" lorsque le menu est ouvert */
.hamburger-btn.ouvert span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-btn.ouvert span:nth-child(2) { opacity: 0; }
.hamburger-btn.ouvert span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.hamburger-btn:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* ── TABLETTE : le menu reste visible mais les liens se réduisent ── */
@media (max-width: 1300px) {
    .nav-link {
        font-size: 0.75rem;
        margin: 0 4px;
        padding: 0 3px;
        letter-spacing: 0;
    }
    .navbar-brand-img {
        height: 40px;
        max-width: 400px;
    }
}

@media (max-width: 1050px) {
    .nav-link {
        font-size: 0.69rem;
        margin: 0 2px;
        padding: 0 2px;
    }
}

/* ── MOBILE : hamburger + menu déroulant ── */
@media (max-width: 900px) {

    /* ── Réorganisation de la rangée top ──
       On place le hamburger ENTRE le logo (gauche) et le brand-title (centre)
       grâce à un flex-wrap + order.
       Layout visuel : [Logo] [☰] [Brand Title] ......... [🛒]
       ────────────────────────────────────────────────── */

    .navbar-top {
        height: auto;
        min-height: 56px;
        padding: 8px 14px;
        flex-wrap: nowrap;
        gap: 8px;
    }

    /* Ordonnancement flex : logo + hamburger à gauche, panier à droite */
    .navbar-top-left   { order: 1; flex-shrink: 0; }
    .hamburger-btn     { order: 2; }
    .navbar-top-right  { order: 4; flex-shrink: 0; margin-left: auto; }

    /* Le brand-title reste centré sur TOUTE la navbar (centrage absolu
       sur le viewport, comme sur desktop) — pas entre les éléments */
    .navbar-top-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        order: 3;
        justify-content: center;
        z-index: 1; /* sous le hamburger et le panier en cas de chevauchement */
        pointer-events: none; /* laisse cliquer les boutons dessous si superposition */
    }

    .navbar-top-center a {
        pointer-events: auto; /* le lien du logo reste cliquable */
    }

    /* Logo plus petit sur mobile */
    .navbar-logo-icon {
        height: 40px;
    }

    /* Brand title centré : largeur bornée pour ne pas toucher les boutons */
    .navbar-brand-img {
        height: 29px;
        max-width: 52vw;
    }

    /* Affiche le hamburger */
    .hamburger-btn {
        display: flex;
        position: relative;
        z-index: 10;
    }

    /* ── Le menu POUSSE le contenu vers le bas ──
       position: relative + height: auto → le conteneur s'étend
       naturellement et décale tout le contenu en dessous ── */
    .navbar-nav {
        display: none;
        position: relative !important;
        width: 100%;
        height: auto !important;       /* Override la hauteur fixe de 48px du CSS de base */
        flex-direction: column;
        background-color: #0c0c0c;     /* Fond 100 % opaque — pas de transparence */
        border-top: 1px solid rgba(212, 175, 55, 0.2);
        border-bottom: 1px solid rgba(212, 175, 55, 0.15);
        padding: 8px 0 16px;
        z-index: 98;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        overflow: visible;
    }

    /* Classe CSS ajoutée par JS au clic sur le hamburger */
    .navbar-nav.mobile-ouverte {
        display: flex;
        animation: slideDown 0.3s ease;
    }

    /* Chaque lien prend toute la largeur */
    .nav-link {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;               /* Plus lisible sur mobile */
        font-weight: 600;
        margin: 0;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        justify-content: flex-start;
        color: #E8C678 !important;     /* Or clair — lisible sur fond noir, quel que soit le thème */
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .nav-link::after {
        display: none; /* Supprime la ligne animée sur mobile */
    }

    .nav-link.actif {
        background: rgba(212, 175, 55, 0.08);
        border-left: 3px solid var(--c-or-vif);
    }

    /* La navbar est sticky sur mobile : z-index pour passer au-dessus du contenu */
    .navbar {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    /* Compense la hauteur de la navbar maintenant sticky */
    .page-wrapper {
        padding-top: 0;
    }

    .navbar-top-right {
        gap: 8px;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   [3] HERO (Bannière d'accueil)
   ============================================================ */
@media (max-width: 900px) {
    .hero {
        padding-top: 0;          /* La navbar est sticky, pas besoin de compensation */
        height: auto;            /* Ne pas forcer 100vh sur mobile → évite le débordement */
        min-height: calc(100vh - 60px);   /* fallback pour anciens navigateurs */
        min-height: calc(100svh - 60px);  /* svh : exclut la barre d'adresse iOS/Android */
    }
    .hero-contenu {
        padding: 40px 24px;
        margin: 0 16px;
        width: calc(100% - 32px);
    }
    .hero-contenu h1 {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }
    .hero-contenu p {
        font-size: 1rem;
    }
}

@media (max-width: 560px) {
    .hero {
        min-height: calc(100vh - 60px);
        min-height: calc(100svh - 60px);
    }
    .hero-contenu {
        padding: 30px 18px;
        margin: 0 10px;
        width: calc(100% - 20px);
    }
    .hero-contenu h1 {
        font-size: 1.55rem;
        letter-spacing: 0.5px;
        line-height: 1.2;
    }
    .hero-contenu p {
        font-size: 0.9rem;
        margin-bottom: 0;
    }
    .hero-boutons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-top: 24px;
    }
    .btn-primaire,
    .btn-secondaire {
        width: 100%;
        max-width: 100%;
        min-width: unset;
        flex: none;
        padding: 14px 20px;
        font-size: 0.85rem;
    }
}


/* ============================================================
   [4] SECTIONS GÉNÉRALES (Padding & Titres globaux)
   ============================================================ */
@media (max-width: 900px) {
    .section-accueil,
    .section-about,
    .section-chef,
    .section-raisons,
    .section-enseignes,
    .section-partenaires {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Titres de sections un peu réduits */
    h2 {
        font-size: 1.9rem !important;
    }

    .surtitre {
        font-size: 0.8rem;
    }

    /* Réduit le margin entre sections */
    section {
        margin-bottom: 50px;
    }

    /* Écrase les margin-top inline excessifs (100px sur #univers, 50px sur #enseignes) */
    #univers {
        margin-top: 50px !important;
    }
    .section-enseignes {
        margin-top: 40px !important;
        margin-bottom: 50px !important;
    }
}

@media (max-width: 560px) {
    h2 {
        font-size: 1.6rem !important;
    }
    section {
        margin-bottom: 35px;
    }

    /* Sur très petits écrans, marges encore plus réduites */
    #univers {
        margin-top: 30px !important;
    }
    .section-enseignes {
        margin-top: 30px !important;
        margin-bottom: 35px !important;
    }
}



/* ============================================================
   [5] SECTION À PROPOS
   ============================================================ */
@media (max-width: 900px) {
    .about-container {
        flex-direction: column;
        gap: 30px;
    }
    .about-image,
    .about-texte {
        width: 100% !important;
        max-width: 100%;
    }
    .about-image .image-wrapper {
        height: 280px;
    }
}


/* ============================================================
   [6] GRILLE CATÉGORIES (Section Univers)
   ============================================================ */
@media (max-width: 1024px) {
    .grille-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .carte-categorie-img {
        height: 160px;
    }
}

@media (max-width: 560px) {
    .grille-categories {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .carte-categorie-img {
        height: 180px;
    }
}


/* ============================================================
   [7] SECTION CHEF
   ============================================================ */
@media (max-width: 900px) {
    .section-chef {
        padding: 40px 20px !important;
        margin: 40px 0 !important;
    }
    .chef-container {
        flex-direction: column-reverse; /* Image en haut, texte en bas */
        gap: 30px;
    }
    .chef-image,
    .chef-texte {
        width: 100% !important;
    }
    .chef-image .image-wrapper {
        height: 260px;
        /* Retire l'ombre décalée en or qui déborde sur mobile */
        box-shadow: 0 8px 25px rgba(0,0,0,0.4) !important;
    }
}


/* ============================================================
   [8] GRILLE RAISONS
   ============================================================ */
@media (max-width: 900px) {
    .section-raisons {
        padding: 40px 20px !important;
        margin: 40px 0 !important;
    }
    .raisons-grille {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    .raison-carte {
        padding: 25px !important;
    }
}


/* ============================================================
   [9] SECTION AVIS & REVIEWS MARQUEE
   ============================================================ */

@media (max-width: 768px) {
    .google-reviews-track {
        gap: 15px;
    }
}


/* ============================================================
   [10] SECTION ANCIENNES ENSEIGNES
   ============================================================ */
@media (max-width: 900px) {
    .enseignes-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 700px) and (min-width: 481px) {
    .enseignes-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


/* ============================================================
   [11] SECTION PARTENAIRES
   ============================================================ */
@media (max-width: 900px) {
    .partenaires-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .section-partenaires {
        margin: 40px 0 30px 0 !important;
    }
}

@media (max-width: 480px) {
    .partenaires-grid {
        grid-template-columns: 1fr !important;
    }
    .partenaire-card {
        min-height: unset;
    }
}


/* ============================================================
   [12] GALERIE DÉFILANTE
   ============================================================ 
   Note : hauteur et largeur déjà partiellement gérées dans main.css
   ============================================================ */
@media (max-width: 560px) {
    .galerie-img {
        width: 260px !important;
        height: 200px !important;
    }
    .galerie-track {
        height: 200px !important;
    }
    .galerie-marquee {
        height: 200px !important;
    }
}


/* ============================================================
   [13] PAGES CATALOGUE — GRILLE PRODUITS & CTA
   ============================================================ */

/* Section header des pages catalogue */
@media (max-width: 768px) {
    .section-header-specialite {
        display: block;
        padding: 16px 18px 14px;
        border-left: 3px solid var(--c-or-vif);
        text-align: left;
    }

    .section-header-specialite h1 {
        font-size: 1.8rem;
    }
}

/* La grille produits passe à 2 colonnes sur tablette, 1 sur mobile */
@media (max-width: 1200px) {
    .grille-produits {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .grille-produits {
        grid-template-columns: 1fr !important;
    }

    /* Les cartes produits stackent verticalement */
    .carte-produit {
        flex-direction: column !important;
    }

    .carte-produit-image-box {
        width: 100% !important;
        height: 200px !important;
    }
}

/* CTA Contact sur les pages catalogue */
@media (max-width: 768px) {
    .cta-contact-contenu {
        flex-direction: column !important;
        text-align: center;
        gap: 20px;
    }

    .bloc-cta-contact {
        padding: 24px 16px !important;
    }

    .bouton-envoyer {
        align-self: center;
        width: 100%;
        max-width: 280px;
    }
}


/* ============================================================
   [14] MODALES (Produit & Partenaire)
   ============================================================ */
@media (max-width: 768px) {
    .modal-contenu {
        flex-direction: column !important;
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 12px;
    }

    .modal-image {
        width: 100% !important;
        height: 220px !important;
        border-radius: 12px 12px 0 0;
    }

    .modal-texte {
        padding: 24px !important;
    }

    .modal-close {
        top: 12px !important;
        right: 12px !important;
    }

    /* Modale partenaire sur mobile */
    .modal-contenu.style-partenaire {
        max-width: 95vw !important;
    }

    .partner-infos-grid {
        grid-template-columns: 1fr !important;
    }

    .partner-actions {
        flex-direction: column !important;
        align-items: stretch;
        gap: 14px;
    }

    .partner-actions .bouton-envoyer {
        text-align: center;
    }
}


/* ============================================================
   [15] PAGE CONTACT (Formulaire)
   ============================================================ */
@media (max-width: 768px) {
    .formulaire-contact {
        padding: 28px 20px !important;
        margin: 0 !important;
        max-width: 100%;
    }

    .bouton-envoyer {
        width: 100%;
        max-width: 100%;
    }
}


/* ============================================================
   [16] FOOTER
   ============================================================ */

/* Réduction padding sur tablette */
@media (max-width: 1024px) {
    .footer-contenu {
        padding: 30px 30px !important;
    }
}

/* Sur mobile, tout passe en 1 colonne */
@media (max-width: 768px) {
    .footer-contenu {
        padding: 24px 20px !important;
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    .footer-col:nth-child(1),
    .footer-col:nth-child(2),
    .footer-col:nth-child(3),
    .footer-col:nth-child(4) {
        order: unset;
    }

    .footer-bas {
        padding: 14px 20px !important;
        text-align: center;
    }

    /* La map occupe moins de hauteur sur mobile */
    .footer-map {
        height: 200px !important;
    }

    /* QR codes côte à côte, centrés sur mobile */
    .footer-reseaux {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 20px !important;
        justify-content: center !important;
        align-items: flex-start;
    }

    /* Chaque lien QR : image au-dessus, label en dessous */
    .qr-code-lien {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .qr-code-img {
        width: 100px !important;
        height: 100px !important;
    }
}

@media (max-width: 380px) {
    .qr-code-img {
        width: 80px !important;
        height: 80px !important;
    }
}



/* ============================================================
   [17] PANIER — CART (Modale & Header)
   ============================================================ */

/* Cart grand-total box : passe en colonne si trop étroit */
@media (max-width: 480px) {
    .cart-overview-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px !important;
    }

    .cart-overview-header h2 {
        font-size: 1.1rem !important;
    }

    .cart-grand-total-box {
        width: 100%;
        justify-content: center;
        padding: 6px 14px;
        order: 3;
    }

    .cart-header-controls {
        gap: 8px;
    }

    .cart-total-label {
        font-size: 0.78rem;
    }

    .cart-grand-total-box strong {
        font-size: 1.1rem;
    }

    /* Bouton finaliser devis prend toute la largeur */
    .cart-overview-footer {
        padding: 16px !important;
    }

    .cart-overview-footer .bouton-envoyer {
        font-size: 0.85rem;
        padding: 12px 20px;
    }
}

/* Modale produit dual pane : empilement vertical sur mobile */
@media (max-width: 768px) {
    .cart-pane-left {
        min-width: unset !important;
    }
}


/* ============================================================
   [18] COOKIES MODAL — Responsive
   ============================================================ */
@media (max-width: 560px) {
    #ck-card {
        border-radius: 18px;
        max-width: calc(100vw - 24px);
    }

    #ck-head {
        padding: 18px 20px;
    }

    .ck-title {
        font-size: 1.1rem;
        gap: 8px;
    }

    .ck-title svg {
        width: 20px;
        height: 20px;
    }

    .ck-desc {
        font-size: 0.72rem;
        margin-bottom: 14px;
    }

    .ck-row {
        padding: 10px 12px;
        gap: 10px;
    }

    .ck-icon {
        width: 28px;
        height: 28px;
    }

    .ck-name {
        font-size: 0.75rem;
    }

    .ck-detail {
        font-size: 0.65rem;
    }
}


/* ============================================================
   [19] CART — XS (≤ 380px)
   ============================================================ */
@media (max-width: 380px) {
    .cart-overview-header h2 {
        font-size: 1rem !important;
    }

    .cart-grand-total-box strong {
        font-size: 1rem;
    }

    .cart-article-controles {
        padding: 4px 8px;
        gap: 5px;
    }

    .cart-qty-count {
        font-size: 0.8rem;
    }

    .cart-article-total {
        font-size: 0.8rem;
        min-width: 44px;
    }

    /* Catégorie titre réduit */
    .cart-categorie-titre {
        font-size: 0.65rem;
        letter-spacing: 1.5px;
    }

    /* Boutons +/- plus petits dans la modale produit */
    .cart-qty-modal {
        width: 30px;
        height: 30px;
        font-size: 1.1rem;
    }
}


/* ============================================================
   [20] SECTION HEADER SPECIALITE — XS Mobile
   ============================================================ */
@media (max-width: 480px) {
    .section-header-specialite {
        padding: 14px 16px;
        border-radius: 14px;
    }

    .section-header-specialite h1 {
        font-size: 1.5rem;
    }

    .section-header-specialite p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .section-header-specialite h1::after {
        width: 60px;
        margin: 8px auto 6px;
    }

    /* CTA Contact bloc */
    .bloc-cta-contact {
        padding: 18px 14px !important;
        border-radius: 14px;
    }

    .cta-contact-texte h3 {
        font-size: 1.2rem;
    }

    .cta-contact-texte p {
        font-size: 0.9rem;
    }
}

/* ============================================================
   [20] DURCISSEMENT MOBILE GLOBAL
   Tous les blocs à taille prédéfinie passent en fluide.
   ============================================================ */

/* ── Modale produit (dual pane) : empilement complet sur mobile ── */
@media (max-width: 768px) {
    .cart-modal {
        flex-direction: column;
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: 92vh;
        overflow-y: auto;
    }

    .cart-pane-right {
        width: 100%;
    }
}

/* ── Sections de l'accueil : paddings latéraux fluides ── */
@media (max-width: 560px) {
    .section-accueil,
    .section-about,
    .section-chef,
    .section-raisons,
    .section-enseignes,
    .section-partenaires,
    .section-galerie {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* ── Galerie défilante : vignettes adaptées aux petits écrans ── */
@media (max-width: 480px) {
    .galerie-img {
        width: min(260px, 78vw);
        height: 170px;
    }

    .galerie-marquee {
        height: 210px;
    }

    .galerie-track {
        height: 180px;
    }
}

/* ── Toute zone défilante horizontale reste contenue ── */
@media (max-width: 768px) {
    .galerie-marquee,
    .galerie-track {
        max-width: 100vw;
    }
}

/* ── Page Asso di Gusto Aix : équilibrage espacement CTA & téléphone boutique ── */
@media (max-width: 900px) {
    .bloc-cta-contact.aix-cta-bottom {
        margin-top: 45px;
        margin-bottom: 5px; /* 5px + 40px padding-bottom de .contenu-principal = 45px exact jusqu'au footer */
    }
}

@media (max-width: 480px) {
    .bloc-cta-contact.aix-cta-bottom {
        margin-top: 35px;
        margin-bottom: 0;
    }

    .aix-boutique-tel-link {
        font-size: clamp(0.74rem, 3.2vw, 0.88rem);
        gap: 4px;
    }
}
