@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Figtree:wght@400;500;600&display=swap');

:root {
  --cream: #faf6ef;
  --cream-dark: #f0e9dc;
  --ink: #1c1917;
  --muted: #78716c;
  --terracotta: #c45c3e;
  --terracotta-soft: #e8a48f;
  --sage: #5f6f52;
  --sage-light: #dce5d4;
  --white: #fffefb;
  --border: #e7e0d5;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Figtree', system-ui, sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px rgba(28, 25, 23, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); background: var(--cream); color: var(--ink);
  font-size: 15px; line-height: 1.6;
}
body.sheet-open, body.search-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--terracotta); text-decoration: none; }
a:hover { color: var(--sage); }

.wrap { width: min(1140px, calc(100% - 32px)); margin: 0 auto; }

/* —— Header: airy editorial —— */
.site-top {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 246, 239, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px 0; gap: 16px;
}
.logo-mark {
  font-family: var(--serif); font-size: 1.65rem; font-weight: 700; color: var(--ink);
  letter-spacing: -0.02em; justify-self: center; grid-column: 2;
}
.logo-mark em { font-style: normal; color: var(--terracotta); }
.logo-mark:hover { color: var(--ink); text-decoration: none; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 500; }
.nav-left { justify-self: start; }
.nav-right { justify-self: end; }
.nav-left a, .nav-right a { color: var(--ink); position: relative; }
.nav-left a::after, .nav-right a:not(.bag-pill)::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--terracotta); transition: width 0.25s;
}
.nav-left a:hover::after, .nav-right a:not(.bag-pill):hover::after { width: 100%; }
.nav-left a:hover, .nav-right a:hover { text-decoration: none; color: var(--terracotta); }

.icon-btn {
  background: var(--white); border: 1px solid var(--border); border-radius: 999px;
  width: 42px; height: 42px; cursor: pointer; font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--terracotta); }

.bag-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  background: var(--ink); color: var(--cream) !important; border-radius: 999px;
  font-weight: 600; font-size: 13px; border: none; cursor: pointer; font-family: var(--sans);
}
.bag-pill:hover { background: var(--terracotta); color: var(--white) !important; text-decoration: none; }
.bag-pill::after { display: none !important; }
.bag-count {
  background: var(--terracotta); color: #fff; min-width: 20px; height: 20px;
  border-radius: 999px; font-size: 11px; display: none; align-items: center; justify-content: center;
}
.bag-count.show { display: inline-flex; }

.promo-ribbon {
  text-align: center; font-size: 12px; padding: 8px; background: var(--sage-light); color: var(--sage);
  font-weight: 500;
}

/* —— Buttons —— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 14px;
  border: none; cursor: pointer; font-family: var(--sans); transition: transform 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-fill { background: var(--terracotta); color: #fff; box-shadow: 0 8px 24px rgba(196, 92, 62, 0.35); }
.btn-fill:hover { background: #b04e32; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.btn-sage { background: var(--sage); color: #fff; }
.btn-block { width: 100%; }

/* —— Home hero —— */
.hero-editorial {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 0; margin: 32px 0 48px;
  border-radius: calc(var(--radius) + 8px); overflow: hidden; min-height: 380px;
  box-shadow: var(--shadow);
}
.hero-copy {
  background: var(--ink); color: var(--cream); padding: 48px 44px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-copy h1 {
  font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.15;
  margin: 0 0 16px; font-weight: 700;
}
.hero-copy p { color: #d6d3d1; margin: 0 0 28px; max-width: 36ch; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; min-height: 280px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.chip {
  padding: 10px 20px; background: var(--white); border: 1px solid var(--border);
  border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.chip:hover { border-color: var(--sage); background: var(--sage-light); text-decoration: none; color: var(--sage); }

.section-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px;
}
.section-head h2 { font-family: var(--serif); font-size: 1.75rem; margin: 0; font-weight: 700; }

/* —— Product cards: editorial tiles —— */
.product-rail {
  display: flex; gap: 20px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory;
}
.product-rail .p-card { flex: 0 0 260px; scroll-snap-align: start; }

.p-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.p-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.p-card .thumb {
  aspect-ratio: 1; background: var(--cream-dark); padding: 20px;
  display: flex; align-items: center; justify-content: center;
}
.p-card .thumb img { max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.p-card .body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.p-card .cat-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sage); font-weight: 600; margin-bottom: 6px; }
.p-card h3 { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; margin: 0 0 8px; line-height: 1.35; }
.p-card h3 a { color: var(--ink); }
.p-card h3 a:hover { color: var(--terracotta); text-decoration: none; }
.p-card .meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.p-card .price-row { font-size: 1.25rem; font-family: var(--serif); font-weight: 700; margin-bottom: 14px; }
.p-card .price-row .was { font-size: 14px; color: var(--muted); text-decoration: line-through; font-weight: 400; margin-left: 8px; }
.p-card .btn { padding: 10px 16px; font-size: 13px; margin-top: auto; }
.p-card.hidden { display: none !important; }

/* Catalog: masonry-ish grid */
.catalog-page { padding: 32px 0 64px; }
.catalog-split { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.filter-panel {
  background: var(--white); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border);
  position: sticky; top: 100px;
}
.filter-panel h3 { font-family: var(--serif); margin: 0 0 16px; font-size: 1.1rem; }
.filter-panel label { display: block; margin-bottom: 10px; font-size: 14px; cursor: pointer; }
.filter-panel input { accent-color: var(--terracotta); margin-right: 8px; }

.catalog-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.catalog-grid .p-card:nth-child(3n+2) { margin-top: 24px; }

.catalog-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.catalog-bar input, .catalog-bar select {
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 999px;
  font-family: var(--sans); background: var(--white);
}

/* —— PDP: magazine layout —— */
.pdp-hero-img {
  width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius);
  margin: 24px 0 32px; box-shadow: var(--shadow);
}
.pdp-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; padding-bottom: 56px; }
.pdp-story h1 { font-family: var(--serif); font-size: 2.25rem; margin: 0 0 12px; line-height: 1.2; }
.pdp-story .lede { font-size: 17px; color: var(--muted); margin-bottom: 24px; }
.pdp-story ul { padding-left: 1.2em; }
.pdp-story ul li { margin-bottom: 8px; }
.pdp-story .story-block { margin-top: 32px; padding-top: 24px; border-top: 1px dashed var(--border); }
.pdp-story .story-block h2 { font-family: var(--serif); font-size: 1.35rem; margin: 0 0 12px; }

.purchase-float {
  background: var(--white); border-radius: var(--radius); padding: 28px;
  border: 2px solid var(--ink); position: sticky; top: 100px;
}
.purchase-float .price-big { font-family: var(--serif); font-size: 2.5rem; margin: 0 0 4px; color: var(--terracotta); }
.purchase-float .ship-note { font-size: 13px; color: var(--sage); font-weight: 600; margin-bottom: 16px; }
.purchase-float select { width: 100%; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 12px; }
.wish-link { background: none; border: none; color: var(--muted); cursor: pointer; font-family: var(--sans); font-size: 13px; text-decoration: underline; padding: 8px 0; }

.breadcrumb { font-size: 13px; color: var(--muted); padding: 16px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--terracotta); }

.related-band { background: var(--sage-light); border-radius: var(--radius); padding: 32px; margin-bottom: 64px; }
.related-band h2 { font-family: var(--serif); margin: 0 0 20px; }

/* —— Guides: numbered list —— */
.guide-list { display: flex; flex-direction: column; gap: 16px; padding: 32px 0 64px; }
.guide-row {
  display: grid; grid-template-columns: 72px 200px 1fr; gap: 24px; align-items: center;
  background: var(--white); border-radius: var(--radius); padding: 16px 24px; border: 1px solid var(--border);
}
.guide-row .num { font-family: var(--serif); font-size: 2rem; color: var(--terracotta-soft); font-weight: 700; }
.guide-row img { width: 100%; height: 100px; object-fit: cover; border-radius: var(--radius-sm); }
.guide-row h3 { font-family: var(--serif); margin: 0 0 6px; font-size: 1.2rem; }
.guide-row p { margin: 0; font-size: 14px; color: var(--muted); }

.article-wrap {
  background: var(--white); border-radius: var(--radius); padding: 40px 48px; margin: 24px 0 64px;
  border: 1px solid var(--border); max-width: 720px;
}
.article-wrap .lead-img { width: 100%; height: 280px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 28px; }
.article-wrap h1 { font-family: var(--serif); font-size: 2rem; margin: 0 0 8px; }
.article-wrap h2 { font-family: var(--serif); font-size: 1.25rem; margin: 28px 0 10px; }

/* —— Cart page —— */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; padding: 32px 0 64px; }
.cart-lines { display: flex; flex-direction: column; gap: 16px; }
.cart-line {
  display: grid; grid-template-columns: 100px 1fr auto auto; gap: 20px; align-items: center;
  background: var(--white); padding: 20px; border-radius: var(--radius); border: 1px solid var(--border);
}
.cart-line img { width: 100px; height: 100px; object-fit: contain; background: var(--cream-dark); border-radius: var(--radius-sm); }
.cart-total-box {
  background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 28px;
  position: sticky; top: 100px;
}
.cart-total-box .line { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.cart-total-box .grand { font-family: var(--serif); font-size: 1.5rem; margin-top: 16px; padding-top: 16px; border-top: 1px solid #444; }
.empty-state { text-align: center; padding: 80px 24px; background: var(--white); border-radius: var(--radius); }

/* —— Bottom sheet cart —— */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(28, 25, 23, 0.45); z-index: 400;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.cart-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 401;
  background: var(--white); border-radius: 24px 24px 0 0; max-height: 85vh;
  transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column; box-shadow: 0 -12px 40px rgba(0,0,0,0.12);
}
.cart-sheet.open { transform: translateY(0); }
.sheet-grab { width: 48px; height: 5px; background: var(--border); border-radius: 999px; margin: 12px auto; }
.sheet-head { padding: 0 24px 16px; display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-family: var(--serif); margin: 0; font-size: 1.35rem; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 24px; }
.sheet-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.sheet-foot { padding: 20px 24px 28px; border-top: 1px solid var(--border); }

/* —— Search overlay —— */
.search-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(250, 246, 239, 0.97);
  display: none; flex-direction: column; align-items: center; padding: 80px 24px;
}
.search-overlay.show { display: flex; }
.search-overlay input {
  width: min(560px, 100%); font-size: 1.5rem; font-family: var(--serif);
  border: none; border-bottom: 2px solid var(--ink); background: transparent; padding: 16px 0;
  outline: none;
}
.search-results { width: min(560px, 100%); margin-top: 24px; }
.search-results a { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--ink); font-weight: 500; }

.site-footer {
  border-top: 1px solid var(--border); padding: 48px 0 32px; margin-top: 48px;
  display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; font-size: 14px;
}
.site-footer .foot-brand { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
.site-footer a { color: var(--muted); display: block; margin-top: 8px; }
.site-footer a:hover { color: var(--terracotta); }

#toastContainer { position: fixed; top: 24px; right: 24px; z-index: 500; }
.toast {
  background: var(--ink); color: var(--cream); padding: 14px 22px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 8px; box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .hero-editorial { grid-template-columns: 1fr; }
  .top-inner { grid-template-columns: 1fr auto; }
  .logo-mark { grid-column: 1; justify-self: start; }
  .nav-left { display: none; }
  .catalog-split, .pdp-layout, .cart-layout { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr 1fr; }
  .catalog-grid .p-card:nth-child(3n+2) { margin-top: 0; }
  .guide-row { grid-template-columns: 48px 1fr; }
  .guide-row img { display: none; }
  .filter-panel { position: static; }
}
@media (max-width: 560px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 80px 1fr; }
}
