/* ==========================================================================
   HEADER
   Floating pill header, always on top. header.js drives three sequential
   states by toggling classes — this file only defines what each state
   looks like:
     .is-circle    -> 0 -> small filled circle (headerCircleIn keyframe)
     .is-expanded  -> circle stretches into the full-width pill
     .is-content-visible -> logo + nav fade/slide in inside the pill
   ========================================================================== */

.site-header {
  position: fixed;
  top: var(--sp-3);
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none; /* re-enabled once content is visible, see header.js */
}

.site-header.is-interactive { pointer-events: auto; }

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 56px;
  height: 56px;
  padding: 0 var(--sp-2);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  background: var(--color-accent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 8px 30px -10px rgba(18, 20, 26, 0.18);
  transition:
    width var(--dur-xslow) var(--ease-out-soft),
    height var(--dur-med) var(--ease-out-soft),
    border-radius var(--dur-med) var(--ease-out-soft),
    opacity var(--dur-med) ease,
    transform var(--dur-med) var(--ease-out-soft),
    background-color var(--dur-slow) ease,
    box-shadow var(--dur-med) ease;
}

.site-header__bar.is-circle {
  opacity: 1;
  transform: scale(1);
}

.site-header__bar.is-expanded {
  width: min(94vw, 1180px);
  height: var(--header-height);
  padding: 0 var(--sp-4);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.88);
}

.site-header.is-scrolled .site-header__bar.is-expanded {
  height: var(--header-height-shrunk);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 34px -12px rgba(18, 20, 26, 0.24);
}

.site-header__logo,
.site-header__cta,
.site-header__whatsapp,
.site-header__toggle {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--dur-med) var(--ease-out-soft),
              transform var(--dur-med) var(--ease-out-soft);
}

.site-header__bar.is-content-visible .site-header__logo   { opacity: 1; transform: none; transition-delay: 60ms; }
.site-header__bar.is-content-visible .site-header__nav a   { opacity: 1; transform: none; }
.site-header__bar.is-content-visible .site-header__whatsapp { opacity: 1; transform: none; transition-delay: 220ms; }
.site-header__bar.is-content-visible .site-header__cta     { opacity: 1; transform: none; transition-delay: 260ms; }
.site-header__bar.is-content-visible .site-header__toggle  { opacity: 1; transform: none; }

.site-header__logo img {
  height: 40px;
  width: auto;
  display: block;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.site-header__nav a {
  position: relative;
  font-size: var(--fs-small);
  font-weight: var(--fw-subheading);
  color: var(--color-ink);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--dur-med) var(--ease-out-soft),
              transform var(--dur-med) var(--ease-out-soft),
              color var(--dur-fast) ease;
}

.site-header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1.5px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform var(--dur-fast) var(--ease-out-soft);
}

.site-header__nav a:nth-child(1) { transition-delay: 100ms; }
.site-header__nav a:nth-child(2) { transition-delay: 150ms; }
.site-header__nav a:nth-child(3) { transition-delay: 200ms; }
.site-header__nav a:nth-child(4) { transition-delay: 250ms; }
.site-header__nav a:nth-child(5) { transition-delay: 300ms; }

.site-header__nav a:hover { color: var(--color-accent); }
.site-header__nav a:hover::after { transform: scaleX(1); }

.site-header__right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.site-header__cta,
.site-header__whatsapp {
  padding: 0.6rem 1.3rem;
  font-size: var(--fs-small);
}

/* .btn--whatsapp carries a 1px border and .btn--primary doesn't, so shave
   the padding by that much — otherwise it sits 2px taller than Book now. */
.site-header__whatsapp { padding: calc(0.6rem - 1px) calc(1.3rem - 1px); }

/* The pill caps at 1180px and the nav already carries several links, so
   below that the WhatsApp button drops its label and becomes a round icon
   rather than squeezing the nav. The label stays in the DOM for screen
   readers — the anchor also carries an aria-label. */
@media (max-width: 1080px) {
  .site-header__whatsapp {
    padding: 0;
    width: 40px;
    height: 40px;
    justify-content: center;
    border-radius: 50%;
  }
  .site-header__whatsapp .btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .site-header__whatsapp .btn__icon { width: 1.25rem; height: 1.25rem; }
}

.site-header__toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(18, 20, 26, 0.06);
  transition: background var(--dur-fast) ease, opacity var(--dur-med) var(--ease-out-soft), transform var(--dur-med) var(--ease-out-soft);
}

.site-header__toggle:hover { background: rgba(18, 20, 26, 0.1); }

/* Persistent tinted chip while the menu is open — the X reads clearly
   against any background behind the frosted pill, on any device. */
.site-header.is-menu-open .site-header__toggle {
  background: rgba(0, 127, 126, 0.14);
}

.site-header__toggle span,
.site-header__toggle span::before,
.site-header__toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
  position: relative;
  transition: transform var(--dur-fast) var(--ease-out-soft), opacity var(--dur-fast) ease, background var(--dur-fast) ease;
}

.site-header__toggle span::before { position: absolute; top: -6px; }
.site-header__toggle span::after  { position: absolute; top: 6px; }

.site-header.is-menu-open .site-header__toggle span { opacity: 0; }
.site-header.is-menu-open .site-header__toggle span::before {
  top: 0; transform: rotate(45deg); opacity: 1; background: var(--color-accent);
}
.site-header.is-menu-open .site-header__toggle span::after {
  top: 0; transform: rotate(-45deg); opacity: 1; background: var(--color-accent);
}

/* ---- Mobile dropdown panel ----
   Base state lives OUTSIDE the media query on purpose: without a default
   hidden/positioned state, this element has no styling at all on wider
   viewports and renders as a plain, unstyled block in the page flow
   (pushing the hero section down). Fixed positioning + opacity 0 +
   pointer-events: none is inert and harmless at any viewport width; the
   media query below only needs to handle sizing and the header-only
   display toggles. */
.mobile-nav {
  position: fixed;
  top: calc(var(--header-height) + var(--sp-3) + var(--sp-2));
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  width: min(92vw, 520px);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px -16px rgba(18, 20, 26, 0.3);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out-soft),
              transform var(--dur-fast) var(--ease-out-soft);
}

.site-header.is-menu-open ~ .mobile-nav,
.mobile-nav.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.mobile-nav__link {
  padding: var(--sp-2) var(--sp-2);
  font-size: 1.05rem;
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  border: 1px solid transparent;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.mobile-nav__link:hover,
.mobile-nav__link:focus-visible,
.mobile-nav__link.is-active {
  background: rgba(0, 127, 126, 0.08);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.mobile-nav .btn { margin-top: var(--sp-2); justify-content: center; }

/* Mobile ---------------------------------------------------------------- */
@media (max-width: 860px) {
  .site-header__nav { display: none; }
  .site-header__toggle { display: flex; }
  .site-header__cta,
  .site-header__whatsapp { display: none; }  /* both live in .mobile-nav here */

  .site-header__bar.is-expanded { width: min(92vw, 520px); }
}
