:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --fg: #171614;
  --muted: #6f6b63;
  --line: #e3dfd6;
  --accent: #1f3d2f;
  --accent-fg: #f7f5f0;
  --error: #a3261c;
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }

/* Header */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: .9rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 750; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; font-size: 1rem; }
nav { display: flex; gap: 1.25rem; align-items: center; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--fg); }

/* Buttons and forms */
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-fg);
  padding: .65rem 1.1rem; border-radius: 999px; text-decoration: none; display: inline-block; text-align: center;
}
button:disabled { opacity: .5; cursor: default; }
.btn-ghost, .cart-btn { background: transparent; color: var(--fg); border-color: var(--line); }
.cart-btn span { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; margin-left: .3em; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: .8em; }
.icon { background: none; border: 0; color: var(--fg); font-size: 1.5rem; padding: 0 .25rem; }
.wide { width: 100%; }
label { display: grid; gap: .3rem; font-size: .875rem; color: var(--muted); }
input, select {
  font: inherit; color: var(--fg); background: var(--card);
  padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.error { color: var(--error); font-size: .9rem; margin: .5rem 0 0; }

/* Layout */
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 3rem) 4rem; }
.status { color: var(--muted); }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; border-top: 1px solid var(--line); }

/* Home */
.hero { padding: 3rem 0 2.5rem; max-width: 40rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--muted); margin: 0 0 .75rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.02em; }
.hero p { color: var(--muted); font-size: 1.1rem; margin: 1rem 0 0; }
.grid { display: grid; gap: 2.5rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { text-decoration: none; display: block; }
.card .img { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: #ebe7de; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover img { transform: scale(1.03); }
.card h3 { font-size: 1rem; font-weight: 600; margin-top: .8rem; }
.card p { margin: .15rem 0 0; color: var(--muted); }

/* Product page */
.back { display: inline-block; margin-bottom: 1.5rem; color: var(--muted); text-decoration: none; }
.product { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.gallery { display: grid; gap: .75rem; }
.gallery img { width: 100%; border-radius: var(--radius); background: #ebe7de; aspect-ratio: 4 / 5; object-fit: cover; }
.info { position: sticky; top: 5.5rem; display: grid; gap: 1.25rem; }
.info h1 { font-size: 2rem; letter-spacing: -.01em; }
.info .price { font-size: 1.25rem; }
.info .desc { color: var(--muted); margin: 0; }
.row { display: grid; grid-template-columns: 1fr 6rem; gap: .75rem; }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .25); z-index: 9; }
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(400px, 100%); z-index: 10;
  background: var(--card); display: flex; flex-direction: column; padding: 1.25rem;
  box-shadow: -12px 0 32px rgb(0 0 0 / .1);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { font-size: 1.1rem; }
#drawer-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lines { list-style: none; padding: 0; margin: 1rem 0; flex: 1; overflow: auto; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.line img { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; background: #ebe7de; }
.line small { color: var(--muted); display: block; }
.qty { display: inline-flex; align-items: center; gap: .4rem; margin-top: .35rem; }
.qty button { padding: 0; width: 1.8rem; height: 1.8rem; background: transparent; color: var(--fg); border-color: var(--line); }
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: .85rem; }

/* Totals */
.totals { display: grid; gap: .4rem; padding-top: 1rem; border-top: 1px solid var(--line); margin-bottom: 1rem; }
.totals div { display: flex; justify-content: space-between; color: var(--muted); }
.totals .grand { color: var(--fg); font-weight: 700; font-size: 1.1rem; padding-top: .4rem; }

/* Checkout */
.checkout { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.checkout h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; }
.step h2 { font-size: 1rem; margin-bottom: 1rem; display: flex; justify-content: space-between; }
.step h2 small { color: var(--muted); font-weight: 400; }
.step.locked { opacity: .55; }
.fields { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; }
.fields .full { grid-column: 1 / -1; }
.option { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .5rem; color: var(--fg); font-size: 1rem; cursor: pointer; }
.option input { width: auto; margin-right: .6rem; }
.option:has(input:checked) { border-color: var(--accent); }
.summary { position: sticky; top: 5.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.summary h2 { font-size: 1rem; margin-bottom: .5rem; }
.summary .lines { margin: 0 0 1rem; }
.note { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }

/* Confirmation */
.done { max-width: 36rem; margin: 2rem auto; text-align: center; }
.done .tick { width: 3.5rem; height: 3.5rem; border-radius: 999px; display: grid; place-items: center; margin: 0 auto 1.25rem; background: var(--accent); color: var(--accent-fg); font-size: 1.6rem; }
.done h1 { font-size: 2rem; }
.done p { color: var(--muted); }
.done .summary { position: static; text-align: left; margin: 2rem 0; }

@media (max-width: 800px) {
  .product, .checkout { grid-template-columns: 1fr; }
  .info, .summary { position: static; }
  .fields { grid-template-columns: 1fr; }
}
