/* ==========================================================================
   Ember & Oud — Design System
   Spicy skeuomorphism: deep wine + gold foil + glass + leather + glow.
   ========================================================================== */

:root {
  /* palette */
  --wine-950: #1a0508;
  --wine-900: #2b0910;
  --wine-800: #3d0e16;
  --wine-700: #591420;
  --crimson-600: #b3122a;
  --crimson-500: #d81b3f;
  --ember-500: #ff5a36;
  --gold-300: #f4d78a;
  --gold-400: #e8b559;
  --gold-500: #cf9a3a;
  --gold-700: #9a7226;
  --cream-50: #fdf8ee;
  --cream-100: #faf1de;
  --cream-200: #f3e6c9;
  --ink-900: #1c1210;
  --ink-700: #3a2a25;
  --ink-500: #6b564e;

  --shadow-deep: 0 30px 60px -20px rgba(0,0,0,0.55);
  --shadow-soft: 0 12px 30px -12px rgba(59,10,20,0.35);
  --shadow-lift: 0 2px 0 rgba(255,255,255,0.5) inset, 0 -2px 8px rgba(0,0,0,0.15) inset;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Jost', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(207,154,58,0.10), transparent 60%),
    linear-gradient(180deg, var(--cream-50), var(--cream-100));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--wine-900);
  margin: 0;
  line-height: 1.1;
}

/* ==========================================================================
   Buttons — glossy, embossed, pressable
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease;
  position: relative;
}

.btn-gold {
  color: var(--wine-950);
  background: linear-gradient(180deg, var(--gold-300) 0%, var(--gold-400) 45%, var(--gold-500) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 -3px 6px rgba(154,114,38,0.55) inset,
    0 14px 24px -10px rgba(154,114,38,0.65);
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}
.btn-gold:hover { filter: brightness(1.05); transform: translateY(-2px); }
.btn-gold:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 -1px 3px rgba(154,114,38,0.5) inset,
    0 4px 10px -6px rgba(154,114,38,0.6);
}

.btn-ghost {
  color: var(--wine-800);
  background: transparent;
  border: 1.5px solid rgba(89,20,32,0.25);
}
.btn-ghost:hover { background: rgba(89,20,32,0.06); }

.btn-block { width: 100%; margin-top: 10px; }

.btn[disabled] { opacity: 0.6; pointer-events: none; }

.btn-spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(26,5,8,0.25);
  border-top-color: var(--wine-950);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Header — dark leather bar
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.12)),
    linear-gradient(160deg, var(--wine-900) 0%, var(--wine-950) 100%);
  box-shadow: 0 12px 30px -14px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.06) inset;
  border-bottom: 1px solid rgba(232,181,89,0.25);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--cream-100);
}
.brand-mark { color: var(--gold-400); text-shadow: 0 0 12px rgba(232,181,89,0.6); }
.brand-name em { font-style: normal; color: var(--gold-400); }

.main-nav { display: flex; gap: 28px; }
.main-nav a {
  color: rgba(250,241,222,0.8);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
}
.main-nav a:hover { color: var(--gold-300); }
.main-nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--gold-400); transition: width 0.2s ease;
}
.main-nav a:hover::after { width: 100%; }

.cart-toggle {
  position: relative;
  background: linear-gradient(180deg, #6b1a28, #4a0e18);
  border: 1px solid rgba(232,181,89,0.35);
  border-radius: 12px;
  width: 44px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.08) inset;
}
.cart-bag {
  position: relative;
  width: 18px; height: 15px;
  background: var(--gold-300);
  border-radius: 2px 2px 4px 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.cart-bag-handle {
  position: absolute; top: -7px; left: 3px;
  width: 10px; height: 8px;
  border: 2px solid var(--gold-300);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.cart-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--crimson-500);
  color: white;
  font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  padding: 100px 24px 70px;
  text-align: center;
  overflow: hidden;
  background: var(--wine-950);
}

/* rotating background photography */
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.12);
  transition: opacity 1.6s ease, transform 6s ease;
}
.hero-bg-slide.active { opacity: 1; transform: scale(1); }

.hero-bg-overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(700px 380px at 50% 0%, rgba(216,27,63,0.22), transparent 65%),
    linear-gradient(180deg, rgba(26,5,8,0.72) 0%, rgba(26,5,8,0.58) 45%, rgba(26,5,8,0.82) 78%, var(--cream-50) 100%);
}

.hero-glow {
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 500px;
  background: radial-gradient(circle, rgba(232,181,89,0.35), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 2;
}
.hero-content { position: relative; z-index: 2; max-width: 680px; margin: 0 auto; }
.hero-kicker {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.75rem;
  color: var(--gold-300); font-weight: 600; margin: 0 0 18px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 600;
  color: var(--cream-50);
  text-shadow: 0 4px 24px rgba(0,0,0,0.45);
}
.hero-sub {
  margin: 22px auto 32px;
  max-width: 480px;
  color: rgba(250,241,222,0.82);
  font-size: 1.02rem;
  line-height: 1.6;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

/* search bar — a glossy inset pill. .hero-search sits on the dark hero;
   .shop-search is the same shape on marketplace.html's light shop header. */
.hero-search,
.shop-search {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 460px;
  background: rgba(253,248,238,0.94);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35) inset,
    0 10px 24px -10px rgba(0,0,0,0.5);
  border: 1px solid rgba(232,181,89,0.3);
}
.hero-search { margin: 0 auto 26px; }
.shop-search { margin: 0; flex: 1 1 320px; }

.hero-search-icon { color: var(--gold-700); font-size: 1rem; transform: scaleX(-1); }
.hero-search input,
.shop-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 8px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink-900);
  outline: none;
}
.hero-search input::placeholder,
.shop-search input::placeholder { color: var(--ink-500); }
.hero-search-btn {
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--wine-950);
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  box-shadow: var(--shadow-lift);
  flex-shrink: 0;
  transition: filter 0.15s ease, transform 0.12s ease;
}
.hero-search-btn:hover { filter: brightness(1.05); }
.hero-search-btn:active { transform: scale(0.97); }

@media (max-width: 520px) {
  .hero-search, .shop-search { padding: 6px 6px 6px 14px; }
  .hero-search-btn { padding: 11px 16px; font-size: 0.8rem; }
}

/* search results notice, above the product grid */
.search-notice {
  text-align: center;
  color: var(--ink-500);
  font-size: 0.9rem;
  margin: 0 0 24px;
}
#clearSearchBtn {
  background: none; border: none;
  color: var(--crimson-600);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: underline;
}

/* shop header — title + search, above the filter chips on marketplace.html */
.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 44px 0 30px;
}
.shop-header h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

/* ==========================================================================
   Spotlight section — bottles on a glass shelf, its own section below the hero
   ========================================================================== */

.spotlight-section {
  padding: 60px 0 20px;
  text-align: center;
}
.spotlight-kicker {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.75rem;
  color: var(--gold-700); font-weight: 600; margin: 0 0 8px;
}
.spotlight-title {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin-bottom: 30px;
}

.hero-carousel {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 56px;
}

.hero-carousel-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: var(--radius-lg);
}
.hero-carousel-viewport::-webkit-scrollbar { display: none; }

.hero-carousel-track {
  display: flex;
  gap: 18px;
  padding: 6px 6px 26px;
}

.hc-slide {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 200px;
  cursor: pointer;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffdf8, var(--cream-100));
  border: 1px solid rgba(89,20,32,0.08);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}
.hc-slide:hover { transform: translateY(-6px); box-shadow: var(--shadow-deep); }

.hc-media {
  position: relative;
  aspect-ratio: 1/1;
  background:
    radial-gradient(120% 100% at 30% 0%, #fff, var(--cream-200));
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.hc-media img {
  width: 68%; height: 74%; object-fit: contain;
  filter: drop-shadow(0 16px 12px rgba(59,10,20,0.25));
  transition: transform 0.35s ease;
}
.hc-slide:hover .hc-media img { transform: scale(1.06) translateY(-4px); }

/* glass-shelf reflection under the bottle */
.hc-media::before {
  content: '';
  position: absolute; left: 8%; right: 8%; bottom: 0; height: 30%;
  background: linear-gradient(180deg, rgba(207,154,58,0.16), transparent 80%);
  border-radius: 50%;
  filter: blur(2px);
  transform: scaleY(-0.35) translateY(46%);
  opacity: 0.5;
  pointer-events: none;
}
.hc-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0.55) 0%, transparent 28%);
  pointer-events: none;
}

.hc-info { padding: 12px 14px 15px; }
.hc-brand { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-700); font-weight: 600; }
.hc-name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  color: var(--wine-950); margin: 3px 0 6px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.hc-price { font-family: var(--font-display); font-weight: 700; color: var(--wine-800); font-size: 0.95rem; }

.hc-skeleton {
  flex: 0 0 auto; width: 200px; aspect-ratio: 3/4;
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, var(--cream-100) 30%, var(--cream-200) 50%, var(--cream-100) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.hc-arrow {
  position: absolute; top: 44%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  color: var(--wine-950); font-size: 1.3rem; font-weight: 700;
  box-shadow: var(--shadow-lift), 0 10px 20px -8px rgba(154,114,38,0.6);
  z-index: 2;
  transition: transform 0.15s ease;
}
.hc-arrow:hover { transform: translateY(-50%) scale(1.08); }
.hc-arrow:active { transform: translateY(-50%) scale(0.95); }
.hc-prev { left: 0; }
.hc-next { right: 0; }

.hc-dots { display: flex; justify-content: center; gap: 7px; margin-top: 4px; }
.hc-dot {
  width: 7px; height: 7px; border-radius: 50%; border: none;
  background: rgba(89,20,32,0.2);
  transition: all 0.2s ease;
}
.hc-dot.active { background: var(--gold-500); width: 20px; border-radius: 4px; }

@media (max-width: 640px) {
  .hero-carousel { padding: 0 40px; }
  .hc-slide, .hc-skeleton { width: 150px; }
}

/* ==========================================================================
   Views / funnel routing
   ========================================================================== */

.view { display: none; padding: 0 24px 80px; max-width: 1180px; margin: 0 auto; }
.view.active { display: block; animation: viewIn 0.35s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.back-link {
  background: none; border: none; color: var(--wine-700);
  font-size: 0.9rem; font-weight: 600; padding: 24px 0 10px;
  display: inline-flex; align-items: center; gap: 6px;
}
.back-link:hover { color: var(--crimson-600); }

/* ==========================================================================
   Filter chips
   ========================================================================== */

.shop-strip {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 6px 0 20px;
}
.price-strip {
  padding-top: 0;
  padding-bottom: 36px;
  align-items: center;
}
.filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-700);
  margin-right: 4px;
}
.price-range-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 16px 36px;
  max-width: 480px;
  margin: 0 auto;
}
.price-range-wrapper .filter-label {
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--wine-900);
  margin-right: 0;
}
.price-range-wrapper strong {
  color: var(--gold-700);
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.price-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(89,20,32,0.18);
  outline: none;
  cursor: pointer;
}
.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.price-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.price-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
}
.chip--sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}
.chip {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(89,20,32,0.18);
  background: var(--cream-50);
  color: var(--ink-700);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--gold-500); color: var(--wine-800); }
.chip.active {
  background: linear-gradient(180deg, var(--wine-800), var(--wine-900));
  color: var(--gold-300);
  border-color: var(--wine-900);
  box-shadow: 0 6px 14px -6px rgba(59,10,20,0.5);
}

/* ==========================================================================
   Product grid + cards (glass bottle framing)
   ========================================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}

.product-card {
  background: linear-gradient(180deg, #fffdf8, var(--cream-100));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(89,20,32,0.08);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-deep); }

.product-media {
  position: relative;
  aspect-ratio: 1 / 1.05;
  background: radial-gradient(120% 100% at 30% 0%, #fff, var(--cream-200));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-media img {
  width: 78%; height: 78%; object-fit: contain;
  filter: drop-shadow(0 20px 18px rgba(59,10,20,0.22));
  transition: transform 0.35s ease;
}
.product-card:hover .product-media img { transform: scale(1.05) translateY(-4px); }
.product-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0.5) 0%, transparent 30%);
  pointer-events: none;
}

.badge {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 12px 6px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 6px 6px 6px 0;
  color: var(--cream-50);
  background: linear-gradient(180deg, var(--crimson-500), var(--crimson-600));
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}
.badge::after {
  content: ''; position: absolute; left: 0; bottom: -6px;
  border-width: 6px 0 0 0; border-style: solid;
  border-color: var(--wine-950) transparent transparent transparent;
  filter: brightness(0.6);
}
.badge.badge-new { background: linear-gradient(180deg, var(--gold-400), var(--gold-700)); color: var(--wine-950); }

.product-info { padding: 18px 18px 20px; }
.product-brand { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-700); font-weight: 600; }
.product-name {
  font-family: var(--font-display);
  font-size: 1.28rem; font-weight: 600;
  color: var(--wine-950);
  margin: 4px 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-meta { font-size: 0.8rem; color: var(--ink-500); margin-bottom: 10px; }
.product-price-row { display: flex; align-items: center; justify-content: space-between; }
.product-price { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--wine-800); }

.add-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  color: var(--wine-950); font-size: 1.2rem; font-weight: 700;
  box-shadow: var(--shadow-lift), 0 6px 12px -4px rgba(154,114,38,0.6);
  transition: transform 0.15s ease;
}
.add-btn:hover { transform: scale(1.08) rotate(90deg); }
.add-btn:active { transform: scale(0.94); }

.grid-skeleton { display: contents; }
.skel-card {
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, var(--cream-100) 30%, var(--cream-200) 50%, var(--cream-100) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty-state { text-align: center; color: var(--ink-500); padding: 60px 0; font-size: 1rem; }

/* ==========================================================================
   Trust strip
   ========================================================================== */

.trust-strip {
  margin-top: 70px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  background: linear-gradient(180deg, var(--wine-900), var(--wine-950));
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow-deep);
}
.trust-item { display: flex; align-items: flex-start; gap: 14px; color: var(--cream-100); font-size: 0.85rem; }
.trust-item strong { color: var(--gold-300); font-family: var(--font-display); font-size: 1rem; }
.trust-icon { font-size: 1.3rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }

/* ==========================================================================
   Product detail view
   ========================================================================== */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: flex-start;
}
@media (max-width: 780px) { .product-detail { grid-template-columns: 1fr; } }

.pd-media {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 100% at 30% 10%, #fff, var(--cream-200));
  box-shadow: var(--shadow-deep);
  padding: 40px;
  display: flex; align-items: center; justify-content: center;
  min-height: 380px;
}
.pd-media img { max-height: 420px; filter: drop-shadow(0 30px 24px rgba(59,10,20,0.25)); }

.pd-brand { color: var(--gold-700); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; font-size: 0.8rem; }
.pd-name { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 8px 0 14px; }
.pd-price { font-family: var(--font-display); font-size: 1.6rem; color: var(--wine-800); font-weight: 700; margin-bottom: 18px; }
.pd-desc { color: var(--ink-500); line-height: 1.7; margin-bottom: 24px; }

.pd-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.tag {
  padding: 6px 14px; border-radius: 999px; font-size: 0.78rem;
  background: var(--cream-200); color: var(--ink-700); border: 1px solid rgba(89,20,32,0.1);
}

.qty-row { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.qty-stepper {
  display: flex; align-items: center;
  border-radius: 999px;
  background: var(--cream-200);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.qty-stepper button {
  width: 38px; height: 38px; border: none; background: transparent;
  font-size: 1.1rem; color: var(--wine-800); font-weight: 700;
}
.qty-stepper span { width: 32px; text-align: center; font-weight: 600; }

/* ==========================================================================
   Funnel panel (cart / checkout / success)
   ========================================================================== */

.funnel-panel {
  max-width: 620px; margin: 30px auto 0;
  background: linear-gradient(180deg, #fffdf9, var(--cream-100));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(89,20,32,0.08);
  box-shadow: var(--shadow-deep);
  padding: 36px;
}
.funnel-panel--wide { max-width: 920px; }
.funnel-title { font-size: 1.9rem; margin-bottom: 22px; }

.cart-items { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.cart-item {
  display: grid; grid-template-columns: 66px 1fr auto; gap: 14px; align-items: center;
  padding: 12px; border-radius: var(--radius-md);
  background: var(--cream-50);
  border: 1px solid rgba(89,20,32,0.06);
}
.cart-item img {
  width: 66px; height: 66px; object-fit: contain;
  background: var(--cream-200); border-radius: var(--radius-sm); padding: 6px;
}
.cart-item-name { font-weight: 600; color: var(--wine-950); font-size: 0.92rem; }
.cart-item-meta { font-size: 0.78rem; color: var(--ink-500); margin-top: 2px; }
.cart-item-controls { display: flex; align-items: center; gap: 10px; }
.cart-item-controls .qty-stepper button { width: 28px; height: 28px; font-size: 0.95rem; }
.cart-item-remove { background: none; border: none; color: var(--crimson-600); font-size: 0.78rem; font-weight: 600; margin-top: 6px; }
.cart-item-price { font-weight: 700; color: var(--wine-800); text-align: right; }

.summary-row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--ink-700); font-size: 0.92rem; }
.summary-total { font-weight: 700; color: var(--wine-950); font-size: 1.1rem; border-top: 1px dashed rgba(89,20,32,0.2); margin-top: 6px; padding-top: 14px; }
.cart-summary { border-top: 1px solid rgba(89,20,32,0.1); margin-top: 10px; padding-top: 16px; }

/* checkout */
.checkout-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; }
@media (max-width: 780px) { .checkout-grid { grid-template-columns: 1fr; } }

.checkout-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--ink-700); font-weight: 600; }
.field em { color: var(--ink-500); font-weight: 400; font-style: normal; }
.field input, .field textarea {
  font-family: var(--font-body);
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(89,20,32,0.15);
  background: var(--cream-50);
  font-size: 0.95rem;
  color: var(--ink-900);
  box-shadow: 0 2px 4px rgba(89,20,32,0.04) inset;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(232,181,89,0.25);
}
.field textarea { resize: vertical; min-height: 64px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-error {
  color: var(--crimson-600); background: rgba(216,27,63,0.08);
  border: 1px solid rgba(216,27,63,0.25); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 0.85rem; margin: 4px 0 0;
}

.order-review {
  background: var(--cream-200);
  border-radius: var(--radius-md);
  padding: 22px;
  height: fit-content;
}
.order-review h3 { font-size: 1.1rem; margin-bottom: 14px; }
.review-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.review-item { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--ink-700); }
.review-item span:first-child { max-width: 70%; }

/* success */
.success-panel { text-align: center; }
.success-seal {
  width: 74px; height: 74px; margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--wine-950);
  box-shadow: var(--shadow-lift), 0 14px 30px -10px rgba(154,114,38,0.6);
}
.success-sub { color: var(--ink-500); line-height: 1.7; margin: 14px 0 28px; }
.success-sub strong { color: var(--wine-800); }

/* ==========================================================================
   Cart drawer
   ========================================================================== */

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(26,5,8,0.55);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  z-index: 90;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: linear-gradient(180deg, #fffdf9, var(--cream-100));
  box-shadow: -20px 0 50px rgba(0,0,0,0.35);
  z-index: 91;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(.2,.9,.3,1);
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px;
  background: linear-gradient(160deg, var(--wine-900), var(--wine-950));
  color: var(--cream-100);
}
.cart-drawer-header h3 { color: var(--gold-300); font-size: 1.3rem; }
.drawer-close { background: none; border: none; color: var(--cream-100); font-size: 1.6rem; line-height: 1; }

.cart-drawer .cart-items { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cart-drawer-footer { padding: 20px 24px 26px; border-top: 1px solid rgba(89,20,32,0.1); }

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

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: linear-gradient(160deg, var(--wine-900), var(--wine-950));
  color: var(--cream-100);
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow-deep);
  border: 1px solid rgba(232,181,89,0.3);
  opacity: 0; pointer-events: none;
  transition: all 0.3s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

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

.site-footer {
  text-align: center; padding: 30px 24px 40px;
  color: var(--ink-500); font-size: 0.8rem;
}

/* ==========================================================================
   Mobile Responsiveness & Speed Optimizations
   ========================================================================== */

/* Content visibility for speed */
.product-grid, .hero-carousel, .product-detail {
  content-visibility: auto;
  contain-intrinsic-size: 1px 400px;
}

/* Mobile Responsive Overrides */
@media (max-width: 768px) {
  .site-header {
    padding: 12px 0;
  }
  .header-inner {
    padding: 0 16px;
  }
  .brand-name {
    font-size: 1.25rem;
  }
  .main-nav {
    gap: 12px;
    font-size: 0.82rem;
    overflow-x: auto;
    max-width: 55vw;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .hero-section {
    padding: 30px 16px 40px;
  }
  .hero-title {
    font-size: clamp(2rem, 7vw, 3rem);
  }
  .hero-sub {
    font-size: 0.95rem;
    padding: 0 8px;
  }

  .shop-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 24px 0 18px;
  }
  .shop-header h1 {
    font-size: 1.8rem;
    text-align: center;
  }
  .shop-search {
    width: 100%;
    max-width: 100%;
  }

  .shop-strip {
    padding: 4px 0 16px;
    gap: 8px;
  }
  .chip {
    padding: 7px 14px;
    font-size: 0.8rem;
  }

  .price-range-wrapper {
    flex-direction: column;
    gap: 8px;
    padding: 0 8px 24px;
  }

  /* 2-column Product Grid for mobile phones */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .card {
    padding: 12px;
    border-radius: var(--radius-md);
  }
  .card-img-wrap {
    height: 150px;
  }
  .card-name {
    font-size: 0.95rem;
  }
  .card-brand {
    font-size: 0.72rem;
  }
  .card-price {
    font-size: 0.92rem;
  }
  .card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
  }
  .card-footer .btn {
    padding: 8px 12px;
    font-size: 0.78rem;
    width: 100%;
  }

  /* Product detail view */
  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px 16px;
  }

  /* Checkout form */
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Prevent auto-zoom on mobile Safari */
  .field input, .field textarea, .shop-search input, .hero-search input {
    font-size: 16px !important;
  }

  .funnel-panel {
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }

  .cart-drawer {
    width: 100vw;
  }
}

@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
  .card-img-wrap {
    height: 180px;
  }
}
