/* ==========================================================
   Header, navigation, dropdowns, mega menu & mobile drawer
   ========================================================== */

.btn svg { width: 18px; height: 18px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--teal-900); color: #cad2cc; font-size: .8rem; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 42px; }
.topbar svg { width: 15px; height: 15px; color: var(--gold-soft); }
.topbar__meta { display: flex; gap: 28px; }
.topbar__meta li { display: flex; align-items: center; gap: 8px; }
.topbar__right { display: flex; align-items: center; gap: 22px; }
.topbar__msg { margin: 0; display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 600; }
.topbar__phone { display: flex; align-items: center; gap: 8px; color: var(--gold-soft); font-weight: 700; letter-spacing: .02em; padding-left: 22px; border-left: 1px solid rgba(255,255,255,.14); }
.topbar__phone:hover { color: #fff; }
.topbar__social { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); transition: background .2s, border-color .2s; }
.topbar__social:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); }
.topbar__social svg { width: 13px; height: 13px; color: #fff; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #5ee0a8; box-shadow: 0 0 0 0 rgba(94, 224, 168, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(94, 224, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(94, 224, 168, 0); } }

/* ---------- Header shell ---------- */
/* The blur lives on ::before so the header itself never becomes a
   containing block for the fixed mobile drawer. */
.header { position: sticky; top: 0; z-index: 50; }
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s;
}
.header.is-scrolled::before { box-shadow: 0 10px 30px -18px rgba(20, 30, 24, .35); }
.header .container { width: min(1440px, 100% - 48px); }
.header__inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 28px; height: 104px; transition: height .35s var(--ease); }
.header.is-scrolled .header__inner { height: 84px; }
.brand { flex-shrink: 0; }
.brand img { height: 62px; width: auto; transition: height .35s var(--ease); }
.header.is-scrolled .brand img { height: 52px; }

.header__actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.header__phone { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.12rem; color: var(--teal-800); letter-spacing: .01em; }
.header__phone small { display: block; font-size: .74rem; font-weight: 700; color: var(--gold-ink); letter-spacing: .12em; text-transform: uppercase; line-height: 1.3; }
.header__phone > span:last-child { line-height: 1.25; }
.header__phone-icon { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--teal-50); color: var(--teal-700); transition: background .25s, color .25s; }
.header__phone-icon::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--teal-100); animation: ring 2.4s ease-out infinite; }
.header__phone-icon svg { width: 19px; height: 19px; }
.header__phone:hover .header__phone-icon { background: var(--teal-700); color: #fff; }
@keyframes ring { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }

/* ---------- Menu (shared) ---------- */
.menu__link { font-weight: 600; color: var(--teal-900); letter-spacing: .005em; transition: color .2s; }
.menu__caret { display: grid; place-items: center; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
.menu__caret svg { width: 15px; height: 15px; stroke-width: 2.2; transition: transform .3s var(--ease); }

.drop__icon { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: var(--teal-50); color: var(--teal-700); transition: background .25s, color .25s, transform .25s var(--ease); }
.drop__icon svg { width: 20px; height: 20px; }

.drop__item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; transition: background .2s; }
.drop__item strong { display: block; font-family: var(--serif); font-size: 1.22rem; font-weight: 700; color: var(--teal-900); line-height: 1.15; letter-spacing: .005em; }
.drop__item small { display: block; font-size: .82rem; font-weight: 500; color: #616a63; line-height: 1.45; margin-top: 3px; }
.drop__item:hover { background: var(--teal-50); }
.drop__item:hover .drop__icon { background: var(--teal-700); color: var(--gold-soft); transform: scale(1.05); }

.drop__foot { display: flex; align-items: center; gap: 14px; margin-top: 6px; padding: 14px 16px; border-radius: 16px; background: var(--sand); transition: background .2s; }
.drop__foot img { width: 42px; height: 42px; border-radius: 50%; }
.drop__foot strong { display: block; font-family: var(--serif); font-size: 1.12rem; font-weight: 700; color: var(--teal-900); line-height: 1.2; }
.drop__foot small { display: block; font-size: .8rem; font-weight: 500; color: #616a63; }
.drop__foot:hover { background: var(--sand-200); }
.drop__arrow { margin-left: auto; width: 18px; height: 18px; color: var(--teal-700); transition: transform .25s var(--ease); }
.drop__foot:hover .drop__arrow { transform: translateX(4px); }
.drop__foot--cta { background: var(--teal-800); }
.drop__foot--cta:hover { background: var(--teal-900); }
.drop__foot--cta strong { color: #fff; }
.drop__foot--cta small { color: #bac5bd; }
.drop__foot--cta .drop__icon { background: rgba(255,255,255,.1); color: var(--gold-soft); }
.drop__foot--cta .drop__arrow { color: var(--gold-soft); }

.mega__col > a:not(.mega__head) { display: block; font-size: .94rem; font-weight: 500; color: #323b34; transition: color .2s, transform .2s var(--ease); }
.mega__col > a:not(.mega__head):hover { color: var(--teal-700); }
.mega__head { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 1.42rem; white-space: nowrap; font-weight: 700; color: var(--teal-900); line-height: 1.1; }
.mega__head .drop__icon { width: 38px; height: 38px; border-radius: 11px; }
.mega__head .drop__icon svg { width: 18px; height: 18px; }
.mega__head:hover { color: var(--teal-700); }
.mega__head:hover .drop__icon { background: var(--teal-700); color: var(--gold-soft); }

.nav__head, .nav__foot, .burger { display: none; }

/* ---------- Scrim ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(20, 30, 24, .38);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
body.nav-open .scrim { opacity: 1; visibility: visible; }

/* ==========================================================
   Desktop
   ========================================================== */
@media (min-width: 1121px) {
  .nav { flex: 1; display: flex; justify-content: center; }
  .menu { display: flex; align-items: center; gap: 2px; }
  .menu__item { position: relative; display: flex; align-items: center; }
  .menu__item.has-drop--mega { position: static; }

  .menu__link { position: relative; padding: 12px 14px; font-size: 1.05rem; }
  .header__book { font-size: 1rem; padding: 13px 26px; }
  .has-drop > .menu__link { padding-right: 4px; }
  .menu__link::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), #cfc3a9);
    transform: scaleX(0); transform-origin: center; transition: transform .35s var(--ease);
  }
  .has-drop > .menu__link::after { right: 4px; }
  .menu__item:hover > .menu__link, .menu__item.is-open > .menu__link { color: var(--teal-700); }
  .menu__item:hover > .menu__link::after, .menu__item.is-open > .menu__link::after { transform: scaleX(1); }
  .menu__caret { width: 26px; height: 40px; margin-right: 6px; color: var(--muted); }
  .has-drop:hover > .menu__caret svg, .has-drop.is-open > .menu__caret svg { transform: rotate(180deg); color: var(--teal-700); }

  /* Dropdown panel */
  .drop {
    position: absolute; top: calc(100% + 12px); left: 50%;
    width: 380px; padding: 10px;
    background: var(--white); border: 1px solid var(--line); border-radius: 22px;
    box-shadow: 0 30px 70px -24px rgba(20, 30, 24, .35), 0 4px 14px -6px rgba(20, 30, 24, .1);
    opacity: 0; visibility: hidden;
    transform: translate(-50%, 12px) scale(.98); transform-origin: top center;
    transition: opacity .25s, transform .35s var(--ease), visibility .25s;
  }
  /* hover bridge across the gap */
  .drop::before { content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 22px; }
  /* little notch */
  .drop:not(.mega)::after {
    content: ""; position: absolute; top: -7px; left: 50%; width: 14px; height: 14px;
    background: var(--white); border-left: 1px solid var(--line); border-top: 1px solid var(--line);
    transform: translateX(-50%) rotate(45deg); border-top-left-radius: 3px;
  }
  .has-drop:hover > .drop,
  .has-drop:focus-within > .drop,
  .has-drop.is-open > .drop { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }

  /* Stagger the items in */
  .drop__item, .mega__col { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .4s var(--ease), background .2s; }
  .has-drop:hover .drop__item, .has-drop:focus-within .drop__item, .has-drop.is-open .drop__item,
  .has-drop:hover .mega__col, .has-drop:focus-within .mega__col, .has-drop.is-open .mega__col { opacity: 1; transform: none; }
  .drop__item:nth-child(2), .mega__col:nth-child(2) { transition-delay: .04s; }
  .drop__item:nth-child(3), .mega__col:nth-child(3) { transition-delay: .08s; }
  .drop__item:nth-child(4), .mega__col:nth-child(4) { transition-delay: .12s; }

  /* Mega menu spans the header width */
  .mega {
    left: 0; right: 0; width: auto; padding: 0; overflow: hidden;
    top: calc(100% + 1px);
    border-radius: 0 0 28px 28px; border-top: 0;
    transform: translateY(10px);
  }
  .mega::before { top: -16px; height: 16px; }
  .has-drop:hover > .mega, .has-drop:focus-within > .mega, .has-drop.is-open > .mega { transform: none; }

  .mega__grid { display: grid; grid-template-columns: 1.12fr 1.1fr .95fr 1.05fr 280px; }
  .mega__col { padding: 32px 26px 28px; border-right: 1px solid var(--line); }
  .mega__col:first-child { padding-left: 34px; }
  .mega__head { margin-bottom: 16px; }
  .mega__head--sub { margin-top: 26px; }
  .mega__col > a:not(.mega__head) { position: relative; padding: 6px 0; }
  .mega__col > a:not(.mega__head)::before {
    content: ""; position: absolute; left: -14px; top: 50%; width: 8px; height: 1.5px; background: var(--gold);
    opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .25s var(--ease);
  }
  .mega__col > a:not(.mega__head):hover { transform: translateX(8px); }
  .mega__col > a:not(.mega__head):hover::before { opacity: 1; transform: none; }

  .mega__feature {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: flex-start;
    margin: 14px; padding: 30px 26px; border-radius: 22px; color: #fff;
    background:
      radial-gradient(240px 200px at 100% 0%, rgba(207, 195, 169, .28), transparent 70%),
      linear-gradient(160deg, var(--teal-700), var(--teal-900));
  }
  .mega__feature::after {
    content: ""; position: absolute; right: -50px; bottom: -50px; width: 170px; height: 170px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 26px rgba(255,255,255,.03);
  }
  .mega__badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(207, 195, 169, .16); color: var(--gold-soft); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px; }
  .mega__badge svg { width: 13px; height: 13px; }
  .mega__feature h3 { font-family: var(--serif); font-size: 1.75rem; font-weight: 700; line-height: 1.1; margin-bottom: 10px; }
  .mega__feature p { font-size: .88rem; color: #c2ccc4; line-height: 1.55; margin-bottom: 22px; }
  .mega__call { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 4px; background: var(--ivory); color: var(--teal-900); font-weight: 800; font-size: .95rem; transition: transform .25s var(--ease); }
  .mega__call:hover { transform: translateY(-2px); }
  .mega__call svg { width: 17px; height: 17px; }
  .mega__more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 22px; color: var(--gold-soft); font-weight: 600; font-size: .88rem; }
  .mega__more svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
  .mega__more:hover svg { transform: translateX(4px); }

  .mega__bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 34px; background: var(--ivory); border-top: 1px solid var(--line); font-size: .88rem; color: #4c554e; font-weight: 500; }
  .mega__bar p { margin: 0; }
  .mega__bar p a { color: var(--teal-700); font-weight: 700; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
  .mega__all { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--teal-700); }
  .mega__all svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
  .mega__all:hover svg { transform: translateX(4px); }

  /* Dim the page while the mega menu is open */
  body:has(.has-drop--mega:hover) .scrim,
  body:has(.has-drop--mega.is-open) .scrim { opacity: 1; visibility: visible; }
}

@media (min-width: 1121px) and (max-width: 1480px) {
  .header__phone { display: none; }
  .brand img { height: 56px; }
  .header.is-scrolled .brand img { height: 50px; }
  .menu__link { padding: 12px 10px; font-size: 1rem; }
  .menu__link::after { left: 10px; right: 10px; }
  .header__book { padding: 12px 20px; font-size: .95rem; }
  .mega__grid { grid-template-columns: 1.12fr 1.1fr .95fr 1.05fr 240px; }
  .mega__col { padding-left: 20px; padding-right: 18px; }
}

/* ==========================================================
   Tablet & mobile: slide-in drawer
   ========================================================== */
@media (max-width: 1120px) {
  .burger {
    display: block; position: relative; width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--white); cursor: pointer;
  }
  .burger span { position: absolute; left: 15px; height: 2px; border-radius: 2px; background: var(--teal-800); transition: transform .3s var(--ease), opacity .2s, width .3s var(--ease); }
  .burger span:nth-child(1) { top: 17px; width: 18px; }
  .burger span:nth-child(2) { top: 23px; width: 12px; }
  .burger span:nth-child(3) { top: 29px; width: 16px; }
  .burger:hover span { width: 18px; }

  .nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(420px, 100%);
    display: flex; flex-direction: column;
    background: var(--ivory);
    box-shadow: -30px 0 60px -30px rgba(20, 30, 24, .4);
    transform: translateX(100%); visibility: hidden;
    transition: transform .45s var(--ease), visibility .45s;
    overflow-y: auto; overscroll-behavior: contain;
  }
  .nav.is-open { transform: none; visibility: visible; }

  .nav__head {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; background: var(--ivory); border-bottom: 1px solid var(--line);
  }
  .nav__head img { height: 40px; width: auto; }
  .nav__close { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: var(--teal-800); cursor: pointer; }
  .nav__close svg { width: 20px; height: 20px; stroke-width: 2; }

  .menu { padding: 8px 20px; }
  .menu__item { display: grid; grid-template-columns: 1fr auto; align-items: center; border-bottom: 1px solid var(--line); }
  .menu__link { padding: 17px 0; font-size: 1.08rem; }
  .menu__caret { width: 38px; height: 38px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); color: var(--teal-700); }
  .has-drop.is-open > .menu__caret { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
  .has-drop.is-open > .menu__caret svg { transform: rotate(180deg); }

  /* Accordion panels */
  .drop { grid-column: 1 / -1; max-height: 0; overflow: hidden; transition: max-height .45s var(--ease); }
  .has-drop.is-open > .drop { max-height: 620px; }
  .drop__list { padding-bottom: 6px; }
  .drop__item { padding: 10px 8px; }
  .drop__item .drop__icon { width: 38px; height: 38px; }
  .drop__foot { margin: 4px 0 16px; }

  .has-drop.is-open > .mega { max-height: 1600px; }
  .mega__grid { display: grid; gap: 4px; padding-bottom: 14px; }
  .mega__col { padding: 10px 0; }
  .mega__head { font-size: 1.2rem; margin-bottom: 8px; }
  .mega__head--sub { margin-top: 16px; }
  .mega__col > a:not(.mega__head) { padding: 6px 0 6px 50px; font-size: .92rem; }
  .mega__feature { display: none; }
  .mega__bar { display: none; }

  .nav__foot { display: grid; gap: 12px; margin-top: auto; padding: 24px 20px 28px; }
  .nav__foot .btn { width: 100%; }
  .nav__info { margin-top: 8px; padding: 18px; border-radius: 18px; background: var(--white); border: 1px solid var(--line); font-size: .86rem; color: var(--muted); }
  .nav__info p { display: flex; gap: 10px; margin: 0; line-height: 1.5; }
  .nav__info p + p { margin-top: 12px; }
  .nav__info svg { width: 17px; height: 17px; margin-top: 2px; color: var(--gold); }

  body.nav-open { overflow: hidden; }
  .topbar__meta li:last-child { display: none; }
}

@media (max-width: 720px) {
  .topbar__meta, .topbar__social { display: none; }
  .topbar__right { width: 100%; justify-content: space-between; }
  .topbar__phone { border: 0; padding: 0; }
  .header__inner { height: 74px; gap: 12px; }
  .header.is-scrolled .header__inner { height: 66px; }
  .brand img, .header.is-scrolled .brand img { height: 40px; }
  .header__phone, .header__book { display: none; }
}

@media (max-width: 380px) {
  .brand img, .header.is-scrolled .brand img { height: 34px; }
}

/* Logo already links home, so "Home" only shows in the mobile drawer */
@media (min-width: 1121px) {
  .menu__item--home { display: none; }
}
