/* ============================================================
   B.P.M — CSS Améliorations (enhancements.css) v2
   Hamburger unifié sur .open — fonctionne sur toutes les pages
   ============================================================ */

/* ── BLOQUER TOUT SCROLL HORIZONTAL ─────────────────────────── */
/*
 * Triple blocage du scroll horizontal :
 * 1. overflow-x:hidden sur html et body
 * 2. clip-path n'est pas nécessaire ici — on gère via left:100vw dans le menu
 * Ces règles s'appliquent TOUJOURS, pas uniquement sur mobile.
 */
html {
  overflow-x: hidden !important;
  scroll-behavior: smooth;
}
body {
  overflow-x: hidden !important;
  max-width: 100vw;
  position: relative; /* crée un contexte de stacking pour le clip */
}

/* ── HAMBURGER ──────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 1002;
  position: relative;
}
.hamburger:hover { background: rgba(198,40,40,0.08); }
.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--texte-fonce);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  transform-origin: center;
}
/* Animation X quand ouvert */
.hamburger.open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
  background: var(--rouge);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
  background: var(--rouge);
}

/* ── OVERLAY (fond sombre derrière le menu) ─────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
/* S'affiche uniquement quand .active est ajouté par le JS */
.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* ── MENU MOBILE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  /*
   * Le menu est TOUJOURS hors écran par défaut.
   * Il ne s'affiche que quand .open est ajouté par le JS.
   * Ni .nav-links seul, ni .nav-links:not(.open) ne doivent être visibles.
   */
  /*
   * MENU MOBILE — RENDU ABSOLUMENT INVISIBLE AVANT CLIC
   *
   * Stratégie : on ne l'anime plus avec translateX depuis right:0.
   * On le place à left:100vw (complètement hors du viewport),
   * on le rend invisible, et on bloque tout événement.
   * Aucun swipe ne peut l'atteindre car il n'est pas
   * à droite du viewport — il est au-delà.
   */
  .nav-links {
    /* Retirer du flux normal et du viewport */
    position: fixed !important;
    top: 0 !important;
    /* left:100vw = commence là où le viewport finit → jamais visible */
    left: 100vw !important;
    right: auto !important;
    bottom: 0 !important;
    width: min(320px, 85vw) !important;
    height: 100vh !important;

    /* Style */
    background: var(--blanc-casse) !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 80px 0 32px !important;
    z-index: 1000 !important;
    gap: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-shadow: -8px 0 40px rgba(0,0,0,0.15) !important;

    /* Triple verrouillage */
    transform: none !important;          /* pas de translate — left:100vw suffit */
    visibility: hidden !important;       /* invisible au moteur de rendu */
    pointer-events: none !important;     /* aucun clic ni tactile */
    opacity: 0 !important;              /* transparent en plus */

    /* Transitions : slide depuis droite à l'ouverture */
    transition:
      left 0.35s cubic-bezier(.4,0,.2,1),
      visibility 0s linear 0.35s,
      opacity 0.35s ease !important;
  }

  /* OUVERT — repositionner dans le viewport + lever tous les verrous */
  .nav-links.open {
    left: calc(100vw - min(320px, 85vw)) !important; /* aligner à droite */
    visibility: visible !important;
    pointer-events: all !important;
    opacity: 1 !important;
    /* visibility et opacity deviennent actifs IMMÉDIATEMENT */
    transition:
      left 0.35s cubic-bezier(.4,0,.2,1),
      visibility 0s linear 0s,
      opacity 0.2s ease !important;
  }

    /* Bouton fermer (×) à l'intérieur du menu */
  .nav-mobile-close {
    display: flex !important;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(198,40,40,0.08);
    border: none;
    color: var(--rouge);
    font-size: 20px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 1001;
  }
  .nav-mobile-close:hover { background: rgba(198,40,40,0.18); }

  /* Label BPM en haut du menu */
  .nav-links::before {
    content: 'B.P.M Merlo';
    display: block;
    position: absolute;
    top: 22px;
    left: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 16px;
    color: var(--rouge);
    letter-spacing: 1px;
  }

  .nav-links li { width: 100%; list-style: none; }

  .nav-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 700;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(212,164,55,0.1);
    color: var(--texte-fonce);
    border-radius: 0;
    transition: background 0.2s, color 0.2s, padding-left 0.2s;
    text-decoration: none;
  }
  .nav-link i {
    width: 20px;
    font-size: 18px;
    color: var(--or-fonce);
    flex-shrink: 0;
    display: inline-block !important;
  }
  .nav-link:hover,
  .nav-link.active {
    background: rgba(198,40,40,0.06);
    color: var(--rouge);
    padding-left: 32px;
    border-right: 3px solid var(--rouge);
  }
  .nav-link.active i,
  .nav-link:hover i { color: var(--rouge); }

  /* Bouton langue dans le menu mobile */
  .nav-lang-mobile {
    padding: 16px 24px;
    border-top: 2px solid rgba(212,164,55,0.2);
    margin-top: 8px;
    display: block !important;
    width: 100%;
  }
  .lang-btn-mobile {
    display: flex !important;
    align-items: center;
    gap: 8px;
    background: var(--rouge);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: background 0.2s;
  }
  .lang-btn-mobile i { font-size: 16px; }
}

/* Sur desktop : menu horizontal normal, pas d'icônes, pas de close btn */
@media (min-width: 769px) {
  .nav-mobile-close { display: none !important; }
  .nav-lang-mobile  { display: none !important; }
  .nav-link i       { display: none !important; }
  /*
   * Annuler TOUS les styles mobile sur desktop.
   * Sans ce bloc, les !important du mobile s'appliqueraient quand même.
   */
  .nav-links {
    transform: none !important;
    visibility: visible !important;
    pointer-events: all !important;
    position: static !important;
    height: auto !important;
    width: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    flex-direction: row !important;
    overflow-y: visible !important;
    transition: none !important;
    /* Annuler display:block potentiel */
    display: flex !important;
  }
}

/* ── ICÔNES VALEURS ─────────────────────────────────────────── */
.valeur-icon-wrap {
  width: 56px; height: 56px; border-radius: 16px;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 26px; color: var(--or-clair);
  transition: transform 0.3s, background 0.3s;
}
.valeur-item:hover .valeur-icon-wrap {
  transform: scale(1.1) rotate(-5deg); background: rgba(255,255,255,0.25);
}
.valeur-icon { display: none; }

/* ── SKELETON LOADER ─────────────────────────────────────────── */
.product-skeleton {
  background: #fff; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(212,164,55,0.12); height: 320px; position: relative;
}
.product-skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, #f5f2ec 25%, #ede8df 50%, #f5f2ec 75%);
  background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── FILTRES RAPIDES ─────────────────────────────────────────── */
.quick-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center; margin-bottom: 32px;
}
.qf-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 30px;
  border: 1.5px solid rgba(212,164,55,0.3); background: #fff;
  font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--texte-moyen); cursor: pointer; transition: all 0.22s ease;
}
.qf-btn i { font-size: 15px; }
.qf-btn:hover { border-color: var(--rouge); color: var(--rouge); transform: translateY(-1px); }
.qf-btn.active {
  background: var(--rouge); border-color: var(--rouge); color: #fff;
  box-shadow: 0 4px 14px rgba(198,40,40,0.25);
}

/* ── SECTION CHIFFRES CLÉS ───────────────────────────────────── */
.chiffres-section { background: var(--fond-sombre); position: relative; overflow: hidden; }
.chiffres-section::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, var(--or) 0, var(--or) 1px, transparent 0, transparent 30px);
  background-size: 30px 30px; opacity: 0.04;
}
.chiffres-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; position: relative; z-index: 1;
}
.chiffre-item { text-align: center; padding: 32px 16px; }
.chiffre-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(212,164,55,0.12); border: 1px solid rgba(212,164,55,0.25);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 24px; color: var(--or); transition: transform 0.3s;
}
.chiffre-item.visible .chiffre-icon { animation: icon-bounce 0.6s ease; }
@keyframes icon-bounce { 0%,100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.chiffre-num {
  font-family: 'Montserrat', sans-serif; font-weight: 900;
  font-size: 48px; color: var(--or-clair); line-height: 1; display: inline-block;
}
.chiffre-unit {
  font-family: 'Montserrat', sans-serif; font-weight: 900;
  font-size: 28px; color: var(--or); display: inline-block;
}
.chiffre-label {
  font-family: 'Lora', serif; font-size: 13px;
  color: rgba(245,242,236,0.6); margin-top: 8px;
}

/* ── CAROUSEL TÉMOIGNAGES ────────────────────────────────────── */
.temo-carousel { position: relative; }
.temo-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 28px;
}
.temo-nav-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid rgba(212,164,55,0.3); background: #fff;
  color: var(--texte-moyen); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.temo-nav-btn:hover { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.temo-dots { display: flex; gap: 8px; }
.temo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(212,164,55,0.3); cursor: pointer; transition: all 0.2s;
}
.temo-dot.active { background: var(--rouge); transform: scale(1.3); }

/* ── ANIMATIONS GRILLE ───────────────────────────────────────── */
.products-grid.filtering .product-card { animation: fadeScale 0.3s ease; }
@keyframes fadeScale {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── BOUTON RIPPLE ───────────────────────────────────────────── */
.btn-ripple { position: relative; overflow: hidden; }
.btn-ripple::after {
  content: ''; position: absolute; width: 0; height: 0;
  border-radius: 50%; background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease; opacity: 0;
}
.btn-ripple:active::after { width: 200px; height: 200px; opacity: 1; transition: 0s; }

/* ── SECTION TAG ─────────────────────────────────────────────── */
.section-tag {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--rouge); margin-bottom: 8px;
}
.section-tag i { font-size: 14px; }

/* ── FOOTER LINKS ────────────────────────────────────────────── */
.footer-links a { display: flex; align-items: center; gap: 8px; }
.footer-links a i { font-size: 14px; color: var(--or-fonce); transition: color 0.2s; flex-shrink: 0; }
.footer-links a:hover i { color: var(--or-clair); }

/* ── HERO PARTICULES ─────────────────────────────────────────── */
.hero-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.particle { position: absolute; border-radius: 50%; background: rgba(212,164,55,0.15); animation: float-particle linear infinite; }
.p1 { width: 80px; height: 80px; top: 15%; left: 5%; animation-duration: 8s; }
.p2 { width: 40px; height: 40px; top: 60%; left: 15%; animation-duration: 6s; animation-delay: 1s; }
.p3 { width: 60px; height: 60px; top: 30%; right: 10%; animation-duration: 10s; animation-delay: 2s; }
.p4 { width: 30px; height: 30px; top: 75%; right: 20%; animation-duration: 7s; animation-delay: 0.5s; }
.p5 { width: 50px; height: 50px; top: 45%; left: 45%; animation-duration: 9s; animation-delay: 3s; }
@keyframes float-particle {
  0%   { transform: translate(0,0) scale(1); opacity: 0; }
  25%  { opacity: 0.6; }
  75%  { opacity: 0.3; }
  100% { transform: translate(30px,-80px) scale(0.5); opacity: 0; }
}

/* ── NEWSLETTER ──────────────────────────────────────────────── */
.newsletter-success { display: flex; align-items: center; gap: 6px; color: var(--or-clair); font-size: 13px; margin-top: 8px; }

/* ── TOAST ───────────────────────────────────────────────────── */
.toast { display: flex; align-items: center; gap: 8px; }
.toast i { font-size: 16px; flex-shrink: 0; }
.toast.success i { color: #4caf50; }
.toast.error   i { color: var(--rouge); }

/* ── LANG BTN ────────────────────────────────────────────────── */
.lang-btn { display: flex; align-items: center; gap: 5px; transition: all 0.2s; }
.lang-btn i { font-size: 14px; }
.lang-btn.switching { animation: lang-switch 0.3s ease; }
@keyframes lang-switch {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); opacity: 0.3; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

/* ── DIVERS ──────────────────────────────────────────────────── */
.product-badge    { display: flex; align-items: center; gap: 4px; }
.hero-eyebrow     { display: flex; align-items: center; gap: 8px; }
.hero-eyebrow i   { font-size: 14px; }
.float-badge      { display: flex; align-items: center; gap: 6px; }
.float-badge i    { font-size: 14px; color: var(--or-fonce); }
#promoBarText     { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
#promoBarText i   { font-size: 14px; }
.footer-address p { display: flex; align-items: center; gap: 8px; }
.footer-address i { font-size: 14px; color: var(--or); flex-shrink: 0; }
.footer-address a { color: rgba(245,242,236,0.55); transition: color 0.2s; }
.footer-address a:hover { color: var(--or-clair); }

/* ── PAGE TRANSITION ─────────────────────────────────────────── */
body { animation: page-in 0.4s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── FOCUS ───────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   RESPONSIVE GÉNÉRAL
   ============================================================ */

/* ── Tablette (≤1024px) ── */
@media (max-width: 1024px) {
  .hero-container   { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
  .hero-visual      { order: -1; margin: 0 auto; max-width: 320px; }
  .hero-btns        { justify-content: center; }
  .hero-stats       { justify-content: center; flex-wrap: wrap; }
  .valeurs-grid     { grid-template-columns: repeat(2, 1fr); }
  .chiffres-grid    { grid-template-columns: repeat(2, 1fr); }
  .footer-container { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile large (≤768px) ── */
@media (max-width: 768px) {
  .nav-container { padding: 0.75rem 1rem; }
  .logo-tagline  { display: none; }
  .nav-actions   { gap: 0.5rem; }
  .lang-btn span { display: none; }
  .cart-btn span:not(.cart-count) { display: none; }

  .promo-bar { font-size: 0.75rem; padding: 0.5rem 1rem; flex-wrap: wrap; text-align: center; }

  .hero          { padding: 5rem 1rem 3rem; }
  .hero-title    { font-size: 2.2rem; line-height: 1.2; }
  .hero-slogan   { font-size: 1rem; }
  .hero-desc     { font-size: 0.95rem; }
  .hero-btns     { flex-direction: column; width: 100%; gap: 0.75rem; }
  .hero-btns .btn-primary,
  .hero-btns .btn-outline { width: 100%; justify-content: center; }
  .hero-stats    { gap: 1.25rem; }
  .hero-stat .stat-num   { font-size: 1.5rem; }
  .hero-stat .stat-label { font-size: 0.75rem; }
  .hero-visual   { max-width: 240px; }
  .float-badge   { font-size: 0.7rem; padding: 0.4rem 0.6rem; }

  .section       { padding: 3rem 1rem; }
  .section-title { font-size: 1.6rem; }
  .section-sub   { font-size: 0.9rem; }

  .quick-filters {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    justify-content: flex-start; padding-bottom: 0.5rem; scrollbar-width: none;
  }
  .quick-filters::-webkit-scrollbar { display: none; }
  .qf-btn { flex: 0 0 auto; white-space: nowrap; font-size: 0.85rem; padding: 0.5rem 1rem; }

  .products-grid     { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .valeurs-grid      { grid-template-columns: 1fr; gap: 1.5rem; }
  .valeur-item       { text-align: center; }
  .temoignages-grid  { grid-template-columns: 1fr; }
  .chiffres-grid     { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .chiffre-item      { border-bottom: 1px solid rgba(212,164,55,0.1); }
  .chiffre-num       { font-size: 1.8rem; }
  .cta-title         { font-size: 1.8rem; }
  .cta-btns          { flex-direction: column; gap: 0.75rem; }
  .cta-btns .btn-primary,
  .cta-btns .btn-whatsapp { width: 100%; justify-content: center; }
  .footer-container  { grid-template-columns: 1fr; gap: 2rem; text-align: left; }
  .footer-social     { justify-content: flex-start; }
  .footer-bottom     { flex-direction: column; gap: 0.5rem; text-align: center; font-size: 0.8rem; }
  .cart-sidebar      { width: 100%; max-width: 100%; }
  .fab-whatsapp      { width: 50px; height: 50px; font-size: 1.3rem; }
  .fab-tooltip       { display: none; }
  .scroll-top-btn    { width: 42px; height: 42px; bottom: 80px; }
}

/* ── Mobile small (≤480px) ── */
@media (max-width: 480px) {
  .hero-title    { font-size: 1.8rem; }
  .hero-eyebrow  { font-size: 0.75rem; }
  .products-grid { grid-template-columns: 1fr; }
  .chiffres-grid { grid-template-columns: 1fr; }
  .hero-stats    { flex-direction: column; gap: 0.75rem; width: 100%; }
  .hero-stat     { width: 100%; flex-direction: row; justify-content: center; gap: 0.5rem; }
  .logo-name     { font-size: 0.95rem; }
  .section-title { font-size: 1.4rem; }
  .newsletter-form  { flex-direction: column; gap: 0.5rem; }
  .newsletter-form input,
  .newsletter-form button { width: 100%; }
}

/* ── Tactile — désactiver hover transforms ── */
@media (hover: none) {
  .float-badge,
  .product-card:hover,
  .qf-btn:hover { transform: none; }
}

img, svg { max-width: 100%; height: auto; }
.hero-ring-outer { width: clamp(180px, 50vw, 320px); height: clamp(180px, 50vw, 320px); }
