/* Shared nav behaviour across zahlo.eu marketing pages + the blog.
   Contains: top nav layout, "How it works" dropdown, circular burger,
   white-overlay mobile menu, and the floating language pill. */

:root {
  --nav-action-h: 2.5rem;          /* shared height for nav CTA + burger */
  --nav-action-h-mobile: 2.2rem;
  --nav-height: 76px;
}

/* ────────────────────────────────────────────────────────────
   Top nav bar — single source of truth across every page.
   Marketing pages must NOT redefine these in their inline <style>.
   Selector is scoped to `body > nav` so other <nav> elements on the
   page (filter chips, breadcrumbs, etc.) don't inherit sticky/z-index
   and accidentally overlay the real nav. !important locks padding,
   background, sticky behaviour, and z-index against page-local CSS. */
body > nav {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  padding: 1.25rem 3rem;
  background: var(--white) !important;
  border-bottom: 1px solid rgba(26, 26, 26, 0.07);
}

.nav-logo {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--black);
  text-decoration: none;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
}

.icon-bg { fill: #1a1a1a; }
.icon-slide-l, .icon-slide-r { fill: #f5f5f0; }
.icon-slide-l { animation: zh-iconSlideL 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.icon-slide-r { animation: zh-iconSlideR 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.icon-pulse { animation: zh-iconPulse 2.5s ease-in-out infinite; }

@keyframes zh-iconSlideL {
  from { transform: translateX(-200px); }
  to { transform: translateX(0); }
}
@keyframes zh-iconSlideR {
  from { transform: translateX(200px); }
  to { transform: translateX(0); }
}
@keyframes zh-iconPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.nav-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  /* Match the 2.5rem inter-link gap inside .nav-menu-links so the gap between
     the last link (Blog) and the Become a Merchant CTA reads as evenly
     spaced. Previously this was 0.75rem and looked crammed against Blog. */
  margin-left: 2.5rem;
  flex-shrink: 0;
}

.nav-menu-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-menu-links a {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--black);
  text-decoration: none;
  transition: opacity 0.3s, transform 0.3s, color 0.3s;
}

.nav-menu-links a:hover { opacity: 0.5; }
.nav-menu-links a[aria-current="page"] { font-weight: 600; }

.nav-cta {
  /* Full styling for the "Become a Merchant" pill — was previously spread
     across each page's inline <style> block, now consolidated here so the
     same selector behaves identically on every page (homepage, marketing,
     blog). Don't redefine in per-page <style> blocks. */
  display: inline-flex;
  align-items: center;
  height: var(--nav-action-h);
  padding: 0 1.5rem;
  background: var(--black, #1a1a1a);
  color: var(--white, #fdf8f8) !important;
  font-family: var(--body, 'DM Sans'), system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 500 !important;
  letter-spacing: 0;
  border-radius: 100px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.nav-cta:hover {
  opacity: 1 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none !important;
}

.nav-cta:focus,
.nav-cta:active {
  text-decoration: none !important;
}

/* ────────────────────────────────────────────────────────────
   "How it works" dropdown (Calculator + FAQ live under it)
   ──────────────────────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.nav-dropdown-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.nav-dropdown:hover .nav-dropdown-chevron,
.nav-dropdown:focus-within .nav-dropdown-chevron,
.nav-dropdown.is-open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

/* Default: hidden. Using `display: none` is the bulletproof option — even if other
   CSS doesn't load or selectors collide, the menu stays out of the way. The hover
   state below trades the smooth-fade for "definitely doesn't render in the wrong
   place". */
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  margin: 0;
  padding: 0.4rem;
  min-width: 200px;
  background: var(--white);
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
  z-index: 110;
  list-style: none;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-menu a:hover {
  background: var(--tonal, #f5f3ee);
  opacity: 1;
}

/* ────────────────────────────────────────────────────────────
   Circular burger — same height as nav-CTA, grey ring around it
   ──────────────────────────────────────────────────────────── */
.nav-burger {
  display: none;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: var(--nav-action-h);
  height: var(--nav-action-h);
  padding: 0;
  margin: 0;
  background: var(--white);
  border: 1px solid rgba(26, 26, 26, 0.14);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 999px;
  transition: background 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.2s ease;
}

.nav-burger:hover {
  background: var(--tonal, #f5f3ee);
  border-color: rgba(26, 26, 26, 0.22);
  transform: scale(1.04);
}

.nav-burger:active {
  transform: scale(0.96);
}

.nav-burger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--black);
  border-radius: 1px;
  transform-origin: center;
  transition:
    transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.22s ease,
    width 0.28s ease,
    background 0.2s ease;
}

nav.is-open .nav-burger {
  background: rgba(255, 95, 86, 0.08);
  border-color: rgba(255, 95, 86, 0.3);
}

nav.is-open .nav-burger-line {
  background: var(--coral, #ff5f56);
}

nav.is-open .nav-burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 16px;
}

nav.is-open .nav-burger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

nav.is-open .nav-burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 16px;
}

/* ────────────────────────────────────────────────────────────
   Floating language pill — sits below the nav on every page,
   right side, white card with the same pill shape as the CTA.
   `.lang-floating-pill.lang-switch` is the doubled-up selector
   we need to outrank per-page inline `.lang-switch` rules.
   ──────────────────────────────────────────────────────────── */
.lang-floating-pill.lang-switch {
  position: fixed;
  top: calc(var(--nav-height, 76px) + 0.85rem);
  right: clamp(1rem, 3vw, 2rem);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.25rem;
  background: var(--white);
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(26, 26, 26, 0.08);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* Use the [data-lang] attribute to keep specificity above any per-page inline
   `.lang-switch button { ... }` rules (which would otherwise win on same
   specificity because the inline <style> loads after this file). */
.lang-floating-pill.lang-switch button[data-lang],
.lang-floating-pill.lang-switch a[data-lang] {
  border: none;
  background: transparent;
  font: inherit;
  color: var(--gray-light, #9a9a9a);
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1;
}

.lang-floating-pill.lang-switch button[data-lang]:hover,
.lang-floating-pill.lang-switch a[data-lang]:hover {
  color: var(--black);
  background: transparent;
}

.lang-floating-pill.lang-switch button[data-lang].active,
.lang-floating-pill.lang-switch a[data-lang].active {
  background: var(--black);
  color: var(--white);
}

/* Hidden — replaced by the floating pill. Old inline lang-switch
   inside .nav-menu shouldn't render anywhere. */
.nav-menu .lang-switch,
.nav-menu > .lang-switch {
  display: none !important;
}

/* ────────────────────────────────────────────────────────────
   Mobile backdrop (covers content under the overlay menu)
   ──────────────────────────────────────────────────────────── */
.nav-menu-backdrop {
  display: none;
}

/* ────────────────────────────────────────────────────────────
   Mobile (≤900px): overlay menu, white background, no page-shift
   ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  body > nav {
    position: sticky !important;
    align-items: center;
    padding: 0.9rem 1.25rem !important;
    justify-content: space-between;
  }

  .nav-actions {
    order: 1;
    margin-left: auto;
    gap: 0.5rem;
  }

  .nav-burger {
    display: flex;
    width: var(--nav-action-h-mobile);
    height: var(--nav-action-h-mobile);
  }

  .nav-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease;
    z-index: 95;
  }

  nav.is-open .nav-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Menu is now an overlay, not a flex sibling — never pushes the
     page content. White background, drops down from under the nav. */
  .nav-menu {
    position: fixed;
    top: var(--nav-height, 64px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 1rem clamp(1.25rem, 4vw, 1.75rem) 1.5rem;
    background: var(--white);
    border-bottom: 1px solid rgba(26, 26, 26, 0.07);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.24s ease;
    z-index: 96;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.06);
  }

  nav.is-open .nav-menu {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-menu-links {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }

  .nav-menu-links a {
    display: block;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(26, 26, 26, 0.06);
    font-size: 1rem;
    opacity: 0;
    transform: translateY(-8px);
    transition:
      opacity 0.35s ease,
      transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
      background 0.2s ease;
  }

  nav.is-open .nav-menu-links > * a,
  nav.is-open .nav-menu-links > a {
    opacity: 1;
    transform: translateY(0);
  }

  nav.is-open .nav-menu-links > *:nth-child(1) a,
  nav.is-open .nav-menu-links > a:nth-child(1) { transition-delay: 0.05s; }
  nav.is-open .nav-menu-links > *:nth-child(2) a,
  nav.is-open .nav-menu-links > a:nth-child(2) { transition-delay: 0.09s; }
  nav.is-open .nav-menu-links > *:nth-child(3) a,
  nav.is-open .nav-menu-links > a:nth-child(3) { transition-delay: 0.13s; }
  nav.is-open .nav-menu-links > *:nth-child(4) a,
  nav.is-open .nav-menu-links > a:nth-child(4) { transition-delay: 0.17s; }

  /* Dropdown on mobile: render submenu inline as indented links,
     no popover. */
  .nav-dropdown {
    display: contents;
  }
  .nav-dropdown-trigger {
    display: block;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(26, 26, 26, 0.06);
    font-size: 1rem;
  }
  .nav-dropdown-chevron {
    display: none;
  }
  .nav-dropdown-menu {
    display: block !important;
    position: static;
    transform: none !important;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    margin: 0;
  }
  .nav-dropdown-menu a {
    padding: 0.75rem 0 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(26, 26, 26, 0.06);
    border-radius: 0;
    font-size: 0.95rem;
    color: var(--gray, #6a6a6a);
    background: transparent;
  }
  .nav-dropdown-menu a::before {
    content: "·";
    display: inline-block;
    margin-right: 0.5rem;
    color: var(--coral, #ff5f56);
  }

  .nav-cta {
    white-space: nowrap;
    height: var(--nav-action-h-mobile);
    padding: 0 0.9rem;
    font-size: 0.78rem;
  }

  body.nav-menu-open {
    overflow: hidden;
  }

  /* Mobile floating pill — slightly smaller and tucked into the right edge. */
  .lang-floating-pill {
    top: calc(var(--nav-height, 64px) + 0.6rem);
    right: 0.75rem;
    padding: 0.18rem;
  }
  .lang-floating-pill button,
  .lang-floating-pill a {
    padding: 0.35rem 0.7rem;
    font-size: 0.65rem;
  }
}

/* ────────────────────────────────────────────────────────────
   Desktop reset (≥901px) — undo mobile overlay styles
   ──────────────────────────────────────────────────────────── */
@media (min-width: 901px) {
  .nav-burger,
  .nav-menu-backdrop {
    display: none !important;
  }

  .nav-menu {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
  }

  .nav-menu-links a {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ────────────────────────────────────────────────────────────
   Very small screens — slightly tighter padding still.
   ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body > nav {
    padding: 0.75rem 1rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-menu,
  .nav-menu-links a,
  .nav-burger,
  .nav-burger-line,
  .nav-menu-backdrop,
  .nav-dropdown-chevron,
  .nav-dropdown-menu {
    transition: none !important;
  }
  nav.is-open .nav-menu-links a {
    transform: none !important;
  }
}
