/* Custom fixed header + burger drawer. Layout follows Webflow nav-logo-wrap / nav-menu-wrap. */

:root {
  --scroll-progress: 0;
}

body.header-custom {
  --nav-inset: 1.5rem;
  --nav-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nav-dur-micro: 220ms;
  --nav-dur-major: 420ms;
  --logo-max: 190px;
  --logo-min: 120px;
  --nav-pad-max: 0.9rem;
  --nav-pad-min: 0.55rem;
  --nav-height: 4.5rem;
  padding-top: var(--nav-height);
}

body.header-custom .nav-menu-wrap .nav-burger {
  display: none;
  position: relative;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 3.125rem;
  height: 3.125rem;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Kill the mobile tap-highlight box on all header touch targets; keep keyboard focus. */
body.header-custom .nav-burger,
body.header-custom .nav-drawer-link,
body.header-custom .nav-drawer-sublink,
body.header-custom .nav-drawer-social-link,
body.header-custom .lang-switch__item {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

body.header-custom .nav-drawer-link:focus-visible,
body.header-custom .nav-drawer-sublink:focus-visible,
body.header-custom .nav-drawer-social-link:focus-visible,
body.header-custom .nav-burger:focus-visible {
  outline: 2px solid var(--_colors---text-color--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Two equal centred bars → clean centred X. Same transform function list in both
   states (translate · translateY · rotate), so it eases smoothly with no jump. */
body.header-custom .nav-burger::before,
body.header-custom .nav-burger::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--_colors---text-color--dark);
  transition: transform var(--nav-dur-major) var(--nav-ease),
              background var(--nav-dur-micro) var(--nav-ease);
}

body.header-custom .nav-burger::before { transform: translate(-50%, -50%) translateY(-4px) rotate(0deg); }
body.header-custom .nav-burger::after  { transform: translate(-50%, -50%) translateY(4px) rotate(0deg); }

body.header-custom.nav-drawer-open .nav-burger::before {
  transform: translate(-50%, -50%) translateY(0) rotate(45deg);
}

body.header-custom.nav-drawer-open .nav-burger::after {
  transform: translate(-50%, -50%) translateY(0) rotate(-45deg);
}

/* Panel appears in place (quick fade, no slide); the inner items still stagger in. */
body.header-custom .nav-drawer {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--nav-dur-micro) var(--nav-ease),
              visibility 0s linear var(--nav-dur-micro);
}

body.header-custom.nav-drawer-open .nav-drawer {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--nav-dur-micro) var(--nav-ease),
              visibility 0s linear 0s;
}

body.header-custom.nav-drawer-open { overflow: hidden; }

/* Top/bottom white gradient fades so scrolling content dissolves at the edges.
   They overlap the scroll area, masking links as they pass under the nav / over the strip. */
/* Bottom white fade dissolves content above the social strip. */
body.header-custom .nav-drawer-fade {
  position: absolute;
  left: 0;
  width: 90%;
  height: 3.5rem;
  pointer-events: none;
}

body.header-custom .nav-drawer-fade--bottom {
  bottom: 4.5rem;
  z-index: 2;
  background: linear-gradient(rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 45%, #fff 100%);
}

/* Pushes the last contact line above the bottom fade so the address never
   dissolves under the gradient when scrolled to the end. */
body.header-custom .nav-drawer-foot-spacer {
  height: 2rem;
}

/* Top fade lives on the navbar itself: a soft tail below it (drawer open + scrolled),
   sitting in the navbar's own stacking context so it never gets clipped by the bar.
   90% width leaves the scrollbar clear. */
body.header-custom.nav-drawer-open .navbar::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 90%;
  height: 3rem;
  pointer-events: none;
  background: linear-gradient(#fff 0%, rgba(255, 255, 255, 0.85) 45%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transition: opacity var(--nav-dur-micro) var(--nav-ease);
}

body.header-custom.nav-drawer-open .navbar.is-drawer-scrolled::after {
  opacity: 1;
}

body.header-custom .nav-drawer-inner {
  height: 100%;
  overflow-y: auto;
  padding: calc(var(--nav-height) + 0.25rem) var(--nav-inset) 6rem;
  -webkit-overflow-scrolling: touch;
}

body.header-custom .nav-drawer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.header-custom .nav-drawer-item {
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity var(--nav-dur-major) var(--nav-ease),
              transform var(--nav-dur-major) var(--nav-ease);
}

/* Spacing keeps top-level items apart (no divider). */
body.header-custom .nav-drawer-item + .nav-drawer-item {
  margin-top: 0.35rem;
}

/* Stagger: each top-level item eases in after the panel, ordered by --i. */
body.header-custom.nav-drawer-open .nav-drawer-item {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(120ms + var(--i, 0) * 55ms);
}

/* Top-level link / accordion toggle share one look (Geist, site dark). */
body.header-custom .nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0;
  height: 3.25rem;
  font-family: var(--font-family--geist);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: left;
  text-decoration: none;
  color: var(--_colors---text-color--dark);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: opacity var(--nav-dur-micro) var(--nav-ease),
              color var(--nav-dur-micro) var(--nav-ease);
}

body.header-custom .nav-drawer-link:hover { opacity: 0.7; }
body.header-custom .nav-drawer-link.is-active { color: #e30613; }

body.header-custom .nav-drawer-chevron {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  opacity: 0.4;
  transition: transform var(--nav-dur-micro) var(--nav-ease),
              opacity var(--nav-dur-micro) var(--nav-ease);
}

/* Open accordion: chevron flips, submenu expands. */
body.header-custom .nav-drawer-toggle[aria-expanded="true"] .nav-drawer-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Accordion submenu: grid 0fr→1fr animates height; the single inner <ul> child
   is the clipped row (overflow + min-height:0), so it collapses cleanly. */
body.header-custom .nav-drawer-sublist {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--nav-dur-major) var(--nav-ease);
}

body.header-custom .nav-drawer-toggle[aria-expanded="true"] + .nav-drawer-sublist {
  grid-template-rows: 1fr;
}

body.header-custom .nav-drawer-sublist-inner {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 0;
  overflow: hidden;
}

/* Submenu items: lighter weight + indent so they read as children, not siblings. */
body.header-custom .nav-drawer-sublist-inner > li:first-child .nav-drawer-sublink { padding-top: 0.25rem; }
body.header-custom .nav-drawer-sublist-inner > li:last-child  .nav-drawer-sublink { padding-bottom: 0.75rem; }

/* Submenu type echoes home .strategy-text strong: small, uppercase, tracked, bold (700). */
body.header-custom .nav-drawer-sublink {
  display: flex;
  align-items: center;
  height: 2.15rem;
  padding-left: 0.1rem;
  font-size: var(--_typography---texts-font-sizes--paragraph-s);
  font-weight: 700;
  line-height: var(--_typography---texts-line-height--paragraph-s);
  letter-spacing: var(--_typography---texts-letter-spacing--paragraph-s);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--_colors---text-color--gray-1);
  transition: color var(--nav-dur-micro) var(--nav-ease);
}

body.header-custom .nav-drawer-sublink:hover { color: var(--_colors---text-color--primary); }
body.header-custom .nav-drawer-sublink.is-active { color: #e30613; }

/* Contact (mail + address): below the menu list, flush with the items; fades in after them. */
body.header-custom .nav-drawer-contact {
  margin-top: 1.75rem;
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity var(--nav-dur-major) var(--nav-ease),
              transform var(--nav-dur-major) var(--nav-ease);
}

body.header-custom.nav-drawer-open .nav-drawer-contact {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 330ms;
}

/* Mail + address share one row layout so their icons line up in a single column. */
body.header-custom .nav-drawer-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

body.header-custom .nav-drawer-contact-icon {
  flex: none;
  display: flex;
  justify-content: center;
  width: 1.1rem;
  margin-top: 0.15rem;
  color: var(--_colors---text-color--gray-1);
}

body.header-custom .nav-drawer-mail {
  margin-bottom: 0.9rem;
  font-size: var(--_typography---texts-font-sizes--paragraph-s);
  font-weight: 600;
  text-decoration: none;
  color: var(--_colors---text-color--dark);
  transition: color var(--nav-dur-micro) var(--nav-ease);
}

body.header-custom .nav-drawer-mail:hover { color: var(--_colors---text-color--primary); }
body.header-custom .nav-drawer-mail:hover .nav-drawer-contact-icon { color: var(--_colors---text-color--primary); }

body.header-custom .nav-drawer-address-lines {
  font-style: normal;
  font-size: var(--_typography---texts-font-sizes--paragraph-s);
  line-height: 1.55;
  color: var(--_colors---text-color--gray-1);
}

/* Bottom strip: lang switcher left (flush with the menu inset), social icons right. */
body.header-custom .nav-drawer-social {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  padding: 0 var(--nav-inset) env(safe-area-inset-bottom);
  background: #fff;
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity var(--nav-dur-major) var(--nav-ease),
              transform var(--nav-dur-major) var(--nav-ease);
}

body.header-custom.nav-drawer-open .nav-drawer-social {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 360ms;
}

/* Lang block: pull the first cell's left padding so the EN glyph lines up exactly
   with the menu items' left edge (both at --nav-inset), not a few px inside. */
body.header-custom .nav-drawer-social .lang-switch--drawer {
  margin-left: -0.7rem;
}

body.header-custom .nav-drawer-social-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

body.header-custom .nav-drawer-social-link {
  display: flex;
  color: var(--_colors---text-color--dark);
  transition: opacity var(--nav-dur-micro) var(--nav-ease);
}

body.header-custom .nav-drawer-social-link:hover { opacity: 0.6; }

body.header-custom .nav-drawer-social-link svg {
  width: 18px;
  height: 18px;
}

body.header-custom .navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  background: transparent;
  border-bottom: 1px solid transparent;
  /* Hide/show only; scroll-driven size uses no transition below */
  transition: transform var(--nav-dur-major) var(--nav-ease),
              background 60ms linear,
              border-color 60ms linear,
              box-shadow 60ms linear;
}

body.header-custom .navbar-wrap,
body.header-custom .nav-logo,
body.header-custom .nav-logo-link._02 {
  transition: none;
}

body.header-custom .navbar.is-scrolled {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
          backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 18px -16px rgba(0, 0, 0, 0.1);
}

body.header-custom .navbar.is-hidden { transform: translateY(-100%); }

@media (min-width: 992px) {
  body.header-custom .navbar-wrap {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  body.header-custom .nav-logo {
    max-width: 250px;
    transform: scale(calc(1 - 0.36 * var(--scroll-progress)));
    transform-origin: left center;
    backface-visibility: hidden;
  }
}

@media (max-width: 991px) {
  body.header-custom .navbar-wrap {
    padding-top: var(--nav-pad-max);
    padding-bottom: var(--nav-pad-max);
  }

  body.header-custom .nav-logo {
    max-width: var(--logo-max);
    transform: scale(calc(1 - 0.368 * var(--scroll-progress)));
    transform-origin: left center;
    backface-visibility: hidden;
  }

  body.header-custom .nav-menu-wrap .nav-burger { display: flex; }

  body.header-custom.nav-drawer-open .nav-logo,
  body.header-custom.nav-drawer-open .nav-logo-link._02 {
    max-width: var(--logo-max);
    transform: none;
  }

  body.header-custom.nav-drawer-open .navbar-wrap {
    padding-top: var(--nav-pad-max);
    padding-bottom: var(--nav-pad-max);
  }

  body.header-custom.nav-drawer-open .navbar {
    background: #fff;
    box-shadow: none;
    border-bottom-color: transparent;
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
  }

  body.header-custom .footer .footer-bottom {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 0.5rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }

  body.header-custom .footer .footer-bottom > * { justify-self: center; }

  body.header-custom .footer-bottom .copyright-text:last-child {
    font-size: 0.72rem;
    opacity: 0.45;
  }
}

@media (max-width: 479px) {
  body.header-custom { --nav-inset: 1.25rem; }
  body.header-custom .nav-drawer-link { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  body.header-custom .navbar,
  body.header-custom .navbar-wrap,
  body.header-custom .nav-logo,
  body.header-custom .nav-burger::before,
  body.header-custom .nav-burger::after,
  body.header-custom .nav-drawer,
  body.header-custom .nav-drawer-item,
  body.header-custom .nav-drawer-social,
  body.header-custom .nav-drawer-contact,
  body.header-custom .nav-drawer-sublist {
    transition: none !important;
  }

  /* No fade/slide: drawer content sits in place. */
  body.header-custom .nav-drawer-item,
  body.header-custom .nav-drawer-social,
  body.header-custom .nav-drawer-address {
    opacity: 1;
    transform: none;
  }
}
