/* =====================================================
   EASY BIO SANTÉ – NAVBAR STYLES
   ===================================================== */

/* --- Variables --- */
:root {
  --green-dark:   #1a5c38;
  --green-main:   #2e8b57;
  --green-light:  #4caf7d;
  --gold:         #c9a84c;
  --gold-light:   #f0d080;
  --cream:        #faf7f0;
  --white:        #ffffff;
  --gray-100:     #f5f5f5;
  --gray-300:     #d1d5db;
  --gray-500:     #6b7280;
  --gray-800:     #1f2937;
  --cta-bg:       #c9a84c;
  --cta-hover:    #a8872d;
  --header-h:     72px;
  --radius:       10px;
  --shadow:       0 8px 32px rgba(0,0,0,0.12);
  --transition:   0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--gray-800);
  background: var(--cream);
}

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 2px solid var(--green-main);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  height: var(--header-h);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* --- Logo --- */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  z-index: 1;
}

.logo img {
  height: 44px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

/* Fallback texte si l'image ne charge pas */
.logo-fallback {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.1;
}

.logo-fallback__name {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: -0.02em;
}

.logo-fallback__name span {
  color: var(--green-main);
}

.logo-fallback__sub {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* =====================================================
   DESKTOP NAVIGATION
   ===================================================== */
.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-item.active > .nav-link {
  color: var(--green-main);
  background: var(--gray-100);
}

/* CTA – Diagnostic */
.nav-link--cta {
  background: var(--cta-bg);
  color: var(--white) !important;
  padding: 8px 16px;
  border-radius: 24px;
}

/* Item actif (page courante) */
.nav-link--active {
  color: var(--green-main) !important;
}

.nav-item--active > .nav-link {
  color: var(--green-main);
  font-weight: 700;
}

.nav-link--cta:hover {
  background: var(--cta-hover) !important;
  color: var(--white) !important;
}

/* Chevron */
.chevron {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.nav-item.open > button .chevron {
  transform: rotate(180deg);
}

/* =====================================================
   DROPDOWN (simple)
   ===================================================== */
.has-dropdown,
.has-megamenu {
  position: relative;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-300);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 900;
}

.has-dropdown.open > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--gray-800);
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: var(--gray-100);
  color: var(--green-dark);
}

.dropdown-item strong {
  display: block;
  font-size: 0.875rem;
}

.dropdown-item small {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.di-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--gray-100);
  border-radius: 8px;
  color: var(--green-main);
  transition: background var(--transition), color var(--transition);
}

.dropdown-item:hover .di-icon {
  background: rgba(46,139,87,0.1);
  color: var(--green-dark);
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.mega-col-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--green-main);
}

.mega-col-icon .nav-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* Goals dropdown – compact single column */
.dropdown--goals .dropdown-item {
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* =====================================================
   MEGA MENU
   ===================================================== */
.megamenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: min(900px, 92vw);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-300);
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 900;
}

.has-megamenu.open > .megamenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.megamenu-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.mega-col-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.mega-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-dark);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green-light);
}

.mega-col ul { list-style: none; }

.mega-col ul li { margin-bottom: 4px; }

.mega-col ul li a {
  display: block;
  padding: 6px 8px;
  font-size: 0.85rem;
  color: var(--gray-800);
  text-decoration: none;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}

.mega-col ul li a:hover {
  background: var(--gray-100);
  color: var(--green-main);
}

.mega-col ul li a small {
  display: block;
  font-size: 0.72rem;
  color: var(--gray-500);
}

/* Badges IN / OUT */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.badge--in  { background: var(--green-main); color: var(--white); }
.badge--out { background: var(--gold);       color: var(--white); }
.badge--super { font-size: 1rem; }

/* =====================================================
   HEADER ACTIONS (droite)
   ===================================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Search */
.search-wrap { position: relative; }

.search-form {
  display: flex;
  align-items: center;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 24px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.search-form:focus-within {
  box-shadow: 0 0 0 2px var(--green-main);
  border-color: var(--green-main);
}

.search-input {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 0.82rem;
  width: 200px;
  outline: none;
  color: var(--gray-800);
}

.search-input::placeholder { color: var(--gray-500); }

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
}

.search-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.search-btn:hover { color: var(--green-main); }

/* Suggestions prédictives */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  list-style: none;
  overflow: hidden;
  z-index: 950;
}

.search-suggestions li a {
  display: block;
  padding: 10px 14px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--gray-800);
  transition: background var(--transition);
}

.search-suggestions li a:hover { background: var(--gray-100); }

/* Icons */
.header-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--gray-800);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.header-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-icon:hover {
  background: var(--gray-100);
  color: var(--green-main);
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--green-main);
  color: var(--white);
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background var(--transition);
}

.burger:hover { background: var(--gray-100); }

.burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--gray-800);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================================================
   MOBILE MENU — DRILL-DOWN PANELS
   ===================================================== */

/* Wrapper : clipe les panneaux qui glissent */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(360px, 100vw);
  height: 100dvh;
  background: var(--white);
  box-shadow: 6px 0 40px rgba(0,0,0,0.22);
  z-index: 1100;
  overflow: hidden;        /* ← clipe les panels */
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), visibility 0.35s;
}

.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
}

/* Overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---- Panneau individuel ---- */
.m-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  transform: translateX(100%);      /* hors écran à droite par défaut */
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Le panneau principal est visible par défaut */
.m-panel--main {
  transform: translateX(0);
}

/* Panneau principal décalé quand un sous-panneau est ouvert */
.m-panel--main.is-pushed {
  transform: translateX(-28%);
}

/* Sous-panneau actif glisse depuis la droite */
.m-panel.is-active {
  transform: translateX(0);
}

/* ---- En-tête des panneaux ---- */
.m-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}

.m-panel__head--main {
  background: var(--green-dark);
  border-bottom: none;
}

.m-panel__logo {
  height: 32px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  /* Logo noir → invert pour fond vert foncé */
  filter: brightness(0) invert(1);
  flex: 1;
}

.m-close {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: rgba(255,255,255,0.8);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.m-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

.m-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Bouton retour */
.m-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-main);
  padding: 6px 10px 6px 4px;
  border-radius: 8px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.m-back:hover { background: var(--gray-100); }

.m-panel__title {
  flex: 1;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
  text-align: center;
  padding-right: 80px; /* équilibre avec le bouton retour */
}

/* Label de section (sous-titre descriptif) */
.m-panel__section-label {
  padding: 14px 20px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-main);
  flex-shrink: 0;
}

/* ---- Listes ---- */
.m-list {
  list-style: none;
  padding: 8px 0;
  flex: 1;
}

.m-list--sub { padding: 4px 0 16px; }

/* ---- Item générique ---- */
.m-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  color: var(--gray-800);
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  font-family: 'Inter', system-ui, sans-serif;
  gap: 14px;
  transition: background 0.18s, color 0.18s;
}

.m-item:hover  { background: #f8faf8; color: var(--green-dark); }
.m-item:active { background: #eef4ee; }

.m-item__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f0f7f3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--green-main);
  transition: background 0.18s;
}

.m-item__icon--cta {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}

.m-item:hover .m-item__icon {
  background: rgba(46,139,87,0.12);
}

.m-item__label {
  flex: 1;
  font-weight: 600;
  display: block;
  line-height: 1.35;
}

.m-item__sub {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 400;
  margin-top: 2px;
}

.m-item__arrow {
  width: 16px;
  height: 16px;
  stroke: var(--gray-300);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: stroke 0.18s, transform 0.18s;
}

.m-item:hover .m-item__arrow {
  stroke: var(--green-main);
  transform: translateX(3px);
}

/* Item CTA (Diagnostic) */
.m-item--goto { font-weight: 600; }

/* Item en retrait (sous-catégorie) */
.m-item--indent {
  padding-left: 36px;
  font-size: 0.875rem;
  border-bottom-color: transparent;
  color: var(--text);
}

.m-item--indent:hover { color: var(--green-main); background: #f8faf8; }

/* ---- Titre de section dans un panneau ---- */
.m-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-dark);
  background: #f5f9f5;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  margin-top: 4px;
}

/* Badges IN/OUT dans le panneau produits */
.m-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.m-badge--in  { background: var(--green-main); color: #fff; }
.m-badge--out { background: var(--gold); color: #fff; }

/* ---- Footer du panneau principal ---- */
.m-panel__footer {
  padding: 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  background: var(--white);
  position: sticky;
  bottom: 0;
}

.m-wa-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: #25d366;
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}

.m-wa-btn:hover { background: #1da851; transform: scale(1.02); }

.m-wa-btn svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.m-diag-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--green-dark);
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 700;
  transition: background 0.2s;
}

.m-diag-btn:hover { background: var(--green-main); }

/* ---- Icône SVG générique ---- */
.m-ico {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: block;
}

/* =====================================================
   WHATSAPP FLOAT
   ===================================================== */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  z-index: 999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.6);
}

.whatsapp-float svg {
  width: 32px;
  height: 32px;
  fill: var(--white);
}

/* Pulse animation */
.whatsapp-float::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25d366;
  animation: wa-pulse 2.5s ease-out infinite;
  z-index: -1;
}

@keyframes wa-pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* =====================================================
   HEADER SCROLL STATES
   ===================================================== */
.site-header {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.site-header.header--scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.14);
}

.site-header.header--hidden {
  transform: translateY(-100%);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Tablette : réduire la nav */
@media (max-width: 1100px) {
  .search-input { width: 150px; }
  .nav-link { padding: 8px 9px; font-size: 0.82rem; }
}

/* =====================================================
   MOBILE : logo centré, burger + cart aux extrémités
   ===================================================== */
@media (max-width: 860px) {
  .main-nav    { display: none; }
  .search-wrap { display: none; }
  .burger      { display: flex; }

  /* Conteneur : flex space-between + position relative pour l'abs du logo */
  .header-inner {
    position: relative;
    justify-content: space-between;
    padding: 0 14px;
    gap: 0;
  }

  /* Logo centré absolument */
  .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
  }

  .logo img {
    height: 36px;
    max-width: 140px;
  }

  /* Actions : seulement cart + burger, serrés */
  .header-actions {
    gap: 4px;
    margin-left: auto;        /* repousse vers la droite */
  }

  /* Cacher icône user sur mobile */
  .header-icon:not(.header-icon--cart) { display: none; }
}

/* Très petit écran */
@media (max-width: 400px) {
  .header-inner { padding: 0 10px; }
  .logo img     { height: 30px; max-width: 120px; }
}
