/* =========================
   THR-STYLE STICKY HEADER
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff;
  border-bottom: 1px solid var(--color--light-gray);
}

/* shared layout widths */
.header-top__inner,
.header-navrow__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 16px;
}

/* --- TOP BAR (unshrunk) --- */
.header-top {
  background: #fff;
}

.header-top__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-left {
  justify-content: flex-start;
}
.header-right {
  justify-content: flex-end;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 6px;
  cursor: pointer;
  color: #111;
  text-decoration: none;
}

.top-link {
  text-decoration: none;
  color: #111;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: var(--font-size--base);
}

.top-link--accent {
  color: var(--color--accent);
}

/* brand big */
.brand {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand__text--big {
  font-size: 32px;
  font-weight: 800;
}
.brand__logo--big img {
  height: 64px;
  width: auto;
  display: block;
}

/* --- NAV ROW (categories) --- */
.header-navrow {
  border-top: 1px solid #efefef;
  background: #fff;
}

.header-navrow__inner {
  display: grid;
  grid-template-columns: 1fr; /* actions | small logo | nav | subscribe */
  align-items: center;
  gap: 18px;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* nav */
.header-nav {
  display: flex;
  justify-content: center;
}

.header-nav .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.header-nav .menu a {
  text-decoration: none;
  color: #111;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: var(--font-size--base);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Shrunk-only left actions in nav row */
.nav-actions--left {
  display: none;
  align-items: center;
  gap: 10px;
}

/* small brand shown only when shrunk */
.brand__logo--small img {
  max-height: 30px;
  width: auto;
  display: none;
}

/* subscribe on nav row */
.nav-subscribe {
  display: none;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: var(--font-size--base);
  color: var(--color--accent);
  text-transform: uppercase;
  white-space: nowrap;
}

/* =========================
   SHRINKED STATE
   ========================= */

.site-header {
  transition: box-shadow 160ms ease;
}

.site-header.is-shrunk {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* hide big top bar when shrunk */
.site-header.is-shrunk .header-top {
  display: none;
}
.site-header.is-shrunk .header-navrow__inner {
  grid-template-columns: auto auto 1fr auto; /* actions | small logo | nav | subscribe */
}

.site-header.is-shrunk .nav-actions--left {
  display: inline-flex;
}

.site-header.is-shrunk .nav-subscribe {
  display: inline-flex;
}

/* show small brand in nav row when shrunk */
.site-header.is-shrunk .brand__logo--small img {
  display: inline-flex;
}

/* tighten nav row when shrunk */
.site-header.is-shrunk .header-navrow__inner {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 980px) {
  .header-nav .menu {
    gap: 16px;
  }
  .top-link {
    display: none;
  } /* simplify top bar on smaller screens */
}

@media (max-width: 720px) {
  .header-navrow__inner {
    grid-template-columns: auto 1fr auto;
  }
  .header-nav {
    justify-content: flex-start;
  }
  .header-nav .menu {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* =========================
   MEGA OVERLAY (SLIDE DOWN)
   ========================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.menu-open {
  overflow: hidden;
}

.mega-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;

  /* ✅ keep it in the render tree so transitions work */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 200ms ease, visibility 0s linear 200ms;
}

.mega-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transition: opacity 200ms ease, visibility 0s;
}

.mega-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0); /* THR looks mostly white; keep subtle/no dim */
}

/* Panel drops down */
.mega-overlay__panel {
  position: relative;
  background: #fff;
  border-bottom: 1px solid #e9e9e9;

  height: 100vh;
  min-height: 100vh;

  /* ✅ start hidden above the screen */
  transform: translateY(-24px);
  transition: transform 220ms ease;
}

.mega-overlay.is-open .mega-overlay__panel {
  transform: translateY(0);
}

.mega-overlay__top {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid #efefef;
}

.mega-overlay__brand a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #111;
}
.mega-overlay__brand img {
  max-height: 40px;
  width: auto;
  display: block;
}

/* Search bar */
.mega-overlay__search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid #2a64ff;
  border-radius: 2px;
  padding: 10px 12px;
}

.mega-overlay__searchicon {
  display: inline-flex;
  color: #111;
}
.mega-overlay__search input {
  width: 100%;
  border: 0;
  outline: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 800;
  text-transform: uppercase;
}

.mega-overlay__close {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  color: #c40000;
}

/* Content area */
.mega-overlay__content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 16px 28px;

  /* 👇 allow internal scrolling */
  overflow-y: auto;
  flex: 1;
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 42px;
}

/* Column heading */
.mega-heading {
  margin: 0 0 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 2px solid #111;
}

.mega-heading a {
  text-decoration: none;
  color: #111;
}

.mega-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-list li {
  margin: 10px 0;
}

.mega-list a {
  text-decoration: none;
  color: #111;
  font-size: 18px;
  line-height: 1.3;
}

.mega-overlay__footerlinks {
  margin-top: 26px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.mega-overlay__footerlinks a {
  text-decoration: none;
  color: #111;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
}

.mega-overlay__footerlinks a.is-accent {
  color: #c40000;
}

/* Responsive */
@media (max-width: 1020px) {
  .mega-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .mega-overlay__top {
    grid-template-columns: 1fr auto;
  }
  .mega-overlay__brand {
    display: none;
  }
  .mega-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 22px;
  }
}

@media (max-width: 520px) {
  .mega-grid {
    grid-template-columns: 1fr;
  }
}
