/* shop-kira – one stylesheet for shop + admin. No external fonts or scripts (strict CSP). */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #6b665e;
  --line: #e7e1d7;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fde7da;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171513; --surface: #211e1b; --text: #f3efe9; --muted: #a8a197; --line: #36312b;
    --accent: #fb923c; --accent-ink: #1a0f06; --accent-soft: #3a2415;
    --ok: #4ade80; --ok-soft: #163222; --warn: #fbbf24; --danger: #f87171; --danger-soft: #3b1717;
    --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.3rem; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* header / footer */
.site-header, .admin-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.brand small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.site-nav, .admin-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.site-nav a, .admin-nav a { color: var(--text); text-decoration: none; padding: 4px 0; }
.site-nav a:hover, .admin-nav a:hover { color: var(--accent); }
.admin-header { background: var(--text); }
.admin-header .brand, .admin-header .admin-nav a, .admin-header .linkish { color: var(--bg); }
.admin-header .brand small { color: var(--bg); opacity: .7; }
.announce { background: var(--accent); color: var(--accent-ink); text-align: center; padding: 8px 16px; font-weight: 600; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.site-footer a { color: var(--muted); }

/* buttons */
.btn {
  display: inline-block; border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { padding: 5px 12px; font-size: .875rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }

/* flashes / tags */
.flashes { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 8px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-muted { background: var(--line); color: var(--muted); }

/* shop */
.hero { padding: 16px 0 32px; }
.lede { font-size: 1.15rem; color: var(--muted); margin-top: -.3em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; color: var(--text); text-decoration: none; border: 1px solid var(--line); display: flex; flex-direction: column; }
.card:hover { border-color: var(--accent); }
.card-img { aspect-ratio: 1 / 1; background: var(--line); display: grid; place-items: center; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 14px; }
.card-body h3 { font-size: 1rem; margin-bottom: 4px; }
.card-body p { margin: 0 0 4px; }
.price { font-weight: 700; }
.price.big { font-size: 1.5rem; margin: 0 0 8px; }
.no-photo { color: var(--muted); font-size: .9rem; display: grid; place-items: center; }
.no-photo.big { aspect-ratio: 1 / 1; background: var(--line); border-radius: var(--radius); }
.no-photo.tiny { font-size: .7rem; width: 48px; height: 48px; background: var(--line); border-radius: 6px; }
.empty { color: var(--muted); padding: 24px 0; }
.crumbs { margin: 0 0 16px; }
.product { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) { .product { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.gallery-main { width: 100%; border-radius: var(--radius); }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gallery-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.stock { font-weight: 600; margin: 0 0 12px; }
.stock.ok { color: var(--ok); }
.stock.out { color: var(--danger); }
.colour-choice { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
.swatches { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.swatches li { display: flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); flex: none; vertical-align: middle; }
.prose { max-width: 70ch; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; }
.page { padding-bottom: 24px; }
.error-page { text-align: center; padding: 48px 0; }

/* admin */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 20px; box-shadow: var(--shadow); }
.panel.narrow { max-width: 420px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.title-row h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--text); text-decoration: none; display: flex; flex-direction: column; }
.stat strong { font-size: 1.8rem; line-height: 1; }
.stat span { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.stat.warn strong { color: var(--warn); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 4px; font-weight: 600; }
.form label.check, .form label.radio { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form .indent { margin-left: 26px; font-weight: 500; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 10px; margin: 0; }
.form legend { font-weight: 700; padding: 0 6px; }
.form small { font-weight: 400; }
.label-text { margin: 0 0 6px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), textarea, select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; width: 100%;
}
input[type=color] { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
.form-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.colour-picks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; display: block; overflow-x: auto; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.row-muted td { opacity: .6; }
.thumb-cell img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; }
.photo-grid figcaption { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.danger-zone { border-color: var(--danger-soft); }
.help { background: var(--bg); border-radius: 8px; padding: 8px 12px; }
.help summary { cursor: pointer; font-weight: 600; }
code { background: var(--line); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
