:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1d1b19;
  --muted: #6b665f;
  --line: #e6e1d9;
  --accent: #2f4a3a;
  --accent-ink: #ffffff;
  --danger: #a3341f;
  --radius: 10px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412; --surface: #1e1c1a; --ink: #f1ede6; --muted: #a39d93;
    --line: #34312d; --accent: #9ec5ab; --accent-ink: #11140f; --danger: #ff8d78;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font: 600 1.25rem var(--serif); text-decoration: none; letter-spacing: .01em; }
.cart-btn {
  background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  display: inline-flex; gap: 8px; align-items: center;
}
.cart-btn:hover { border-color: var(--ink); }
.count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 22px; height: 22px;
  display: inline-grid; place-items: center; font-size: .8rem; padding: 0 6px; }

main { max-width: 1120px; margin: 0 auto; padding: 0 20px 64px; min-height: 60vh; }

.hero { padding: 72px 0 40px; max-width: 640px; }
.hero h1 { font: 600 clamp(2rem, 6vw, 3.4rem)/1.1 var(--serif); margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 1.15rem; margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.pill { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 6px 16px; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.grid { display: grid; gap: 28px 22px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { text-decoration: none; display: block; }
.card .ph { aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; background: var(--line); position: relative; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .ph img { transform: scale(1.03); }
.card h3 { margin: 12px 0 2px; font: 600 1.05rem var(--sans); }
.card .meta { color: var(--muted); font-size: .92rem; }
.tag { position: absolute; top: 10px; left: 10px; background: var(--ink); color: var(--bg); font-size: .75rem;
  padding: 2px 10px; border-radius: 999px; }

.about { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line); max-width: 640px; }
.about h2 { font: 600 1.6rem var(--serif); margin: 0 0 8px; }
.about p { color: var(--muted); margin: 0; }

.product { display: grid; gap: 40px; grid-template-columns: 1fr; padding-top: 28px; }
@media (min-width: 820px) { .product { grid-template-columns: 1.1fr 1fr; } }
.gallery .main { border-radius: var(--radius); overflow: hidden; background: var(--line); aspect-ratio: 4/5; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; margin-top: 10px; }
.thumbs button { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; }
.thumbs button[aria-current="true"] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.crumb { color: var(--muted); font-size: .9rem; text-decoration: none; }
.crumb:hover { color: var(--ink); }
.info h1 { font: 600 clamp(1.7rem, 4vw, 2.3rem)/1.15 var(--serif); margin: 10px 0 6px; }
.price { font-size: 1.4rem; margin: 0 0 18px; }
.info .desc { color: var(--muted); }
.label { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }
.variants { display: flex; flex-wrap: wrap; gap: 8px; }
.variants button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; }
.variants button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn { display: inline-block; width: 100%; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink);
  padding: 14px 20px; font-weight: 600; margin-top: 24px; text-align: center; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.note { color: var(--muted); font-size: .9rem; margin-top: 14px; }

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--bg); z-index: 21;
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; box-shadow: -8px 0 30px rgba(0,0,0,.15); visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font: 600 1.2rem var(--serif); }
.icon-btn { background: none; border: 0; font-size: 1.8rem; line-height: 1; padding: 0 6px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.empty { color: var(--muted); padding: 32px 0; text-align: center; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line img { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; }
.line .name { font-weight: 600; font-size: .98rem; }
.line .sub { color: var(--muted); font-size: .88rem; }
.qty { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.qty button { width: 26px; height: 26px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 0; }
.qty span { min-width: 22px; text-align: center; }
.rm { background: none; border: 0; color: var(--muted); font-size: .82rem; text-decoration: underline; padding: 0; margin-left: 8px; }
.drawer-foot { padding: 16px 20px 22px; border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.row.total { font-weight: 600; font-size: 1.1rem; margin-top: 6px; }
.err { color: var(--danger); font-size: .92rem; margin: 10px 0 0; min-height: 1.2em; }

.foot { border-top: 1px solid var(--line); padding: 28px 20px; text-align: center; color: var(--muted); font-size: .9rem; }
.success { max-width: 560px; margin: 0 auto; padding: 80px 0; text-align: center; }
.success h1 { font: 600 2rem var(--serif); }
.success ul { list-style: none; padding: 0; }
.success li { margin: 10px 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
