/* Ported verbatim from src/components/Header.astro (Astro version) */
/* ════════════════════════════════════════════════════════
   HEADER PRINCIPAL
   ════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #ffffff;
  box-shadow: none;
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 80px;
}

/* Logo */
.header-logo { flex-shrink: 0; display: flex; align-items: center; width: 140px; }
.header-logo img { width: 140px; height: auto; object-fit: contain; }
.logo-fallback {
  display: none; align-items: center; gap: var(--space-2);
  font-weight: var(--fw-bold); font-size: var(--text-xl); color: var(--color-primary);
}
.logo-icon {
  width: 32px; height: 32px; background: var(--color-primary); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: var(--fw-bold);
}

/* Nav pill (desktop) */
.nav-pill-wrap {
  flex: 1; min-width: 0; background: var(--color-surface); border-radius: var(--radius-full); height: 56px;
  display: flex; align-items: center; overflow: visible;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  position: relative;
}
.nav-pill {
  flex: 1; min-width: 0; display: flex; align-items: center;
  overflow-x: auto; overflow-y: visible; scrollbar-width: none; padding: 0 var(--space-2);
}
.nav-pill::-webkit-scrollbar { display: none; }
.nav-list { display: flex; align-items: center; gap: var(--space-1); list-style: none; flex-shrink: 0; }
.nav-link {
  display: flex; align-items: center; gap: var(--space-1);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: var(--fw-regular);
  color: var(--color-text-body); white-space: nowrap; letter-spacing: -0.02em;
  transition: background .15s, color .15s; line-height: 1;
}
.nav-link:hover { background: var(--color-bg); color: var(--color-text); }
.nav-link.active { background: rgba(224, 0, 26, 0.08); color: var(--color-primary); font-weight: var(--fw-semibold); }

/* Dropdown desktop */
.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + var(--space-2)); left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--color-surface); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border); min-width: 200px; padding: var(--space-2);
  list-style: none; opacity: 0; visibility: hidden;
  transition: opacity .18s, transform .18s, visibility .18s; z-index: 300;
}
.has-dropdown.open .dropdown,
.has-dropdown:hover .dropdown {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.dropdown-link {
  display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm);
  color: var(--color-text-body); white-space: nowrap; transition: background .12s, color .12s;
}
.dropdown-link:hover { background: var(--color-bg); color: var(--color-primary); }

/* Recherche desktop */
.nav-search {
  flex-shrink: 0; display: flex; align-items: center; gap: var(--space-2);
  background: var(--color-bg); border-radius: var(--radius-full); padding: var(--space-2) var(--space-3);
  width: 160px; margin: 0 var(--space-2); transition: box-shadow .15s;
}
.nav-search:focus-within { box-shadow: 0 0 0 2px rgba(224, 0, 26, 0.25); }
.nav-search svg { flex-shrink: 0; color: var(--color-text-muted); }
.nav-search input {
  border: none; background: none; font-size: var(--text-sm); color: var(--color-text-body);
  outline: none; width: 100%;
}
.nav-search input::placeholder { color: var(--color-text-muted); }

/* CTA App desktop — compact */
.btn-app {
  flex-shrink: 0; display: flex; align-items: center; gap: var(--space-2);
  background: transparent; border: 1px solid var(--color-border); border-radius: var(--radius-full);
  height: 48px; padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
  transition: border-color .2s, background .2s;
}
.btn-app:hover { background: var(--color-bg); border-color: #cbd5e1; }
.btn-app-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); object-fit: contain; flex-shrink: 0; }
.btn-app-label { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--color-text); white-space: nowrap; }

/* Mobile controls (hidden desktop) */
.mobile-controls { display: none; align-items: center; gap: 4px; margin-left: auto; }
.mobile-search-toggle {
  width: 40px; height: 40px; border-radius: 50%; background: #f4f4f6;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #43434d;
  transition: background 0.2s, color 0.3s ease, border-color 0.3s ease;
}
.mobile-search-toggle:hover {
  background: #e8e8ec;
}

/* Burger */
.burger {
  display: flex; flex-direction: column; gap: 5px;
  padding: 9px; background: #f4f4f6; border: none; cursor: pointer;
  border-radius: 10px; flex-shrink: 0;
  transition: background 0.2s, border-color 0.3s ease;
}
.burger:hover {
  background: #e8e8ec;
}
.burger span {
  display: block; width: 20px; height: 2px; background: #43434d; border-radius: 2px;
  transition: transform .25s, opacity .2s, background 0.3s ease;
}
.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); }

/* ════════════════════════════════════════════════════════
   VERSION B : BARRE DE RECHERCHE SOUS LE LOGO
   ════════════════════════════════════════════════════════ */
.mobile-search-row {
  display: none;
  padding: 8px 0 12px;
  border-top: 1px solid #f0f0f2;
}
.mobile-search-form {
  display: flex; align-items: center; gap: 10px;
  background: #f4f4f6; border-radius: 22px; padding: 11px 16px;
  transition: box-shadow .15s;
}
.mobile-search-form:focus-within { box-shadow: 0 0 0 2px #e0001a30; background: #fff; }
.mobile-search-form svg { flex-shrink: 0; color: #888; }
.mobile-search-form input {
  flex: 1; border: none; background: none; font-size: 15px;
  color: #1a1a2e; outline: none;
}
.mobile-search-form input::placeholder { color: #aaa; }
.mobile-search-submit {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: #e0001a; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
}

/* ════════════════════════════════════════════════════════
   VERSION C : TABS SCROLLABLES
   ════════════════════════════════════════════════════════ */
.mobile-tabs-row {
  display: none;
  overflow-x: auto; scrollbar-width: none;
  border-top: 1px solid #f0f0f2;
  padding: 0 16px;
}
.mobile-tabs-row::-webkit-scrollbar { display: none; }
.mobile-tabs-list {
  display: flex; gap: 4px; list-style: none;
  padding: 10px 0; flex-shrink: 0;
}
.mobile-tab {
  display: block; padding: 8px 16px; border-radius: 20px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  color: #555; background: #f4f4f6;
  transition: background .15s, color .15s;
}
.mobile-tab:hover { background: #f0f0f0; color: #1a1a2e; }
.mobile-tab.active { background: #ffe8e8; color: #e0001a; font-weight: 600; }

/* ════════════════════════════════════════════════════════
   MENU MOBILE DRAWER (toutes versions)
   ════════════════════════════════════════════════════════ */
.mobile-menu-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 299; backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 90vw);
  background: #fff; z-index: 300; overflow-y: auto;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  clip-path: ellipse(0% 100% at 100% 50%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), clip-path 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu:not([hidden]) {
  transform: translateX(0);
  clip-path: ellipse(150% 100% at 100% 50%);
}
.mobile-menu[hidden] { display: flex !important; }

.mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px; border-bottom: 1px solid #f0f0f2; flex-shrink: 0;
}
.mobile-menu-logo img { height: 26px; width: auto; }
.mobile-menu-close {
  width: 36px; height: 36px; border-radius: 50%; background: #f4f4f6;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #555;
}

.mobile-menu-list { list-style: none; flex: 1; }
.mobile-menu-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; font-size: 16px; font-weight: 500;
  color: #1a1a2e; border-bottom: 1px solid #f6f6f8;
  transition: background .12s, color .12s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
}
.mobile-menu-link:hover { background: #fafafa; }
.mobile-menu-link.active { color: #e0001a; }

.has-mobile-dropdown.open > .mobile-accordion-toggle {
  background: #f8f8fa;
  color: #e0001a;
}

.mobile-sub-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  background: #fcfcfd;
}
.mobile-sub-wrapper > .mobile-sub {
  min-height: 0;
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.has-mobile-dropdown.open .mobile-sub-wrapper {
  grid-template-rows: 1fr;
}

.mobile-sub-link {
  display: block; padding: 12px 20px 12px 36px;
  font-size: 14px; color: #666; border-bottom: 1px solid #f0f0f2;
  transition: color .12s;
}
.mobile-sub-link:hover { color: #e0001a; }

.mobile-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: #888;
}
.has-mobile-dropdown.open .mobile-chevron {
  transform: rotate(90deg);
  color: #e0001a;
}

.mobile-menu-footer { padding: 20px; border-top: 1px solid #f0f0f2; flex-shrink: 0; }
.mobile-app-btn {
  display: flex; align-items: center; gap: 12px;
  background: #f4f4f6; border-radius: 16px; padding: 14px 18px;
  margin-bottom: 16px;
}
.mobile-app-btn img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; flex-shrink: 0; }
.mobile-app-sub { display: block; font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: .06em; }
.mobile-app-name { display: block; font-size: 15px; font-weight: 700; color: #1a1a2e; }
.mobile-menu-socials { display: flex; gap: 8px; flex-wrap: wrap; }
.mobile-social-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1.5px solid #e8e8ec; border-radius: 20px;
  color: #555; font-size: 13px; transition: border-color .15s, color .15s;
}
.mobile-social-pill:hover { border-color: #e0001a; color: #e0001a; }

/* ── SCROLLED STATE — stay light, subtle elevation ─────────────── */
.site-header.scrolled {
  background: #ffffff;
  border-bottom: 1px solid transparent;
  box-shadow: 0 1px 0 var(--color-primary), var(--shadow-sm);
}

/* ════════════════════════════════════════════════════════
   VERSION A : BOTTOM NAV BAR
   ════════════════════════════════════════════════════════ */

/* Tous les éléments mobiles-only : cachés sur desktop par défaut */
.nav-a-show { display: none; }
.nav-b-show { display: none !important; }
.nav-c-show { display: none !important; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  align-items: stretch;
  z-index: 190;
  box-shadow: 0 -4px 20px rgba(0,0,0,.04);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; font-weight: 500; color: #64748b;
  transition: all .15s ease; border: none; background: none; cursor: pointer;
  padding: 6px 2px 10px;
  text-decoration: none;
}
.bottom-nav-item:hover { color: var(--color-primary); }
.bottom-nav-item.active { color: var(--color-primary); font-weight: 700; }
.bottom-nav-item.active svg { stroke: var(--color-primary); filter: drop-shadow(0 0 2px rgba(224, 0, 26, 0.25)); }
.bottom-nav-item svg { stroke: currentColor; transition: transform .15s ease; }
.bottom-nav-item:active svg { transform: scale(0.92); }
.bottom-nav-menu { color: #334155; }


/* ════════════════════════════════════════════════════════
   RESPONSIVE — affichage par version
   ════════════════════════════════════════════════════════ */
@media (max-width: 1279px) {
  .nav-link { padding: var(--space-2); font-size: var(--text-xs); }
  .nav-search { width: 140px; }
  .btn-app-label { font-size: var(--text-xs); }
}

@media (max-width: 1023px) {
  /* Cacher les éléments desktop */
  .nav-pill-wrap { display: none; }
  .btn-app { display: none; }
  .mobile-controls { display: flex; }

  /* Toutes versions : header compact */
  .header-inner { height: 60px; }
  .header-logo img { width: 110px; }

  /* Version A : bottom nav visible, burger visible */
  .nav-a-show { display: flex; }

  /* Versions B/C/D : cacher bottom nav */
  html[data-nav="b"] .nav-a-show,
  html[data-nav="c"] .nav-a-show,
  html[data-nav="d"] .nav-a-show { display: none; }

  /* Version B : search row visible */
  html[data-nav="b"] .mobile-search-row { display: block; }
  html[data-nav="b"] .nav-b-show { display: flex !important; }

  /* Version C : tabs row visible, cacher burger & mobile controls */
  html[data-nav="c"] .mobile-tabs-row { display: block !important; }
  html[data-nav="c"] .nav-c-show { display: block !important; }
  html[data-nav="c"] .mobile-controls { display: none !important; }

  /* Version A : ajouter espace en bas pour bottom nav */
  html:not([data-nav="b"]):not([data-nav="c"]):not([data-nav="d"]) body { padding-bottom: 64px; }

  /* Option D : Utilise le header burger standard et propre */
  html[data-nav="d"] .nav-pill-wrap {
    display: none;
  }
}
