:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1c1b19;
  --muted: #6b665e;
  --line: #e6e1d8;
  --accent: #0f6b5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0ec;
  --sale: #c2410c;
  --danger: #b42318;
  --ok: #1a7f4b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 27, 25, .06), 0 6px 20px rgba(28, 27, 25, .06);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink); line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.2rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* announcement + header */
.announce { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: .875rem; padding: 8px 12px; }
header.site { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
header.site .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; text-decoration: none; color: var(--accent); }
nav.main { display: flex; gap: 18px; margin-left: 8px; }
nav.main a { text-decoration: none; color: var(--muted); font-size: .95rem; padding: 4px 0; border-bottom: 2px solid transparent; }
nav.main a:hover, nav.main a.active { color: var(--ink); border-color: var(--accent); }
.spacer { flex: 1; }
.search { display: flex; }
.search input { width: 190px; }
.cart-link { position: relative; text-decoration: none; font-weight: 600; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; }
.cart-link:hover { border-color: var(--accent); }
.cart-count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: .75rem; padding: 1px 7px; margin-left: 6px; }

/* controls */
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 11px 20px; border-radius: 999px; text-decoration: none; transition: filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.small { padding: 6px 14px; font-size: .85rem; }
.btn.block { width: 100%; }
.field { margin-bottom: 14px; }
.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: 14px; grid-template-columns: 2fr 1fr 1fr; }

/* hero */
.hero { padding: 64px 0 48px; background: linear-gradient(180deg, var(--accent-soft), var(--bg)); }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 0 24px; }
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 40px 0; }
.trust div { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.trust strong { display: block; }

/* products */
section.block { padding: 36px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 24px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 6px 14px; border-radius: 999px; text-decoration: none; font-size: .9rem; cursor: pointer; }
.chip:hover, .chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .thumb { aspect-ratio: 1; background: #ece8e1; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px 16px 16px; }
.card .cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card .title { font-weight: 600; margin: 2px 0 6px; }
.price { font-weight: 700; }
.price s { color: var(--muted); font-weight: 400; margin-left: 6px; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--sale); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.out { background: #4b4740; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.toolbar select { width: auto; }

/* product page */
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; padding: 32px 0 56px; }
.product .photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; background: #ece8e1; }
.product .photo img { width: 100%; height: 100%; object-fit: cover; }
.product .big-price { font-size: 1.7rem; font-weight: 700; margin: 8px 0 4px; }
.stock-ok { color: var(--ok); font-weight: 600; }
.stock-low { color: var(--sale); font-weight: 600; }
.stock-out { color: var(--danger); font-weight: 600; }
.buy { display: flex; gap: 12px; margin: 20px 0; align-items: stretch; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.qty button { border: 0; background: none; width: 38px; font-size: 1.1rem; cursor: pointer; }
.qty button:hover { background: var(--accent-soft); }
.qty span { min-width: 34px; text-align: center; align-self: center; font-weight: 600; }
.desc { white-space: pre-line; color: #3b3832; }
.crumbs { font-size: .875rem; color: var(--muted); padding-top: 20px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* cart + checkout */
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; padding: 28px 0 56px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.line { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line:last-child { border-bottom: 0; }
.line img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; background: #ece8e1; }
.line .remove { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .85rem; text-decoration: underline; padding: 0; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-row.total { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .95rem; }
.alert.err { background: #fdecea; color: var(--danger); border: 1px solid #f5c2bd; }
.alert.ok { background: #e6f5ec; color: var(--ok); border: 1px solid #b9e2c8; }
.alert.info { background: var(--accent-soft); color: #0b4f44; border: 1px solid #bddbd3; }
.empty { text-align: center; padding: 64px 0; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eee; text-transform: capitalize; }
.status-pill.pending, .status-pill.unpaid { background: #fff1d6; color: #8a5a00; }
.status-pill.processing { background: #dbeafe; color: #1e4fa3; }
.status-pill.shipped { background: #e0e7ff; color: #3a3fa0; }
.status-pill.delivered, .status-pill.paid { background: #dcf3e5; color: var(--ok); }
.status-pill.cancelled, .status-pill.refunded { background: #fde4e1; color: var(--danger); }
.stars { color: #e0a100; letter-spacing: 1px; }
.stars .off { color: #d8d3c8; }
.reviews { padding: 8px 0 56px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.review p { margin: 4px 0 0; white-space: pre-line; }
.prose { max-width: 700px; padding: 40px 0 64px; white-space: pre-line; }

footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0; margin-top: 40px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
footer.site a { text-decoration: none; color: var(--muted); display: block; padding: 2px 0; }
footer.site a:hover { color: var(--ink); }

@media (max-width: 800px) {
  nav.main { display: none; }
  .search input { width: 90px; }
  .brand { font-size: 1.15rem; white-space: nowrap; }
  .product, .cart-layout { grid-template-columns: 1fr; gap: 20px; }
  .row, .row3 { grid-template-columns: 1fr; }
  header.site .wrap { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
