/* ==========================================================================
   Shop OnVine — "Maison Fresh" design system
   Mobile-first. Breakpoints: 640 / 768 / 1024.
   Source of truth: docs/superpowers/specs/2026-07-24-shoponvine-storefront-design.md §2
   ========================================================================== */

:root {
  /* color */
  --bg: #faf6f0;            /* page background — warm cream */
  --surface: #ffffff;       /* cards */
  --surface-alt: #f1e9dd;   /* info boxes, search pill */
  --panel: #f7ede6;         /* product image panels (blush) */
  --ink: #241d1b;           /* primary text, dark buttons */
  --muted: #6e6257;         /* body copy */
  /* meta text, placeholders. Darkened from the original #8a7d6d (Task 8.2): that value measured
     ~3.7-4.0:1 against both --bg and --surface — below WCAG AA's 4.5:1 floor for the 12-13px
     text it's actually used at (.meta/.legal/.card-meta/.drawer-item-meta/timeline labels, none
     of which qualify as WCAG "large text"). #786c5c measures ~4.76:1 on --bg / ~5.13:1 on
     --surface (both >4.5:1), while staying visibly lighter than --muted (#6e6257, body copy). */
  --faint: #786c5c;
  --line: #eee4d6;          /* hairline borders */
  --line-strong: #ddd0bd;   /* input & secondary-button borders */
  --primary: #7f1d2e;       /* burgundy — CTAs, links, accents */
  --on-primary: #fdf3ee;    /* text on burgundy */
  --success: #1d7a3f;       /* in stock, FREE */
  --gold: #b8860b;          /* stars */
  /* shape & depth */
  --r-card: 16px;  --r-panel: 18px;  --r-pill: 999px;  --r-box: 12px;
  --shadow: 0 2px 10px rgba(60,40,20,.06);
  --shadow-hover: 0 6px 18px rgba(60,40,20,.10);
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

.accent {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[x-cloak] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) {
  .container { padding: 0 24px; }
}

.section {
  padding: 40px 0;
}
@media (min-width: 1024px) {
  .section { padding: 64px 0; }
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: stretch;
}
@media (min-width: 768px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

/* ==========================================================================
   Typography scale (desktop -> mobile per spec §2.2)
   ========================================================================== */

.h-hero {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
@media (min-width: 1024px) {
  .h-hero { font-size: 56px; }
}

.h-page {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
@media (min-width: 1024px) {
  .h-page { font-size: 36px; }
}

.h-section {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
@media (min-width: 1024px) {
  .h-section { font-size: 24px; }
}

.meta { font-size: 13px; font-weight: 600; color: var(--faint); }
.legal { font-size: 12px; color: var(--faint); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, border-color 150ms ease, color 150ms ease;
  white-space: nowrap;
}
.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  background: #6a1826;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-dark {
  background: var(--ink);
  color: var(--bg);
}
.btn-dark:hover {
  background: #171211;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   Filter pills
   ========================================================================== */

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pill-row::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
  .pill-row { flex-wrap: wrap; overflow-x: visible; }
}

.pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pill-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  font-weight: 700;
}
.pill-active:hover {
  color: var(--bg);
  border-color: var(--ink);
}
.pill-staff {
  color: var(--primary);
  border-color: #e8c9c2;
}

/* ==========================================================================
   Product card
   ========================================================================== */

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-img {
  position: relative;
  background: var(--panel);
  border-radius: var(--r-panel);
  /* Task 8.2: a definite aspect-ratio (rather than the old min-height:160px, which left this
     box's actual height dependent on the <img> inside it — product photos come from three
     different sources of wildly varying native size, per shopProductImageUrl()'s fallback
     chain) is what actually reserves stable space before the image loads: min-height alone did
     NOT prevent the box (and everything below it on the page) from growing/shifting once an
     unusually large photo finished loading, since `max-height:100%` on a child of an
     auto-height flex parent resolves to no-op per CSS3 rules. object-fit:contain (below) still
     shows the whole photo, undistorted, letterboxed inside this now-fixed 1:1 box. */
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}
.card-img img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.card-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}
.card-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
  margin: 3px 0 10px;
}
.card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.card-price {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
}
.card-add {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: var(--on-primary);
  background: var(--primary);
  border: none;
  border-radius: var(--r-pill);
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}
.card-add:hover { background: #6a1826; transform: translateY(-1px); }
.card-add:disabled { opacity: 0.45; cursor: not-allowed; }

/* Badges — positioned within .card-img */
.badge-stock, .badge-low, .badge-out, .badge-pick {
  position: absolute;
  top: 10px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 11px;
  border-radius: var(--r-pill);
  padding: 4px 10px;
  white-space: nowrap;
}
.badge-stock, .badge-low, .badge-out { left: 10px; }
.badge-pick { right: 10px; }

.badge-stock { background: var(--surface); color: var(--success); }
.badge-low   { background: var(--surface); color: var(--primary); }
.badge-out   { background: var(--ink); color: var(--bg); }
.badge-pick  { background: var(--ink); color: var(--bg); }

/* ==========================================================================
   Forms
   ========================================================================== */

.label {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 6px;
}

.input {
  display: block;
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-box);
  padding: 14px;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 500;
  transition: border-color 150ms ease;
}
.input::placeholder { color: var(--faint); }
.input:focus {
  border-color: var(--primary);
  outline: none;
}

.err {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
  margin-top: 6px;
}

.infobox {
  background: var(--surface-alt);
  border-radius: var(--r-box);
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--bg);
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 9999;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Overlay + cart drawer
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 29, 27, .4);
  z-index: 90;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  z-index: 91;
  display: flex;
  flex-direction: column;
  transition: transform 150ms ease;
}
.drawer-slide-in {
  transform: translateX(0);
}
.drawer-slide-out {
  transform: translateX(100%);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 17px;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--faint);
  line-height: 1;
  padding: 4px;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.drawer-footer {
  border-top: 1px solid var(--line);
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
}

.drawer-item {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.drawer-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  gap: 8px;
}
.drawer-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  margin-top: 4px;
}

/* ==========================================================================
   Announcement bar
   ========================================================================== */

.announce {
  position: relative;
  background: var(--primary);
  color: var(--on-primary);
  text-align: center;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 40px;
}
.announce-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--on-primary);
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  opacity: 0.85;
}
.announce-close:hover { opacity: 1; }

/* ==========================================================================
   Nav
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}
.nav-brand {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.nav-brand span { color: var(--primary); }

.nav-links {
  display: none;
  align-items: center;
  gap: 22px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-pill {
  display: none;
  align-items: center;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--faint);
  background: var(--surface-alt);
  border: none;
  border-radius: var(--r-pill);
  padding: 9px 16px;
}
@media (min-width: 640px) {
  .search-pill { display: inline-flex; }
}

.nav-account-link {
  display: none;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.nav-account-link:hover { color: var(--ink); }
@media (min-width: 640px) {
  .nav-account-link { display: inline-flex; }
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--on-primary);
  background: var(--primary);
  border: none;
  border-radius: var(--r-pill);
  padding: 9px 14px;
  transition: background-color 150ms ease;
}
.cart-pill:hover { background: #6a1826; }

.nav-toggle {
  display: inline-flex;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink);
  padding: 4px 6px;
}
@media (min-width: 768px) {
  .nav-toggle { display: none; }
}

.nav-sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--bg);
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.nav-sheet-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 24px;
}
.nav-sheet-links a {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

/* ==========================================================================
   Age-gate modal
   ========================================================================== */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(36, 29, 27, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.age-gate-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-hover);
  max-width: 380px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
}
.age-gate-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 10px;
}
.age-gate-copy {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 22px;
}
.age-gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 48px 0 0;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
@media (min-width: 640px) {
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .footer-cols { grid-template-columns: repeat(4, 1fr); }
}
.footer-brand {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 10px;
}
.footer-brand span { color: #e8b4a8; }
.footer-blurb {
  font-size: 13px;
  font-weight: 500;
  color: #b3a89c;
  max-width: 260px;
}
.footer-heading {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b3a89c;
  margin-bottom: 14px;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a, .footer-links span {
  font-size: 14px;
  font-weight: 500;
  color: #ede6dd;
}
.footer-links a:hover { color: var(--bg); }
.footer-legal {
  border-top: 1px solid #3a322d;
  padding: 18px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #9c8f80;
}

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; }
.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--bg);
  flex: 0 0 auto;
}
.timeline-line {
  width: 2px;
  flex: 1;
  min-height: 24px;
  background: var(--line-strong);
}
.timeline-content { padding-bottom: 18px; }
.timeline-label {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--faint);
}
.timeline-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  margin-top: 2px;
}

.timeline-item.done .timeline-dot { background: var(--success); }
.timeline-item.done .timeline-line { background: var(--success); }
.timeline-item.done .timeline-label { color: var(--ink); }

.timeline-item.current .timeline-dot { background: var(--primary); }
.timeline-item.current .timeline-label { color: var(--primary); }

.timeline-item.future .timeline-dot {
  background: transparent;
  border: 2px solid var(--line-strong);
}
.timeline-item.future .timeline-label { color: var(--faint); }

/* ==========================================================================
   Hero (index.php)
   ========================================================================== */

.hero {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px 0;
}
@media (min-width: 1024px) {
  .hero { flex-direction: row; align-items: center; padding: 56px 0; }
}
.hero-copy { flex: 1.2; }
.hero-sub {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  max-width: 420px;
  margin: 16px 0 24px;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
}
.hero-media {
  position: relative;
  flex: 1;
  min-height: 220px;
  border-radius: var(--r-panel);
  /* Gradient stays as the loading-state fallback behind the <img> (visible briefly until it
     decodes, or if it ever fails to load) — never removed just because a real photo was added. */
  background: linear-gradient(135deg, var(--panel) 0%, var(--surface-alt) 55%, var(--line) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (min-width: 1024px) {
  .hero-media { min-height: 340px; }
}
