/* ============================================================================
   Sunnyside Vines - Shop page styles
   Layers on top of styles-v4.css (shared nav, footer, fonts, tokens).
   Fraunces for headings and prices, Hanken Grotesk for everything else.
   ========================================================================== */

:root {
  --line: rgba(42, 26, 18, 0.14);
  --muted: var(--ink-soft);
}

/* ── Layout shell ─────────────────────────────────────────────────────────── */
.shop-main {
  padding: 158px 0 clamp(60px, 8vw, 100px);
}

/* the same paper grain the homepage hero wears, over the whole page */
.shop-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.075;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 90;
}

/* quiet scroll reveals, matching the homepage's motion language */
.js-shop .reveal-fade {
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}
.js-shop .reveal-fade.is-in { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .js-shop .reveal-fade { opacity: 1; }
}

/* page-load entrance, matching the hero's blur/rise cascade (wordmark -> sub) */
.js-shop .enter {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease), filter 0.8s var(--ease), transform 0.8s var(--ease);
}
.js-shop .enter.is-in {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .js-shop .enter { opacity: 1; filter: none; transform: none; transition: none; }
}

/* ── Shop header ──────────────────────────────────────────────────────────── */
.shop-header {
  margin: 0 0 clamp(36px, 5vw, 56px);
  padding-bottom: clamp(26px, 3.5vw, 38px);
  border-bottom: 1px solid var(--line);
}

.shop-title {
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.05;
  color: var(--ink);
}
.shop-sub {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 560px;
}

/* ── Producer groups ──────────────────────────────────────────────────────── */
.producer-group { margin-bottom: clamp(56px, 7vw, 84px); }

.producer-group-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 30px;
}

.producer-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.producer-name {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 650;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.producer-region {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra);
}

.producer-blurb {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 720px;
  margin-top: 3px;
}

/* ── Wine grid + cards ────────────────────────────────────────────────────── */
.wine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.wine-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.08s ease;
}

/* hover: a quiet terra ring - nothing moves */
.wine-card:hover {
  box-shadow: var(--shadow-soft), 0 0 0 1.5px rgba(187, 90, 44, 0.45);
}

.wine-media {
  position: relative;
  height: 300px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  background: linear-gradient(160deg, #fff, #f0e7dd);
}

/* The current catalog supplies full bottle photographs for every estate. */
.wine-media img {
  display: block;
  height: 100%;
  width: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.wine-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 22px 24px;
}

.wine-name {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 650;
  font-size: 21px;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.15;
}

.wine-vintage {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--terra);
}

.wine-meta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 14px;
  line-height: 1.6;
}

.wine-note {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.wine-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wine-price {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 650;
  font-size: 20px;
  color: var(--ink);
}

.add-btn {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  background: var(--terra);
  border: none;
  padding: 12px 20px;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s ease;
}
.add-btn:hover { background: var(--terra-deep); transform: translateY(-2px); }
.add-btn:active { transform: scale(0.96); }
.add-btn.added { background: #3f6b3a; }

.ficha-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ficha-link:hover { color: var(--terra); border-color: var(--terra); }

/* the whole card opens the details modal; the hint just says so */
.wine-card[data-details] { cursor: pointer; }
.wine-card[data-details]:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
}
.details-hint {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}
.details-arrow { transition: transform 0.2s var(--ease); }
.wine-card[data-details]:hover .details-hint { color: var(--terra); }
.wine-card[data-details]:hover .details-arrow { transform: translateX(4px); }

/* ── Cart (top right, in the nav, where people look for it) ───────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--white);
  border: none;
  box-shadow: var(--shadow-soft);
  padding: 13px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease;
}
.cart-toggle:hover { background: var(--terra-deep); }
.cart-toggle svg { width: 18px; height: 18px; }

.cart-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 50px;
  background: var(--terra);
  color: var(--white);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-count.hidden { display: none; }

/* ── Cart drawer ──────────────────────────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 26, 18, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1100;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 400px;
  max-width: 92vw;
  background: var(--paper);
  box-shadow: -10px 0 40px rgba(42, 26, 18, 0.2);
  transform: translateX(100%);
  transition: transform 0.32s var(--ease);
  z-index: 1101;
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 26px 18px;
  border-bottom: 1px solid var(--line);
}
.cart-head h2 {
  font-size: 22px;
  font-weight: 650;
  color: var(--ink);
}
.cart-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.cart-close:hover { color: var(--ink); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 26px;
}

.cart-empty {
  text-align: center;
  color: var(--muted);
  font-family: 'Fraunces', serif;
  font-style: italic;
  padding: 60px 20px;
}

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #fff center/contain no-repeat;
  border: 1px solid var(--line);
}
.cart-item-name {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 650;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.2;
}
.cart-item-price {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.cart-item-right { text-align: right; }
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 50px;
  overflow: hidden;
}
.qty button {
  background: none;
  border: none;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
}
.qty button:hover:not(:disabled) { background: rgba(42, 26, 18, 0.06); }
.qty button:disabled { opacity: 0.3; cursor: default; }
.qty span {
  font-size: 13px;
  font-weight: 600;
  min-width: 22px;
  text-align: center;
}
.cart-item-remove {
  display: block;
  margin-top: 8px;
  margin-left: auto;
  background: none;
  border: none;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.cart-item-remove:hover { color: var(--terra); }

.cart-foot {
  padding: 20px 26px 26px;
  border-top: 1px solid var(--line);
}
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.cart-subtotal span:first-child {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.cart-subtotal span:last-child {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 650;
  font-size: 24px;
  color: var(--ink);
}
.checkout-btn {
  width: 100%;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  background: var(--terra);
  border: none;
  padding: 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.checkout-btn:hover { background: var(--terra-deep); }
.checkout-btn:disabled { opacity: 0.5; cursor: default; }


/* ── Wine details modal ───────────────────────────────────────────────────── */
/* ── Dedicated wine pages (wines/*.html, generated) ──────────────────────── */
.shop-main.wine-page-main { padding: 134px 0 clamp(120px, 16vw, 200px); }
.wine-page-main .wrap { width: min(940px, 92vw); }

/* a gentler version of the shop's page-load entrance - the full blur/rise
   reads as too heavy on a page that's mostly a photo and body copy */
.wine-page-main .enter {
  filter: blur(2px);
  transform: translateY(6px);
}

.crumbs { margin-bottom: 24px; }
.crumbs a {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}
.crumbs a:hover { color: var(--terra); }

.wine-detail {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 56px;
  align-items: start;
}
.wine-detail .detail-name { font-size: clamp(26px, 3.4vw, 36px); }

.detail-media {
  position: sticky;
  top: 134px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}
.detail-media img {
  display: block;
  height: 440px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.detail-body {
  padding-top: 6px;
}
.detail-producer {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.detail-name {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 650;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.005em;
  line-height: 1.1;
  color: var(--ink);
}
.detail-body .wine-meta { margin: 10px 0 16px; }
.detail-note {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.detail-specs {
  margin: 0 0 24px;
  border-top: 1px solid var(--line);
}
.detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.detail-row dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.detail-row dd {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
}

.detail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.detail-foot .wine-price { font-size: 24px; }

.detail-pdf { margin-top: 18px; }

.producer-note {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 56px;
  align-items: center;
  margin-top: clamp(40px, 5vw, 56px);
  padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--line);
}
.producer-note-img {
  margin: 0;
  width: 128px;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 14px 24px -18px rgba(42, 26, 18, 0.5);
}
.producer-note-img img { width: 100%; height: 100%; object-fit: cover; }
.producer-note-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.producer-note-name {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 650;
  font-size: clamp(19px, 2vw, 22px);
  color: var(--ink);
  margin-bottom: 8px;
}
.producer-note p { font-size: 14px; line-height: 1.55; color: var(--ink-soft); max-width: 54ch; margin-bottom: 10px; }
.producer-note-link { font-size: 13.5px; font-weight: 600; color: var(--terra); }
.producer-note-link:hover { color: var(--terra-deep); }

.more-from {
  margin-top: clamp(64px, 9vw, 96px);
  padding-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid var(--line);
}
.more-from-heading {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 650;
  font-size: clamp(21px, 2.4vw, 26px);
  color: var(--ink);
  margin-bottom: 26px;
}

@media (max-width: 720px) {
  .wine-detail { grid-template-columns: 1fr; gap: 28px; }
  .producer-note { grid-template-columns: 1fr; gap: 16px; }
  .producer-note-img { width: 84px; }
  .detail-media {
    position: static;
    min-height: 0;
  }
  .detail-media img { max-height: 280px; }
  .detail-body { padding-top: 0; }
}

/* toast confirmation */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  padding: 14px 22px;
  border-radius: 50px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 1200;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast-action {
  margin-left: 14px;
  background: none;
  border: none;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.toast-action:hover { opacity: 0.75; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .shop-main { padding-top: 140px; }
  .shop-main.wine-page-main { padding-top: 116px; }
  .wine-grid { grid-template-columns: 1fr; gap: 22px; }
  .cart-toggle { padding: 13px 15px; }
  .cart-toggle .cart-label { display: none; }
  .cart-drawer { width: 100%; max-width: 100vw; }
}
