:root {
  --blue: #1a1af0;
  --blue-dark: #12129c;
  --cream: #fdf6ea;
  --yellow: #fdf07a;
  --text: #1a1a2e;
  --gray-line: #e7e4da;
  --sky-top: #8fd9f0;
  --sky-mid: #e9c6df;
  --sky-bottom: #f3d8c9;
  --tube-navy: #241a4d;
  --tube-navy-2: #2e2470;
  --hot-pink: #f23fb0;
  --mint: #5eeed0;
  --lemon: #f7e9a0;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background: #fff;
  color: var(--text);
  overflow-x: hidden;
  width: 100%;
}

/* ---------- Main nav ---------- */
.announce-bar {
  background: var(--blue);
  color: #fff;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 10px 40px;
  text-transform: uppercase;
}

.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--gray-line);
  width: 95%;
  margin: 50px auto 0;
  margin-top: 50px;
  border-radius: 20px;
  position: fixed;
  top: 22px;
  z-index: 99999;
  left: 0;
  right: 0;
  box-sizing: border-box;
}

.fixed-header {
  top: 10px;
  margin-top: 0;
}

.nav-wrap {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 20px;
  box-sizing: border-box;
  width: 100%;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-left a {
  text-decoration: none;
  color: var(--blue-dark);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-left a svg {
  width: 10px;
  height: 10px;
}

.logo {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--blue-dark);
  white-space: nowrap;
}

.logo sup {
  font-size: 11px;
}

.nav-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
}

.nav-right button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue-dark);
  padding: 0;
  display: flex;
  align-items: center;
}

.logo img {
  width: 140px;
  height: 41px;
}

.nav-right svg {
  width: 20px;
  height: 20px;
}

.cart-wrap {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--blue-dark);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item {
  position: relative;
}

.nav-item>a {
  padding: 6px 0;
}

.nav-item>a svg {
  transition: transform 0.2s ease;
}

.nav-item:hover>a svg,
.nav-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Bootstrap's .collapse plugin defaults to display:none when not open.
   Our mega/dropdown panels manage their own visibility via opacity/visibility
   (desktop) or display (mobile), so force them to stay in the render flow. */
.mega-panel,
.dropdown-panel {
  display: block;
}

/* Kill Bootstrap's height-animation step so our own transitions control the reveal */
.mega-panel.collapsing,
.dropdown-panel.collapsing,
#viHeaderNavLeft.collapsing {
  transition: none !important;
  height: auto !important;
}

.mega-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: 110px;
  background: #fff;
  border-top: 1px solid var(--gray-line);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 50;
  width: 95%;
  margin: 0 auto;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.mega-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.3fr;
  gap: 32px;
  padding: 36px 40px;
}

.mega-col h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9a968a;
  margin: 0 0 14px;
}

.mega-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mega-col a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.mega-col a:hover {
  color: var(--blue-dark);
}

.mega-promo {
  background: var(--yellow);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 180px;
}

.mega-promo .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue-dark);
  margin-bottom: 6px;
}

.mega-promo .headline {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 10px;
}

.mega-promo a.shop-link {
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  color: var(--blue-dark);
}

/* ---------- Simple dropdown (More) ---------- */
.dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  padding: 10px;
  min-width: 190px;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 50;
}

.dropdown-panel li a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.dropdown-panel li a:hover {
  background: var(--cream);
  color: var(--blue-dark);
}

/* ---------- Sticky vertical offer tab ---------- */
.offer-tab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  background: var(--yellow);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 16px 10px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
}

/* =========================================================
     DESKTOP: hover opens mega / dropdown panels
     (the .show class is only added/removed by Bootstrap's
     Collapse JS on mobile taps — see hover script in header.php)
     ========================================================= */
@media (min-width: 901px) {

  .nav-item.has-mega:hover .mega-panel,
  .mega-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-item.has-dropdown:hover .dropdown-panel,
  .dropdown-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* mobile-only controls, hidden on desktop */
.navbar-toggler {
  display: none;
}

@media (max-width: 900px) {

  .nav-item.open .mega-panel,
  .nav-item.open .dropdown-panel {
    display: block;
  }

  .site-header {
    margin-top: 40px;
  }

  .nav-wrap {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "icons icons icons"
      "toggle . logo"
      "menu  menu menu";
    row-gap: 10px;
    padding: 14px 20px;
  }

  /* ----- top row: icons ----- */
  .nav-right {
    grid-area: icons;
    justify-content: flex-end;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-line);
  }

  /* ----- toggle: left ----- */
  .navbar-toggler {
    grid-area: toggle;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--gray-line);
    border-radius: 8px;
    color: var(--blue-dark);
    cursor: pointer;
    padding: 0;
  }

  .navbar-toggler svg {
    width: 18px;
    height: 18px;
  }

  /* ----- logo: right ----- */
  .logo {
    grid-area: logo;
    font-size: 18px;
    justify-self: end;
  }

  .logo img {
    width: 110px;
    height: auto;
  }

  /* ----- collapsible menu -----
     This is the key fix: the drawer is capped to the remaining
     viewport height and scrolls internally, so it can never render
     "outside" the header box or get clipped off-screen. */
  .nav-left {
    grid-area: menu;
    display: none !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    border-top: 1px solid var(--gray-line);
    position: relative;
    z-index: 9999;
    background: var(--cream);
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }

  .nav-left.show {
    display: flex !important;
  }

  .nav-left a span.label {
    display: inline;
  }

  .nav-left .nav-item>a,
  .nav-left>a {
    justify-content: space-between;
    width: 100%;
    padding: 14px 4px;
    border-bottom: 1px solid var(--gray-line);
  }

  /* mega + dropdown panels become inline/static inside the drawer on mobile,
     shown by Bootstrap's Collapse via the .show class it adds to the panel */
  .mega-panel,
  .dropdown-panel {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
    box-shadow: none;
    border: none;
    border-radius: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none;
    max-height: none;
  }

  .mega-panel.show,
  .dropdown-panel.show {
    display: block;
  }

  .mega-inner {
    grid-template-columns: 1fr 1fr;
    padding: 20px 4px;
    gap: 24px;
  }

  .mega-promo {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .offer-tab {
    font-size: 11px;
    padding: 12px 8px;
  }
}