:root {
  --bg: #f7f4ef;
  --surface: #fdfbf8;
  --surface-alt: #ede7dc;
  --ink: #26211c;
  --muted: #6e655c;
  --accent: #8c5a3c;
  --accent-dark: #6f452c;
  --border: #e2d9cb;
  --danger: #a43b2c;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.announcement-bar {
  background: var(--ink);
  color: var(--bg);
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.6rem 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
}

.brand-logo {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
}

.bag-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
  transition: border-color 0.2s, background 0.2s;
}

.bag-trigger:hover {
  border-color: var(--ink);
}

.bag-count {
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
}

/* Hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-content {
  max-width: 680px;
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 400;
  line-height: 1.08;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background 0.2s, opacity 0.2s, transform 0.15s;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

/* Collection */
.collection-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.section-header h2,
.story-section h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.filter-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.toggle-sold {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.toggle-sold input {
  accent-color: var(--ink);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.25rem 1.75rem;
}

.grid-status {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface-alt);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .card-media img {
  transform: scale(1.04);
}

.product-card.is-sold .card-media img {
  opacity: 0.6;
  filter: grayscale(20%);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(253, 251, 248, 0.92);
  color: var(--ink);
  font-weight: 500;
}

.card-media .badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
}

.badge.sold {
  background: var(--ink);
  color: var(--bg);
}

.card-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.card-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  cursor: pointer;
}

.card-price {
  font-size: 0.95rem;
  color: var(--muted);
  white-space: nowrap;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: auto;
}

.btn-outline {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  padding: 0.65rem 1rem;
  font-size: 0.84rem;
}

.btn-outline:hover {
  border-color: var(--ink);
}

/* Story & Footer */
.story-section {
  background: var(--surface-alt);
  padding: 4.5rem 1.5rem;
  text-align: center;
}

.story-inner {
  max-width: 640px;
  margin: 0 auto;
}

.story-inner p:last-child {
  margin-top: 1rem;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-note {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(38, 33, 28, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 820px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-media {
  background: var(--surface-alt);
  min-height: 320px;
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal-body h3 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.15;
}

.modal-price {
  font-size: 1.15rem;
  font-weight: 500;
}

.modal-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.modal-meta {
  font-size: 0.84rem;
  color: var(--accent);
  margin-top: auto;
}

.icon-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  z-index: 2;
}

.icon-close:hover {
  color: var(--ink);
}

/* Bag Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(38, 33, 28, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bag-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 80;
  width: min(420px, 100%);
  height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.08);
}

.bag-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  position: relative;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h3 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
}

.drawer-header .icon-close {
  position: static;
}

.shipping-meter {
  padding: 0.9rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

.meter-track {
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.bag-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.bag-empty {
  color: var(--muted);
  text-align: center;
  margin-top: 3rem;
}

.bag-item {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 1rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

.bag-item img {
  width: 68px;
  height: 84px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-alt);
}

.bag-item-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
}

.bag-item-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.15rem 0 0.5rem;
}

.bag-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.qty-stepper button {
  padding: 0.2rem 0.6rem;
  font-size: 0.9rem;
}

.qty-stepper span {
  padding: 0 0.5rem;
  font-size: 0.85rem;
}

.remove-link {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: underline;
}

.drawer-footer {
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.checkout-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.checkout-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 0.6rem;
  min-height: 1.1em;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: var(--bg);
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-size: 0.86rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 90;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
  .header-inner {
    grid-template-columns: auto 1fr;
  }
  .modal-layout {
    grid-template-columns: 1fr;
  }
  .modal-media {
    max-height: 300px;
  }
}