/* ============================================================
   ECOVETSERVICE — Header & Navigation  v2.1
   Full adaptive: 1280 → 320px
   ============================================================ */

/* ── Base ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  height: var(--header-h);        /* 72px desktop */
  display: flex;
  align-items: center;
  transition: background 280ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 280ms cubic-bezier(0.16,1,0.3,1),
              height    280ms cubic-bezier(0.16,1,0.3,1);
}

/* ── Transparent (home hero) ── */
.header--transparent {
  background: transparent;
}

/* ── Scrolled / light inner pages ── */
.header--scrolled,
.header--light {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--color-grey-200), 0 4px 20px rgba(13,33,55,.06);
  height: 60px;
}

/* ── Inner wrapper ── */
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0;
  min-width: 0;   /* allow flex children to shrink */
}

/* ═══════════════════════════════════════
   LOGO
═══════════════════════════════════════ */
.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  min-width: 0;
}

.header__logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--color-teal), var(--color-teal-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header__logo-mark svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.header__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0;
}
.header__logo-name {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  color: var(--color-white);
  white-space: nowrap;
  transition: color 280ms;
}
.header__logo-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.48rem, 0.8vw, 0.58rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
  white-space: nowrap;
  transition: color 280ms;
}

/* ── Logo image (replaces logo-mark + logo-text) ── */
.header__logo-img {
  height: 32px;
  width: auto;
  display: block;
}
.header--transparent .header__logo-img--dark { display: none; }
.header--scrolled   .header__logo-img--white,
.header--light      .header__logo-img--white { display: none; }

/* ═══════════════════════════════════════
   DESKTOP NAV
═══════════════════════════════════════ */
.header__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
  min-width: 0;
  padding-inline: 8px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: clamp(0.55rem, 0.9vw, 0.7rem);
  font-weight: var(--fw-semi);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  padding: 6px 8px;
  border-radius: 4px;
  transition: color 150ms, background 150ms;
  white-space: nowrap;
  text-decoration: none;
}
.nav-link:hover          { color: #fff; background: rgba(255,255,255,0.1); }
.nav-link.active         { color: var(--color-gold); background: rgba(200,151,46,0.12); }

/* ═══════════════════════════════════════
   HEADER ACTIONS (lang + CTA)
═══════════════════════════════════════ */
.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Language switcher ── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 3px;
  background: rgba(255,255,255,0.05);
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  padding: 4px 7px;
  border-radius: 999px;
  cursor: pointer;
  background: none;
  border: none;
  transition: all 150ms;
  line-height: 1;
}
.lang-btn.active,
.lang-btn:hover { background: var(--color-gold); color: var(--color-navy); }

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 1.5px;
  background: var(--color-white);
  border-radius: 999px;
  transition: all 280ms cubic-bezier(0.16,1,0.3,1);
  transform-origin: center;
}
.hamburger span:nth-child(1) { width: 100%; }
.hamburger span:nth-child(2) { width: 70%; }
.hamburger span:nth-child(3) { width: 85%; }

.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); width: 100%; }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); width: 100%; }

/* ═══════════════════════════════════════
   LIGHT MODE (inner pages)
═══════════════════════════════════════ */
.header--light .nav-link               { color: var(--color-grey-600); }
.header--light .nav-link:hover         { color: var(--color-navy); background: var(--color-grey-100); }
.header--light .nav-link.active        { color: var(--color-teal); background: rgba(10,122,106,0.08); }
.header--light .header__logo-name      { color: var(--color-navy); }
.header--light .header__logo-tagline   { color: var(--color-teal); }
.header--light .lang-btn               { color: var(--color-grey-600); }
.header--light .lang-btn.active,
.header--light .lang-btn:hover         { background: var(--color-navy); color: #fff; }
.header--light .lang-switcher          { border-color: var(--color-grey-200); background: transparent; }
.header--light .hamburger span         { background: var(--color-navy); }

/* Scrolled on hero also goes light */
.header--scrolled .nav-link               { color: var(--color-grey-600); }
.header--scrolled .nav-link:hover         { color: var(--color-navy); background: var(--color-grey-100); }
.header--scrolled .nav-link.active        { color: var(--color-teal); }
.header--scrolled .header__logo-name      { color: var(--color-navy); }
.header--scrolled .header__logo-tagline   { color: var(--color-teal); }
.header--scrolled .lang-btn               { color: var(--color-grey-600); }
.header--scrolled .lang-btn.active,
.header--scrolled .lang-btn:hover         { background: var(--color-navy); color: #fff; }
.header--scrolled .lang-switcher          { border-color: var(--color-grey-200); background: transparent; }
.header--scrolled .hamburger span         { background: var(--color-navy); }

/* Ensure light stays white after scroll */
.header--light.header--scrolled {
  background: rgba(255,255,255,0.97) !important;
}

/* ═══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════ */

/* ── 1180px: tighten nav ── */
@media (max-width: 1180px) {
  .nav-link { padding: 5px 6px; font-size: 0.62rem; }
  .header__actions .btn { display: none; }   /* hide CTA btn, keep lang */
}

/* ── 1024px: collapse to hamburger ── */
@media (max-width: 1024px) {
  .header__nav { display: none; }
  .hamburger   { display: flex; }
}

/* ── 640px: tighten header height & logo ── */
@media (max-width: 640px) {
  :root {
    --header-h:     60px;
    --header-h-mob: 56px;
  }
  .header--scrolled,
  .header--light { height: 56px; }

  .header__logo-mark { width: 30px; height: 30px; }
  .header__logo-mark svg { width: 16px; height: 16px; }
  .header__logo-name { font-size: 0.82rem; }
  .header__logo-tagline { display: none; }   /* hide tagline on small screens */
}

/* ── 480px: shrink further ── */
@media (max-width: 480px) {
  .header__logo-mark { width: 28px; height: 28px; }
  .header__logo-mark svg { width: 14px; height: 14px; }
  .header__logo-name { font-size: 0.78rem; letter-spacing: 0.03em; }
  .lang-btn { padding: 3px 5px; font-size: 0.55rem; }
  .lang-switcher { padding: 2px; gap: 1px; }
}

/* ── 380px ── */
@media (max-width: 380px) {
  .header__logo-name { font-size: 0.72rem; }
  .header__logo-mark { width: 26px; height: 26px; }
  .hamburger { width: 24px; gap: 4px; }
}

/* ── 320px (minimum) ── */
@media (max-width: 320px) {
  .header__logo-name { font-size: 0.65rem; }
  .header__logo-mark { width: 24px; height: 24px; }
  .header__logo-mark svg { width: 13px; height: 13px; }
  .lang-btn { padding: 3px 4px; font-size: 0.5rem; }
}

/* ═══════════════════════════════════════
   MOBILE DRAWER
═══════════════════════════════════════ */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0; right: 0; bottom: 0;
  background: var(--color-white);
  z-index: calc(var(--z-nav) - 1);
  overflow-y: auto;
  flex-direction: column;
  padding-top: calc(var(--header-h) + 8px);
  padding-inline: var(--container-pad);
  padding-bottom: 32px;
  transform: translateX(100%);
  transition: transform 380ms cubic-bezier(0.16,1,0.3,1);
  border-top: 1px solid var(--color-grey-100);
}
.mobile-nav.open {
  display: flex;
  transform: translateX(0);
}

.mobile-nav-link {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 5vw, 1.4rem);
  font-weight: var(--fw-semi);
  color: var(--color-text-muted);
  padding: 14px 0;
  border-bottom: 1px solid var(--color-grey-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: color 150ms;
}
.mobile-nav-link:hover,
.mobile-nav-link.active { color: var(--color-navy); }
.mobile-nav-link.active  { color: var(--color-teal); }
.mobile-nav-link svg     { width: 16px; height: 16px; opacity: 0.3; flex-shrink: 0; }

.mobile-nav__actions {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mobile-nav__lang {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.mobile-nav__lang .lang-btn {
  font-size: 0.7rem;
  padding: 8px 16px;
  border: 1px solid var(--color-grey-200);
  border-radius: 999px;
  color: var(--color-text-muted);
}
.mobile-nav__lang .lang-btn.active {
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}

/* Prevent body scroll when drawer open */
body.nav-open { overflow: hidden; }
