/* =========================
   WRIGHT – Top Dropdown Side Nav (RESET + WORKING) — CLEANED + RESPONSIVE
   ========================= */

:root {
  --navy: #062a3a;
  --navy-2: #0a3446;
  --cream: #f8f7d9;
  --accent: #f59c22;
  --teal: #18a8ba;
  --white: #fff;
  --overlay: rgba(6, 18, 41, 0.55);

  /* one width source of truth */
  --max: 1440px;
  --gutter: 48px;

  /* fixed mega panel height (prevents jump/flash) */
  --panelH: 340px;

  --radius: 14px;

  /* ===== Responsive tabs tuning knobs (desktop/tablet) ===== */
  --tabs-gap: clamp(10px, 2.2vw, 44px);
  --tab-font: clamp(13px, 1.1vw, 18px);
  --tab-pad-y: clamp(12px, 1.4vw, 20px);
  --tab-pad-x: clamp(14px, 3.4vw, 50px);
  --tab-bottom-pad: clamp(8px, 1vw, 12px);
  --pill-inset-x: clamp(8px, 0.9vw, 10px);
  --pill-top: clamp(4px, 0.6vw, 6px);
  --pill-bottom: clamp(-10px, -0.8vw, -8px);
  --caret-size: clamp(12px, 0.9vw, 14px);
  --caret-tri-w: clamp(10px, 0.9vw, 12px);
  --caret-tri-h: clamp(8px, 0.8vw, 10px);
}

/* Reset */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: #0b1641;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* prevent scroll when open (JS toggles this) */
body.nav-open {
  overflow: hidden;
}

/* --------------------------------
   Shared container alignment (desktop/tablet)
   -------------------------------- */
.side-nav__mast,
.primary-nav,
.panel-wrap {
  width: min(calc(100% - var(--gutter)), var(--max));
  margin-inline: auto;
}

/* -------------------------
   Trigger (demo)
   ------------------------- */
.burger {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #111;
  border-radius: 2px;
}
.burger:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

/* -------------------------
   Overlay container
   ------------------------- */
.side-nav {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}
.side-nav[aria-hidden="false"] {
  display: block;
}

.side-nav__scrim {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  opacity: 0; /* GSAP */
  z-index: 0;
}

/* -------------------------
   SHEET: top-down container
   ------------------------- */
.side-nav__sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;

  /* IMPORTANT: transparent so navy never "shows through" */
  background: transparent;

  overflow: hidden;
  z-index: 1;

  display: flex;
  flex-direction: column;

  will-change: transform;
}

/* -------------------------
   Stacking order: navy always above cream
   ------------------------- */
.side-nav__primary {
  position: relative;
  z-index: 2;
  background: var(--navy);
  color: #fff;
}

.side-nav__panel {
  position: relative;
  z-index: 1;
  background: var(--cream);
  width: 100%;
  height: var(--panelH);
  overflow: hidden;
}

/* -------------------------
   Mast row (desktop/tablet)
   ------------------------- */
.side-nav__mast {
  padding: 18px 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
}

/* left cluster */
.mast__left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
  min-width: 0;
  width: 100%;
}

/* Close */
.side-nav__close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 44px;
  line-height: 1;
  width: 64px;
  height: 64px;
  cursor: pointer;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
}
.side-nav__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Logo-only brand */
.brand-img {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  flex: 0 0 auto;
  width: 190px;
  height: auto;
}
.brand-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Rating */
.side-nav__rating {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  color: #d9f1f6;
  min-width: 0;
}
.side-nav__stars {
  display: inline-flex;
  gap: 6px;
  font-size: 16px;
  line-height: 1;
  color: var(--accent);
}
.side-nav__rating-text {
  font-size: 12px;
  opacity: 0.95;
  white-space: nowrap;
}

/* CTAs pushed right (desktop/tablet) */
.side-nav__ctas {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 850;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}
.btn--primary {
  background: #fff;
  color: #002435;
}
.btn--ghost {
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  background: transparent;
}

/* -------------------------
   Tabs row (RESPONSIVE – desktop/tablet)
   ------------------------- */
.primary-nav {
  padding: 0;
}

.primary-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;

  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  gap: var(--tabs-gap);
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.primary-nav__list::-webkit-scrollbar {
  display: none;
}
.primary-nav__list > li {
  flex: 0 0 auto;
  min-width: 0;
}

/* BUTTON (desktop/tablet) */
.primary-nav__link {
  position: relative;
  border: 0;
  cursor: pointer;

  background: transparent;
  color: #eaf6fb;

  font-weight: 850;
  font-size: var(--tab-font);
  letter-spacing: 0.01em;

  padding: var(--tab-pad-y) var(--tab-pad-x) var(--tab-bottom-pad);

  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 12px);

  white-space: nowrap;
  opacity: 0.98;

  transition: none !important;
}

/* The pill element is injected by JS so GSAP can animate it (desktop/tablet) */
.primary-nav__link .nav-pill {
  position: absolute;
  left: var(--pill-inset-x);
  right: var(--pill-inset-x);
  top: var(--pill-top);
  bottom: var(--pill-bottom);

  background: var(--cream);
  border-radius: 16px 16px 0 0;

  pointer-events: none;
  z-index: 0;

  transform: translateY(14px) scaleY(0);
  transform-origin: bottom;
}

/* keep text above pill */
.primary-nav__link > span,
.primary-nav__link .pm {
  position: relative;
  z-index: 1;
}

/* active text colors (desktop/tablet) */
.primary-nav__link.is-active {
  color: #002435;
}

/* caret wrapper */
.primary-nav__link .pm {
  position: relative;
  width: var(--caret-size);
  height: var(--caret-size);
  display: inline-block;
  flex: 0 0 auto;
  opacity: 0.95;
}

/* SOLID triangle caret (desktop/tablet) */
.primary-nav__link .pm::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--caret-tri-w);
  height: var(--caret-tri-h);
  background: rgba(245, 156, 34, 1);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center;
  transition: transform 0.2s ease;
}

/* KEEP rotation when active */
.primary-nav__link.is-active .pm::before {
  transform: translate(-50%, -50%) rotate(180deg);
}

/* KEEP rotation on hover too */
@media (hover: hover) {
  .primary-nav__link.has-drop:hover .pm::before {
	transform: translate(-50%, -50%) rotate(180deg);
  }
}

/* -------------------------
   Cream mega panel content
   ------------------------- */
.panel-wrap {
  height: 100%;
  padding: 28px 0 28px;
  position: relative;
  overflow: hidden;
}

.panel {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}
.panel.is-active {
  display: block;
  pointer-events: auto;
}

.panel h3 {
  margin: 24px 0 18px;
  color: var(--accent);
  font-size: 34px;
  letter-spacing: 0.01em;
  font-weight: 900;
}

/* submenu grid */
.submenu {
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(40px, 8vw, 140px);
  row-gap: 36px;
  align-items: start;
}

.submenu > li {
  margin: 0;
  padding: 0;
}

.submenu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: #0a2c3b;
  font-weight: 750;
  font-size: 20px;
  line-height: 1.2;
}

.submenu__icon-img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
}
.submenu__icon-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* kill any old underline on the link itself */
.submenu > li > a:hover,
.submenu > li > a:focus-visible {
  text-decoration: none !important;
}

/* underline animation ONLY on the text span */
.submenu__txt {
  position: relative;
  display: inline-block;
  text-decoration: none;
}
.submenu__txt::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease, left 0.3s ease;
}
.submenu > li > a:hover .submenu__txt::after,
.submenu > li > a:focus-visible .submenu__txt::after {
  width: 100%;
  left: 0;
}

/* =========================
   MOBILE (≤1024px) — match your screenshot layout
   ========================= */
@media (max-width: 1024px) {
  
  .burger, .border-b{
    display:none;
  }
  /* hide cream mega panel (accordion mode via JS) */
  .side-nav__panel {
	display: none !important;
  }

  /* full-width mobile layout (don’t constrain by --max) */
  .side-nav__mast,
  .primary-nav {
	width: 100%;
	margin: 0;
	padding-inline: 22px;
  }

  /* make the navy area behave like a full mobile “sheet” */
  .side-nav__primary {
	min-height: 100dvh; /* fill screen */
	padding-bottom: 260px; /* reserve space for CTAs + rating at bottom */
  }

  /* mast becomes a vertical stack: X top-left, logo centered */
  .side-nav__mast {
	padding: 18px 22px 0;
	gap: 14px;
  }
  .mast__left {
	width: 100%;
	flex-direction: column;
	align-items: baseline;
	gap: 18px;
  }

  .side-nav__close {
	align-self: flex-start;
	width: 46px;
	height: 46px;
	font-size: 34px;
  }

  .brand-img {
	width: min(45vw, 267px);
	justify-content: center;
  }

  /* move CTAs to mid-lower area (like screenshot) */
  .side-nav__ctas {
	position: absolute;
	left: 50%;
	bottom: 150px;
	transform: translateX(-50%);
	margin-left: 0;

	width: min(calc(100% - 44px), 420px);
	flex-direction: column;
	align-items: stretch;
	gap: 14px;
  }
  .btn {
	width: 100%;
	justify-content: center;
  }

  /* move rating block to bottom area (like screenshot) */
  .side-nav__rating {
	position: absolute;
	left: 50%;
	bottom: 56px;
	transform: translateX(-50%);

	width: min(calc(100% - 44px), 420px);
	align-items: flex-start;
  }

  /* primary nav becomes vertical list */
  .primary-nav {
	padding: 26px 22px 0;
  }

  .primary-nav__list {
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: 16px;

	overflow: visible; /* no horizontal scroll on mobile */
  }

  .primary-nav__list > li {
	width: 100%;
  }

  /* kill the animated desktop pill on mobile */
  .primary-nav__link .nav-pill {
	display: none !important;
  }

  /* big row buttons like screenshot */
  .primary-nav__link {
	width: 100%;
	justify-content: space-between;

	font-size: clamp(18px, 4.6vw, 28px);
	padding: 18px 22px;
	border-radius: 999px;

	color: #fff;
	opacity: 1;
  }

  /* active row background (mobile look) */
  .primary-nav__link.is-active {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
  }

  /* caret: default points RIGHT on mobile, active points DOWN */
  .primary-nav__link .pm {
	width: 22px;
	height: 22px;
  }

  .primary-nav__link .pm::before {
	width: 16px;
	height: 14px;
	transform: translate(-50%, -50%) rotate(-90deg); /* right */
  }

  .primary-nav__link.is-active .pm::before {
	transform: translate(-50%, -50%) rotate(0deg); /* down */
  }

  /* mobile submenu host (JS moves ULs into these) */
  .mobile-sub {
	display: none;
	overflow: hidden;
	margin: 10px 0 12px;
	padding: 14px;
	border-left: 2px solid rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0.06);
	border-radius: 12px;
  }

  .mobile-sub .submenu {
	grid-template-columns: 1fr;
	row-gap: 14px;
	column-gap: 0;
  }

  .mobile-sub .submenu > li > a {
	color: #fff;
	text-decoration: none;
	font-size: 16px;
  }

  /* ✅ make the whole navy sheet scroll */
  .side-nav__sheet {
	height: 100dvh;
	overflow: hidden;
  }

  .side-nav__primary {
	height: 100%;
	overflow-y: auto; /* ✅ scroll happens here */
	-webkit-overflow-scrolling: touch;
	padding-bottom: 24px;
  }

  /* ✅ new footer area (JS will create + place CTAs + rating here) */
  .side-nav__mobile-footer {
	width: 90%;
	padding: 18px 0 28px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: 0 auto;
  }

  /* ✅ CTAs become normal flow (NOT absolute) */
  .side-nav__ctas {
	position: static !important;
	transform: none !important;
	width: 100%;
	margin: 0 auto;
	flex-direction: column;
	align-items: stretch;
	gap: 14px;
  }

  .btn {
	width: 100%;
	justify-content: center;
  }

  /* ✅ rating becomes normal flow (NOT absolute) */
  .side-nav__rating {
	position: static !important;
	transform: none !important;
	width: 100%;
	margin: 0 auto;
	align-items: flex-start;
  }
}
