/* ============================================================================
   header-premium.css
   Refined site header + mega menu. Layered on top of site.css without replacing
   existing rules — overrides where needed.
   ============================================================================ */

/* ── Top bar: tighter, subtle, scan-only ─────────────────────────────────── */
.site-header .header-top-bar {
  background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  letter-spacing: 0.2px;
}
.site-header .header-top-bar__inner {
  padding: 8px 0;
  gap: 16px;
  justify-content: center;
}
.site-header .header-top-bar__item {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
  padding: 0 2px;
}
.site-header .header-top-bar__item:hover {
  color: #ffffff;
  text-decoration: none;
}
.site-header .header-top-bar__sep {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 400;
}

/* ── Main bar: cleaner depth, taller breathing room ──────────────────────── */
.site-header .header-main {
  background: #ffffff;
  border-bottom: 1px solid #eef2f6;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.site-header .header-main__inner {
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
/* Nav also capped to 1200 via .container, so both bands align on same grid. */

/* ── Logo: breathing room + crisp rendering ──────────────────────────────── */
.site-header .header-logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.site-header .header-logo .logo-img--wordmark {
  height: 46px;
  width: auto;
  display: inline-block;
}
.site-header .header-logo .logo-img--mark {
  height: 46px;
  width: auto;
  display: none;
}
@media (max-width: 767px) {
  .site-header .header-logo .logo-img--wordmark { display: none; }
  .site-header .header-logo .logo-img--mark {
    display: inline-block;
    height: 34px;
  }
}

/* Sidebar drawer: show only the mark, not both (wordmark was rendering
   next to the mark, making the drawer header look cluttered). */
.sidebar__logo .logo-img--wordmark { display: none; }
.sidebar__logo .logo-img--mark {
  display: inline-block;
  height: 40px;
  width: auto;
}

/* ── Search: larger, pill shape, subtle focus ring ───────────────────────── */
.site-header .search {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}
.site-header .search__input {
  width: 100%;
  height: 48px;
  padding: 0 52px 0 22px;
  border-radius: 24px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.site-header .search__input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}
.site-header .search__input:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}
.site-header .search__input:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.site-header .search__button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.site-header .search__button:hover {
  background: #1d4ed8;
  transform: translateY(-50%) scale(1.05);
}
.site-header .search__clear {
  right: 52px;
}

/* ── Action icons: grouped with subtle divider ───────────────────────────── */
.site-header .header-actions {
  gap: 4px;
  align-items: center;
}
.site-header .header-action {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  transition: background 0.15s ease, color 0.15s ease;
}
.site-header .header-action:hover {
  background: #f1f5f9;
  color: var(--primary, #2563eb);
}
.site-header .header-action--cart .header-action__badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 6px -1px rgba(16, 185, 129, 0.4);
}

/* ── Main nav: confident, refined, hairline separators ──────────────────── */
.site-header .header-nav {
  background: #ffffff;
  border-top: 1px solid #eef2f6;
  border-bottom: 1px solid #eef2f6;
}
.site-header .header-nav__inner {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  flex-wrap: nowrap;
  overflow: visible;
  scrollbar-width: none;
  height: 49px;
  min-height: 49px;
}
@media (max-width: 1023px) {
  .site-header .header-nav__inner {
    overflow-x: auto;
    overflow-y: hidden;
  }
}
.site-header .header-nav__inner::-webkit-scrollbar { display: none; }

.site-header .header-nav__item {
  position: relative;
  flex: 0 0 auto;
}
.site-header .header-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 14px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.site-header .header-nav__link:hover,
.site-header .header-nav__item:hover > .header-nav__link {
  color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.03);
}
.site-header .header-nav__link[aria-current="page"] {
  color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
}
.site-header .header-nav__chev {
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.15s ease;
}
.site-header .header-nav__item:hover .header-nav__chev {
  opacity: 1;
  transform: rotate(180deg);
}
.site-header .header-nav__link--cta {
  margin-left: auto;
  padding: 8px 16px;
  margin-top: 6px;
  margin-bottom: 6px;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #fff !important;
  border-radius: 10px;
  border-bottom: 0;
  box-shadow: 0 2px 8px -2px rgba(16, 185, 129, 0.5);
}
.site-header .header-nav__link--cta:hover,
.site-header .header-nav__item--cta:hover > .header-nav__link--cta {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  border-bottom: 0;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.55);
}
.site-header .header-nav__item--cta { margin-left: auto; }

/* ── Megamenu ────────────────────────────────────────────────────────────── */
.site-header .header-megamenu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  min-width: 560px;
  max-width: min(760px, calc(100vw - 40px));
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.18), 0 4px 12px -4px rgba(15, 23, 42, 0.06);
  padding: 20px 22px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}
.site-header .header-megamenu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 24px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-right: 0;
  border-bottom: 0;
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

/* Right-align megamenu for categories near the right edge of the nav so it
   never overflows the viewport. Applies to the last 2 has-menu items.      */
.site-header .header-nav__item--has-menu:nth-last-of-type(-n+2) .header-megamenu {
  left: auto;
  right: 0;
}
.site-header .header-nav__item--has-menu:nth-last-of-type(-n+2) .header-megamenu::before {
  left: auto;
  right: 24px;
}
.site-header .header-nav__item--has-menu:hover .header-megamenu,
.site-header .header-nav__item--has-menu:focus-within .header-megamenu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Invisible hover bridge so the dropdown doesn't flicker between link and menu */
.site-header .header-nav__item--has-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 8px;
}

/* Keep menu visible as long as the cursor is over the item */
.site-header .header-megamenu__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.site-header .header-megamenu__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 16px;
}
.site-header .header-megamenu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #334155;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.site-header .header-megamenu__link:hover {
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary, #2563eb);
  text-decoration: none;
  transform: translateX(2px);
}
.site-header .header-megamenu__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header .header-megamenu__count {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.site-header .header-megamenu__link:hover .header-megamenu__count {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
}
.site-header .header-megamenu__all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.site-header .header-megamenu__all:hover {
  background: rgba(37, 99, 235, 0.12);
  text-decoration: none;
  transform: translateX(2px);
}

/* Mobile: megamenu stays hidden — the sidebar drawer handles mobile navigation. */
@media (max-width: 1023px) {
  .site-header .header-megamenu { display: none !important; }
  .site-header .header-nav__item:hover .header-nav__chev { transform: none; }
}

/* Promo banner: slim, subtle. Replaces the heavy green bar with a quiet
   info strip that doesn't compete with the refined header above.         */
.site-header .promo-banner {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e5e7eb;
}
.site-header .promo-banner__inner {
  padding: 6px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.site-header .promo-banner__text {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  letter-spacing: 0.1px;
}
/* Highlight the verb keywords so the strip still feels branded */
.site-header .promo-banner__text strong,
.site-header .promo-banner__text b {
  color: #0f172a;
  font-weight: 700;
}
.site-header .promo-banner__close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  right: 12px;
}
.site-header .promo-banner__close:hover {
  background: #e5e7eb;
  color: #334155;
  border-color: #cbd5e1;
  transform: translateY(-50%);
}
