/* Nordhaus-inspired theme: warm neutral palette, editorial serif headlines, minimal chrome.
   Loaded after the legacy stylesheets on every page so it can cleanly override the old header/hero rules
   without having to touch the (larger, functional) browse/product-detail CSS underneath. */

:root {
  --bg: #f6f2ea;
  --surface: #ffffff;
  --ink: #211d17;
  --muted: #837a6c;
  --line: #e6ddcd;
  --accent: #1c1a17;
  --accent-soft: #ece4d4;
  --serif: "Playfair Display", serif;
  --sans: "DM Sans", sans-serif;
}

body { background: var(--bg); color: var(--ink); font-family: var(--sans); }
a { color: inherit; }

/* ---------- header ---------- */
.announcement { background: var(--accent); }

.site-header {
  background: var(--bg) !important;
  border-bottom: 1px solid var(--line) !important;
  min-height: 74px;
}
.brand, .brand-word { color: var(--ink) !important; }
.brand-word span { color: var(--muted) !important; }
.brand small { color: var(--muted) !important; }

.header-search, .product-search {
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  background: var(--surface) !important;
}
.header-search button, .product-search button {
  background: var(--accent) !important;
  color: var(--bg) !important;
}

.header-actions a, .compare-trigger, .deal-link {
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.compare-trigger { background: var(--surface) !important; border-radius: 999px !important; }

/* category row: one item per Level-1 category, each revealing a Level-2 dropdown on hover/focus */
.category-nav, .retail-nav {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--line) !important;
  justify-content: center !important;
  gap: 30px !important;
  padding: 0 24px !important;
  min-height: 50px !important;
  /* the base stylesheet sets overflow-x:auto for mobile scrolling, but that has a CSS side effect of also
     clipping overflow-y - which silently hid the dropdown below it. Desktop doesn't need the scroll (all
     10 items fit on one line), so only re-enable it inside the mobile breakpoint further down. */
  overflow: visible !important;
}
.nav-item { position: relative; display: flex; align-items: center; height: 50px; }
.nav-l1 {
  /* overrides a legacy rule (".retail-nav a:first-child") from the old hardcoded nav that was meant to
     highlight just its one "Top deals" pill - but ":first-child" matches ANY link that's the first child
     of its own parent, which every .nav-l1 now is (its parent is its own .nav-item wrapper) */
  background: none !important; border-radius: 0 !important; padding: 6px 2px !important;
  text-decoration: none; color: var(--ink) !important; font-size: 13px; font-weight: 600;
  letter-spacing: .01em; white-space: nowrap;
}
.nav-item:hover .nav-l1, .nav-item:focus-within .nav-l1 { color: var(--muted) !important; }
.nav-dropdown {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(4px);
  min-width: 230px; max-width: 280px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 22px 44px rgba(33, 29, 23, .14); padding: 8px; margin-top: 6px;
  display: grid; gap: 1px; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease; z-index: 60;
}
.nav-item:hover .nav-dropdown, .nav-item:focus-within .nav-dropdown {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
/* the first/last items sit too close to the viewport edge for a centered dropdown to fit - anchor those two
   to their own left/right edge instead so they never get clipped off-screen */
.nav-item:first-child .nav-dropdown { left: 0; transform: translateY(4px); }
.nav-item:first-child:hover .nav-dropdown, .nav-item:first-child:focus-within .nav-dropdown { transform: translateY(0); }
.nav-item:last-child .nav-dropdown { left: auto; right: 0; transform: translateY(4px); }
.nav-item:last-child:hover .nav-dropdown, .nav-item:last-child:focus-within .nav-dropdown { transform: translateY(0); }
.nav-dropdown a {
  display: block; padding: 9px 12px; border-radius: 6px; color: var(--muted);
  text-decoration: none; font-size: 13px; white-space: nowrap;
}
.nav-dropdown a:hover { background: var(--bg); color: var(--ink); }

/* ---------- homepage hero ---------- */
.hero-banner {
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 48px;
  padding: clamp(48px, 7vw, 96px) max(6vw, 28px); background: var(--bg);
}
.hero-copy p.eyebrow-serif {
  margin: 0 0 14px; text-transform: uppercase; letter-spacing: .16em; font-size: 11px;
  font-weight: 700; color: var(--muted);
}
.hero-banner h1 {
  font: 500 clamp(40px, 5.2vw, 68px)/1.05 var(--serif); letter-spacing: -.01em; margin: 0 0 20px; color: var(--ink);
}
.hero-banner p.hero-sub { max-width: 420px; margin: 0 0 30px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.btn-dark {
  display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: var(--bg);
  border: 0; border-radius: 6px; padding: 14px 22px; font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn-dark:hover { background: #35312a; }
.hero-photo {
  position: relative; aspect-ratio: 1.15; border-radius: 18px; overflow: hidden; background: var(--accent-soft);
  display: grid; place-items: center;
}
.hero-photo img { width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 30px 40px rgba(33,29,23,.18)); }
.hero-photo .hero-badge {
  position: absolute; right: 22px; top: 22px; width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-content: center; background: var(--accent); color: var(--bg); text-align: center;
  font-size: 20px; font-weight: 700; transform: rotate(6deg);
}
.hero-photo .hero-badge small { display: block; font-size: 9px; letter-spacing: .08em; font-weight: 500; }

/* ---------- shared section heading (existing .section-head markup, restyled) ---------- */
.section-head p, .theme-head p.kicker {
  margin: 0 0 8px !important; text-transform: uppercase; letter-spacing: .14em; font-size: 11px !important;
  font-weight: 700 !important; color: var(--muted) !important;
}
.section-head h2, .theme-head h2 {
  margin: 0; font: 500 clamp(26px, 3vw, 38px)/1.1 var(--serif) !important; color: var(--ink) !important;
  letter-spacing: -.01em !important;
}
.section-head > a { font-size: 13px; font-weight: 600; color: var(--ink) !important; text-decoration: underline; text-underline-offset: 5px; }
.category-section { background: var(--bg) !important; }
.category-image { background: var(--accent-soft) !important; border-radius: 12px !important; }

/* Featured collection - reuse the existing deal-card/deal-grid DOM/JS, restyled to match the reference cards */
.deals-section { background: var(--bg) !important; }
.deal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 22px !important; }
.deal-card {
  background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: 4px !important;
  box-shadow: none !important;
}
.deal-image { background: var(--accent-soft) !important; aspect-ratio: 1.05 !important; }
.discount { background: var(--accent) !important; border-radius: 3px !important; }
.deal-meta span:last-child { display: none; } /* store name: keep the layout closer to the reference's "Living Room"-style caption */
.deal-body h3 { font: 500 15px/1.4 var(--sans) !important; }
.prices strong { font: 500 16px var(--sans) !important; }
.view-deal { color: var(--ink) !important; font-weight: 600 !important; }
.view-all { border-color: var(--ink) !important; color: var(--ink) !important; border-radius: 999px !important; }

/* secondary full-width banner (dark background, so its CTA needs the light/inverted button) */
.banner-strip {
  position: relative; margin: 0 max(4vw, 28px) 64px; border-radius: 18px; overflow: hidden;
  min-height: 300px; display: flex; align-items: center; background: var(--accent);
}
.banner-strip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.banner-copy { position: relative; z-index: 1; padding: clamp(28px, 5vw, 56px); color: var(--bg); max-width: 480px; }
.banner-copy p.kicker { margin: 0 0 14px; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; color: #d8d2c4; }
.banner-copy h2 { margin: 0 0 16px; font: 500 clamp(28px, 3.4vw, 42px)/1.12 var(--serif); }
.banner-copy .btn-dark { background: var(--bg); color: var(--accent); }
.banner-copy .btn-dark:hover { background: #fff; }

.why-section { background: var(--accent) !important; }
footer { background: var(--accent) !important; }

@media (max-width: 900px) {
  .hero-banner { grid-template-columns: 1fr; }
  .deal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .category-nav, .retail-nav { justify-content: flex-start !important; overflow-x: auto !important; }
  /* touch devices have no real hover, so the dropdown would otherwise be unreachable - tapping an L1
     item goes straight to that category's browse page instead, same as before this dropdown existed */
  .nav-dropdown { display: none !important; }
}

/* ===================================================================================
   Browse page (search hero, filters, results grid)
   =================================================================================== */
.search-stage {
  background: var(--bg) !important; color: var(--ink) !important; overflow: visible !important;
}
.search-stage::after { display: none !important; }
.search-stage .eyebrow {
  color: var(--muted) !important; text-transform: uppercase; letter-spacing: .14em; font-size: 11px !important; font-weight: 700 !important;
}
.search-stage h1 { font: 500 clamp(34px, 4.4vw, 54px)/1.08 var(--serif) !important; color: var(--ink) !important; }
.search-stage h1 span { color: var(--muted) !important; }
.search-box {
  border: 1px solid var(--line) !important; border-radius: 999px !important; box-shadow: none !important; background: var(--surface) !important;
}
.search-box svg { stroke: var(--muted) !important; }
.search-box button { background: var(--accent) !important; color: var(--bg) !important; border-radius: 999px !important; }
.quick-searches { color: var(--muted) !important; }
.quick-searches button { border-color: var(--line) !important; color: var(--ink) !important; background: var(--surface) !important; }

.browse-shell { background: var(--bg); }
.section-heading p, .section-heading h2 { font-family: var(--sans) !important; }
.section-heading p { color: var(--muted) !important; text-transform: uppercase; letter-spacing: .1em; font-size: 11px !important; font-weight: 700 !important; }
.section-heading h2 { font: 500 clamp(22px, 2.6vw, 30px)/1.15 var(--serif) !important; color: var(--ink) !important; }
.filter-toggle, .filters {
  background: var(--surface) !important; border-color: var(--line) !important; border-radius: 10px !important;
}
.filter-top button { color: var(--ink) !important; }
.filter-field select, .price-row label, .sort-row select {
  border-color: var(--line) !important; border-radius: 8px !important; outline-color: var(--accent) !important;
}
.checkbox-row input { accent-color: var(--accent) !important; }
.filter-pill { background: var(--accent-soft) !important; color: var(--ink) !important; border-radius: 999px !important; }

.product-card {
  border-color: var(--line) !important; border-radius: 4px !important; box-shadow: none !important;
}
.product-image { background: var(--accent-soft) !important; }
.variant-count { color: var(--ink) !important; }
.product-card h3 { font: 500 15px/1.4 var(--sans) !important; }
.price { font: 500 16px var(--sans) !important; }
.card-actions .view-button { background: var(--accent) !important; border-color: var(--accent) !important; }
.card-actions .selected { background: var(--accent-soft) !important; border-color: var(--ink) !important; color: var(--ink) !important; }
.load-more { border-color: var(--ink) !important; color: var(--ink) !important; border-radius: 999px !important; }
.empty-state { background: var(--surface) !important; border-color: var(--line) !important; }

/* ===================================================================================
   Product detail page
   =================================================================================== */
.product-page { border-color: var(--line) !important; background: var(--surface) !important; }
.detail-gallery, .detail-image { background: var(--accent-soft) !important; }
.gallery-arrow { border-color: var(--line) !important; background: rgba(255,255,255,.95) !important; color: var(--ink) !important; }
.variant-thumb.active { border-color: var(--ink) !important; }
.detail-copy .store { color: var(--muted) !important; text-transform: uppercase; letter-spacing: .1em; font-size: 11px !important; font-weight: 700 !important; }
.detail-copy h2 { font: 500 clamp(26px, 3vw, 36px)/1.12 var(--serif) !important; color: var(--ink) !important; }
.detail-price { font-family: var(--sans) !important; }
.retailer-link { background: var(--accent) !important; border-radius: 8px !important; }
.similar-wrap { background: var(--bg) !important; }
.similar-wrap h3 { font: 500 22px var(--serif) !important; color: var(--ink) !important; }
.similar-item { border-color: var(--line) !important; }
.similar-item span { color: var(--muted) !important; }
.variant-chip.active { border-color: var(--ink) !important; box-shadow: 0 0 0 1px var(--ink) !important; background: var(--accent-soft) !important; }
.crumbs a { color: var(--ink) !important; }

.compare-dialog .compare-head h2 { font: 500 26px var(--serif) !important; }
.compare-table a { color: var(--ink) !important; }

/* size / colour cards: which size and colour this card shows */
.card-variant { margin: -4px 0 10px; font-size: 13px; font-weight: 500; color: var(--ink); }
.option-group { margin: 0 0 14px; }
.option-group > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.variant-chip.sold-out { opacity: .55; }
.variant-chip.sold-out small { color: var(--ink) !important; font-weight: 500; }
