/* ===== Theme tokens — change these to rebrand ===== */
:root {
  --brand: #e2725b;        /* terracotta */
  --brand-dark: #c4573f;
  --accent: #2f6f62;       /* deep teal */
  --bg: #fffaf5;
  --surface: #ffffff;
  --ink: #2b2522;
  --muted: #7a6f69;
  --line: #eadfd6;
  --ok: #2f7d4f;
  --err: #b3392f;
  --radius: 14px;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; margin: 0 auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ok { color: var(--ok); }
.err { color: var(--err); font-weight: 700; }
.r { text-align: right; }
.hp { position: absolute; left: -9999px; }

/* Header */
.topbar { background: var(--accent); color: #fff; text-align: center; font-size: .85rem; padding: 6px 16px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo img { height: 56px; width: auto; }
.footer-badge { margin-bottom: 8px; }
.search { flex: 1; }
.search input { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; background: var(--bg); }
.cart-link { margin-left: auto; position: relative; color: var(--ink); padding: 6px; }
.badge { position: absolute; top: -4px; right: -6px; background: var(--brand); color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 6px; font-weight: 700; }
.catnav { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 10px; white-space: nowrap; scrollbar-width: none; }
.catnav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; }
.catnav a:hover { color: var(--brand); }

main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }

/* Buttons & forms */
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: 10px 20px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dark); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface); }
.form label { display: block; margin-bottom: 14px; font-weight: 600; }
.form input, .form textarea, .form select { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.flash-ok { background: #e7f4ec; color: var(--ok); }
.flash-err { background: #fbe9e7; color: var(--err); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 24px; background: linear-gradient(135deg, #fde6dc, #fff3e8); border-radius: 24px; padding: 40px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 12px; }
.hero p { font-size: 1.1rem; color: var(--muted); margin: 0 0 20px; }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: min(320px, 100%); height: auto; }

.section { margin-top: 40px; }
.section h2 { margin-bottom: 16px; }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: border-color .15s; }
.cat-tile:hover { border-color: var(--brand); }
.cat-tile span { font-weight: 700; }
.cat-tile small { color: var(--muted); }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.card-img { aspect-ratio: 1; background: #f3ece6; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 16px; }
.card-title { font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.price { font-weight: 800; color: var(--brand-dark); }
.price s { font-weight: 400; margin-left: 6px; font-size: .9em; }
.price-lg { font-size: 1.6rem; margin: 8px 0 16px; }

.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.perks div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; }
.perks span { color: var(--muted); font-size: .9rem; }

/* Listing */
.listing-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sort select { padding: 8px; border-radius: 8px; border: 1px solid var(--line); font: inherit; margin-left: 6px; }
.pager { display: flex; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pager a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.pager a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Product page */
.crumbs { margin-bottom: 16px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.gallery > img { border-radius: var(--radius); background: #f3ece6; aspect-ratio: 1; object-fit: cover; width: 100%; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; }
.thumbs button { border: 1px solid var(--line); background: none; padding: 0; border-radius: 8px; overflow: hidden; width: 64px; cursor: pointer; }
.buy h1 { margin-top: 0; }
.addform { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qty input { width: 70px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; margin-left: 6px; }
.perk-list { list-style: none; padding: 0; margin: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.perk-list li { padding: 8px 0; }
.desc { color: #4a413c; }

/* Cart */
table.cart { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.cart th, .cart td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.cart th.r, .cart td.r { text-align: right; }
.cart input { width: 64px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.cart-item { display: flex; align-items: center; gap: 12px; }
.cart-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.totals { max-width: 380px; margin-left: auto; margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.totals > div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); margin: 8px 0 14px; padding-top: 10px; }

/* Tracking */
.steps { list-style: none; display: flex; padding: 0; margin: 20px 0; gap: 8px; }
.steps li { flex: 1; text-align: center; padding: 10px 6px; border-radius: 10px; background: #efe7e0; color: var(--muted); font-weight: 600; font-size: .9rem; }
.steps li.done { background: var(--accent); color: #fff; }
.big-icon { font-size: 4rem; }

.prose h2 { margin-top: 28px; }

/* Footer */
.site-footer { background: #2b2522; color: #e8dfd8; padding: 40px 0 24px; }
.site-footer a { color: #e8dfd8; display: block; text-decoration: none; margin: 4px 0; }
.site-footer a:hover { color: #fff; }
.site-footer .logo { color: #fff; }
.site-footer .muted { color: #b8aca4; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-grid h4 { margin: 0 0 8px; }
.copyright { border-top: 1px solid #4a413c; margin-top: 24px; padding-top: 16px; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 28px; }
  .hero-art { order: -1; }
  .hero-art img { width: 170px; }
  .product { grid-template-columns: 1fr; gap: 20px; }
  .perks, .footer-grid { grid-template-columns: 1fr; }
  .header-row { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .logo img { height: 42px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cart th:nth-child(2), .cart td:nth-child(2) { display: none; }
  .totals { max-width: none; }
}
