:root {
  --bg: #faf7f2;
  --fg: #1f1a17;
  --muted: #6f6660;
  --accent: #b3263a;
  --accent-dark: #8e1c2d;
  --line: #e5ded5;
  --card: #fff;
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.brand { font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.01em; }
.brand::before { content: "♥ "; color: var(--accent); }
.cart-link { text-decoration: none; font-weight: 600; }
.cart-count {
  display: inline-block; min-width: 1.5em; padding: 0 0.4em; margin-left: 0.25em;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.8em; text-align: center;
}

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 3rem); flex: 1; }
.page-title { margin: 0 0 1.5rem; font-size: 2rem; letter-spacing: -0.02em; }
.status { color: var(--muted); }
.error { color: var(--accent-dark); }
.back { color: var(--muted); text-decoration: none; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.product-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgb(0 0 0 / 0.08); }
.product-card img { aspect-ratio: 1; object-fit: cover; width: 100%; background: #f0ebe4; }
.product-card .info { padding: 0.9rem 1rem 1.1rem; }
.product-card h2 { font-size: 1rem; margin: 0 0 0.3rem; }
.price { color: var(--muted); }

.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
@media (max-width: 760px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail img { border-radius: var(--radius); background: #f0ebe4; width: 100%; aspect-ratio: 1; object-fit: contain; }
.product-detail h1 { margin: 0 0 0.5rem; }
.product-detail .price { font-size: 1.4rem; color: var(--fg); margin: 0 0 1.5rem; }

.option-group { border: 0; padding: 0; margin: 0 0 1.25rem; }
.option-group legend { font-weight: 600; margin-bottom: 0.5rem; text-transform: capitalize; }
.options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.option {
  padding: 0.5rem 0.9rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card);
  font: inherit; cursor: pointer;
}
.option[aria-pressed="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.option.unavailable { color: var(--muted); text-decoration: line-through; }
select, input[type="number"] {
  font: inherit; padding: 0.5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card);
}

.button {
  display: inline-block; padding: 0.85rem 1.6rem; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.button:hover { background: var(--accent-dark); }
.button:disabled { background: #c9bfb7; cursor: not-allowed; }
.button.secondary { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.added { margin-top: 0.75rem; color: var(--muted); }

.cart-lines { list-style: none; margin: 0 0 2rem; padding: 0; border-top: 1px solid var(--line); }
.cart-line {
  display: grid; grid-template-columns: 80px 1fr auto auto; gap: 1rem; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.cart-line img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; background: #f0ebe4; }
.cart-line .name { font-weight: 600; }
.cart-line .variant { color: var(--muted); font-size: 0.9rem; }
.cart-line input { width: 4.5rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.9rem; }
.cart-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; }
.cart-summary .subtotal { font-size: 1.25rem; font-weight: 700; }
.cart-summary .note { color: var(--muted); font-size: 0.9rem; margin: 0; }

.success { max-width: 600px; }
.site-footer { padding: 2rem; text-align: center; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); }
