/* ----------------------------------------------------------------------
 * Global Header CSS. Shared between sales page + standalone pages.
 *
 * Source extracted from public/index.html on 2026-05-19.
 * Self-contained: every value has an explicit fallback so the file works
 * on pages without the sales-page CSS-variable system.
 *
 * Standalone pages must <link> this AFTER their own page-specific CSS so
 * nav rules win the cascade. Or use higher-specificity selectors below.
 * ---------------------------------------------------------------------- */

.nav {
  z-index: 100;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s;
}

/* Sales page: fixed transparent leading to scrolled frosted glass */
.nav--fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

.nav--fixed.scrolled {
  background: rgba(255, 251, 245, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 12px rgba(234, 88, 12, 0.06);
  padding: 12px 28px;
}

/* Always-sticky frosted glass (sales + checkout + static pages) */
.nav--sticky {
  position: sticky;
  top: 0;
  background: rgba(255, 251, 245, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 14px 28px;
  box-shadow: 0 1px 12px rgba(234, 88, 12, 0.06);
}

/* Sections targeted by the sticky nav need scroll-margin so their
   headline does not end up tucked under the nav after a hash jump. */
section[id] { scroll-margin-top: 90px; }

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
}
.nav-brand a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.nav-brand img {
  /* Explicit width + height (no `auto`) eliminates a CLS race on pages with
     a tall body: the HTML attrs `width="1584" height="416"` set an intrinsic
     aspect ratio, but with `width:auto` the browser briefly reflows once
     the PNG decodes. Phase 2.F.5 Lighthouse traced the Brands-Page CLS
     (0.11) back to this single rule. 137 = 1584 * (36/416) rounded down. */
  width: 137px;
  height: 36px;
  display: block;
}

/* Right side container */
.nav-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* Inline links (collapse to hamburger below 1024px) */
.nav-links {
  display: flex;
  gap: 22px;
}
.nav-links a {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-soft, #5A6F78);
  transition: color 0.2s;
  white-space: nowrap;
  position: relative;
  text-decoration: none;
}
.nav-links a:hover { color: var(--primary, #ea580c); }
.nav-links a.active { color: var(--primary, #ea580c); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--cta, #ea580c);
  border-radius: 2px;
}

@media (max-width: 1024px) {
  .nav-links { display: none; }
}

/* CTA button in nav */
.nav-cta {
  padding: 10px 24px;
  border-radius: var(--radius-sm, 5px);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--gradient, linear-gradient(to bottom right, #ea580c, #c2410c));
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 2px 12px rgba(234, 88, 12, 0.3);
  transition: all 0.2s;
  text-decoration: none;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.4);
}

/* Try-for-free secondary button (sales nav) */
.nav-trial {
  padding: 10px 20px;
  border-radius: var(--radius-sm, 5px);
  font-weight: 700;
  font-size: 0.85rem;
  background: #0A394E;
  color: #FCFCFC;
  -webkit-text-fill-color: #FCFCFC;
  box-shadow: 0 2px 8px rgba(10, 57, 78, 0.18);
  transition: all 0.2s;
  margin-right: 8px;
  white-space: nowrap;
  text-decoration: none;
}
.nav-trial:hover {
  background: #0C4862;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 57, 78, 0.28);
}

.nav-drawer-trial {
  display: block;
  padding: 12px 16px;
  margin: 8px 0 4px;
  border-radius: var(--radius-sm, 5px);
  background: #0A394E;
  color: #FCFCFC !important;
  -webkit-text-fill-color: #FCFCFC;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

/* Back link (checkout-only fallback, kept for compat) */
.nav-back {
  font-size: 0.95rem;
  color: var(--text-soft, #5A6F78);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--primary, #ea580c); }

/* Language toggle */
.lang-toggle {
  display: flex;
  gap: 10px;
}
.lang-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  opacity: 0.5;
  transition: all 0.2s;
  padding: 0;
}
.lang-btn:hover { opacity: 0.75; }
.lang-btn.active {
  opacity: 1;
  border-color: var(--primary, #ea580c);
  background: rgba(30, 41, 59, 0.06);
}
.nav--sticky .lang-btn.active {
  background: var(--surface-alt, #F0F4F5);
}

/* Hamburger button (hidden on desktop) */
.nav-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text, #1E293B);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(255, 251, 245, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 80px 24px 32px;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(10, 57, 78, 0.14);
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.nav-drawer.open { transform: translateY(0); }
.nav-drawer a {
  display: block;
  padding: 14px 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text, #1E293B);
  border-radius: var(--radius-sm, 5px);
  transition: background 0.2s;
  text-decoration: none;
}
.nav-drawer a:hover { background: rgba(10, 57, 78, 0.06); }
.nav-drawer-cta {
  margin-top: 8px;
  text-align: center;
  background: var(--gradient, linear-gradient(to bottom right, #ea580c, #c2410c)) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  border-radius: var(--radius-sm, 5px);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

/* Mobile breakpoints */
@media (max-width: 768px) {
  .nav { padding: 12px 16px; }
  .nav--fixed.scrolled { padding: 10px 16px; }
  .nav-cta, .nav-trial { display: none; }
  .nav-hamburger { display: flex; }
  .nav-drawer { display: flex; }
}
@media (max-width: 700px) {
  .nav--sticky { padding: 12px 16px; }
}
