/* ============================================================================
   Leif List HOMEPAGE theme ("Editorial / Navy") — page-specific chrome
   ----------------------------------------------------------------------------
   Load AFTER ../styles/theme.css (which owns the design tokens, base type,
   product cards, buttons, and announcement bar). This file styles the parts
   that are unique to the homepage markup:
     • header cluster (logo · nav · centered search · icon actions · avatar)
     • category sub-nav (icon-over-label tabs, locked under the header)
     • greeting banner
     • "Good stuff, sorted" value band (navy)
     • extension CTA band + footer
     • the homepage's responsive rules

   All rules scoped under `.ed-theme` (applied to <html> by theme-boot.js), so
   flag off = original homepage.
   ============================================================================ */

/* =========================================================
   Header — white surface, bottom border. Logo + nav (left),
   centered search, icon actions + avatar (right).
   Fixed height so the category band can lock right beneath it.
   ========================================================= */
.ed-theme .ed-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  height: 68px;
  padding: 10px 24px;
  background: var(--leif-surface);
  border-bottom: 1px solid var(--leif-border);
  backdrop-filter: none;
  color: var(--leif-text);
  flex-wrap: nowrap;
}

.ed-theme .ed-header-left {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}
.ed-theme .ed-header .brand-logo {
  height: 48px;
  max-width: 220px;          /* widened for the horizontal wordmark (~4.2:1) */
  object-fit: contain;        /* never distort — letterbox within the box */
  filter: none;
}

/* Primary nav — inactive secondary, active text with a green underline. */
.ed-theme .ed-nav { display: inline-flex; align-items: center; gap: 20px; }
.ed-theme .ed-nav-link {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--leif-text-secondary);
  text-decoration: none;
  padding: 4px 0;
  white-space: nowrap;
}
.ed-theme .ed-nav-link:hover { color: var(--leif-action-clay); }
.ed-theme .ed-nav-link--active { color: var(--leif-text); }
.ed-theme .ed-nav-link--active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--leif-action-clay);
  border-radius: 2px;
}

/* Center search cell. Scope to the compact (non-expanded) state ONLY — the
   expanded search is a fixed 720px popup styled by homepage.css. */
.ed-theme .ed-header .header-search:not(.expanded) {
  grid-column: 2;
  margin: 0 auto;
  width: 100%;
  max-width: 440px;
  height: 40px;
  background: var(--leif-canvas);
  border: 1px solid var(--leif-border);
  border-radius: 10px;
}
.ed-theme .ed-header .header-search-icon { color: var(--leif-text-muted); }
.ed-theme .ed-header .header-search-input { color: var(--leif-text); font-weight: 400; }
.ed-theme .ed-header .header-search-input::placeholder { color: var(--leif-text-muted); }
.ed-theme .header-search.expanded { border-color: var(--leif-border); }
.ed-theme .header-search.expanded .header-search-submit { background: var(--leif-action-clay); }
.ed-theme .header-search.expanded .header-search-submit:hover { background: var(--leif-action-clay-dark); }
.ed-theme .header-search.expanded .header-search-cancel { color: var(--leif-action-clay); font-weight: 500; }

/* Right actions cluster */
.ed-theme .ed-actions {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Small icon buttons (feedback / help / cart) */
.ed-theme .ed-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--leif-text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.ed-theme .ed-icon-btn:hover { background: var(--leif-canvas); color: var(--leif-text); }
.ed-theme .ed-icon-btn svg { width: 22px; height: 22px; }
.ed-theme .ed-icon-btn .cart-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--leif-badge-red);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
}

/* Avatar + dropdown menu */
.ed-theme .ed-avatar-wrap { position: relative; }
.ed-theme .ed-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--leif-border);
  border-radius: 50%;
  background: var(--leif-canvas);
  color: var(--leif-text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ed-theme .ed-avatar svg { width: 22px; height: 22px; }
.ed-theme .ed-avatar:hover { border-color: var(--leif-text-muted); color: var(--leif-text); }
.ed-theme .ed-avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--leif-surface);
  border: 1px solid var(--leif-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  padding: 6px;
  display: none;
  z-index: 1200;
}
.ed-theme .ed-avatar-menu.open { display: block; }
.ed-theme .ed-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--leif-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.ed-theme .ed-menu-item:hover { background: var(--leif-canvas); }
.ed-theme .ed-menu-divider { height: 1px; background: var(--leif-border); margin: 6px 4px; }
.ed-theme .ed-menu-score .score-mode__label { font-size: 14px; color: var(--leif-text); }

/* Mobile overflow button (visible <=880px via homepage.css) recolored */
.ed-theme .mobile-menu-btn.btn-secondary { color: var(--leif-text-secondary); }
.ed-theme .mobile-menu-btn.btn-secondary:hover { color: var(--leif-text); }

/* =========================================================
   Category sub-nav — icon-over-label tabs, locked under the
   header (sticky at the header's fixed height).
   ========================================================= */
.ed-theme .category-nav {
  background: var(--leif-surface);
  border-bottom: 1px solid var(--leif-border);
  position: sticky;
  top: 68px;               /* = header height */
  z-index: 999;            /* just under the header (z-index 1000) */
}
.ed-theme .category-nav-inner { align-items: stretch; gap: 22px; }
.ed-theme .category-nav-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 12px 7px;
  color: var(--leif-text-secondary);
  font-weight: 400;
  border-bottom: 2px solid transparent;
}
.ed-theme .cat-nav-icon { width: 22px; height: 22px; color: var(--leif-text-muted); display: block; flex-shrink: 0; }
.ed-theme .cat-nav-label { font-size: 12px; line-height: 1; white-space: nowrap; }
.ed-theme .category-nav-link:hover { color: var(--leif-text); }
.ed-theme .category-nav-link:hover .cat-nav-icon { color: var(--leif-green-deep); }
.ed-theme .category-nav-link.active {
  color: var(--leif-text);
  font-weight: 500;
  border-bottom-color: var(--leif-green-deep);   /* 2px active underline (navy) */
}
.ed-theme .category-nav-link.active .cat-nav-icon { color: var(--leif-green-deep); }

/* =========================================================
   Greeting banner — neutral
   ========================================================= */
.ed-theme .greeting-banner { background: transparent; }
.ed-theme .greeting-headline { color: var(--leif-text); font-weight: 500; }
.ed-theme .greeting-subtitle { color: var(--leif-text-secondary); }

/* =========================================================
   Value band ("Good stuff, sorted") — navy band. Circles share
   ONE treatment: cream fill, navy icon, light labels.
   ========================================================= */
.ed-theme .shop-by-values-section {
  background: var(--leif-green-deep);
  border-top: none;
  border-bottom: none;
  padding: 22px 0;
}
.ed-theme .shop-by-values-header { border-left: 3px solid var(--hero-eyebrow); }
.ed-theme .shop-by-values-section .section-title { color: var(--hero-heading); font-weight: 500; }
.ed-theme .shop-by-values-section .section-subtitle { color: var(--hero-subtext); }

.ed-theme .value-chip-icon {
  background: var(--leif-surface);
  border: 1px solid var(--leif-surface);
}
.ed-theme .value-chip-icon svg { color: var(--leif-green-deep); }
.ed-theme .value-chip:hover .value-chip-icon { box-shadow: 0 8px 20px rgba(0,0,0,0.28); transform: translateY(-2px); }
.ed-theme .value-chip-label { color: var(--hero-label); font-weight: 400; }
.ed-theme .value-chip:focus-visible { outline: 2px solid var(--leif-cream); }

/* =========================================================
   Extension CTA band (above footer) — soft green-tint surface
   ========================================================= */
.ed-theme .ed-ext-cta {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--leif-action-clay-tint);
  padding: 40px 0;
}
.ed-theme .ed-ext-cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.ed-theme .ed-ext-cta-title { margin: 0 0 6px; font-size: 22px; font-weight: 500; color: var(--leif-text); }
.ed-theme .ed-ext-cta-sub { margin: 0; font-size: 15px; font-weight: 400; color: var(--leif-text-secondary); }
.ed-theme .ed-ext-cta-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--leif-action-clay);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}
.ed-theme .ed-ext-cta-btn:hover { background: var(--leif-action-clay-dark); }

/* =========================================================
   Footer — navy surface, light text, columns + bottom row
   ========================================================= */
.ed-theme .ed-footer { background: var(--leif-ink); margin-top: 0; }
.ed-theme .ed-footer-inner {
  display: flex;
  gap: 60px;
  align-items: flex-start;
  padding: 48px 40px 28px;
}
.ed-theme .ed-footer .footer-tagline { color: rgba(255,255,255,0.62); font-weight: 400; }
.ed-theme .ed-footer-columns { gap: 48px; }
.ed-theme .ed-footer .footer-col-title {
  color: #fff;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.4px;
}
.ed-theme .ed-footer .footer-links a { color: rgba(255,255,255,0.62); font-weight: 400; }
.ed-theme .ed-footer .footer-links a:hover { color: #fff; }

.ed-theme .ed-footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 18px 40px 26px; text-align: left; }
.ed-theme .ed-footer-bottom .affiliate-disclosure { color: rgba(255,255,255,0.5); font-weight: 400; }
.ed-theme .ed-footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.ed-theme .ed-copyright { color: rgba(255,255,255,0.55); font-size: 13px; margin: 0; }
.ed-theme .ed-copyright a { color: rgba(255,255,255,0.72); text-decoration: none; }
.ed-theme .ed-copyright a:hover { color: #fff; text-decoration: underline; }
.ed-theme .ed-footer-socials { display: inline-flex; gap: 10px; }
.ed-theme .ed-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  transition: background 0.15s ease, color 0.15s ease;
}
.ed-theme .ed-social:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 880px) {
  /* Keep the header ONE locked row: logo | search | hamburger. */
  .ed-theme .ed-header { grid-template-columns: auto 1fr auto; gap: 10px; padding: 8px 14px; }
  .ed-theme .ed-nav { display: none; }              /* primary nav folds into the mobile menu */
  .ed-theme .ed-header .brand-logo { height: 30px; max-width: 130px; }
  /* Boat-only mark swapped in by homepage-v2.js below 880px — size it as a
     compact square-ish icon (~1.9:1) instead of the wide wordmark box. */
  .ed-theme .ed-header .brand-logo.is-mark { height: 36px; max-width: 72px; }
  .ed-theme .ed-header-left { gap: 0; }
  .ed-theme .ed-header .header-search:not(.expanded) {
    grid-column: 2; grid-row: 1; margin: 0; max-width: none; height: 38px;
  }
  .ed-theme .ed-actions { grid-column: 3; grid-row: 1; }
  .ed-theme .ed-avatar-wrap,
  .ed-theme .ed-icon-btn { display: none; }         /* fold into mobile menu */
  .ed-theme .mobile-menu-wrap { display: block; }   /* reveal hamburger across the whole ≤880 range (not just ≤640) */
  .ed-theme .ed-ext-cta-inner { padding: 0 20px; }
  .ed-theme .ed-footer-inner { flex-direction: column; gap: 28px; padding: 32px 20px 24px; }

  /* "Good stuff, sorted" circles — base mobile CSS blows them up to 76px. */
  .ed-theme .shop-by-values-section { padding: 14px 0; }
  .ed-theme .shop-by-values-section .value-chip-icon { width: 52px; height: 52px; }
  .ed-theme .shop-by-values-section .value-chip-icon svg { width: 24px; height: 24px; }
  .ed-theme .shop-by-values-section .value-chip-label { font-size: 11px; max-width: 74px; }
}
