/* ---------- Tokens ---------- */
:root {
  --bg: #faf7f2;
  --paper: #ffffff;
  --ink: #1f1b16;
  --muted: #6f675d;
  --line: #e8e1d6;
  --accent: #d1492e;        /* change this to re-colour the shop */
  --accent-ink: #ffffff;
  --accent-soft: #fbe7e1;
  --ok: #2f7a4b;
  --warn: #a86a00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31,27,22,.06), 0 8px 24px rgba(31,27,22,.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: ui-serif, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding-bottom: 64px; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: 28px 0 18px; }
h2 { font-size: 1.25rem; margin: 0 0 14px; }
code { background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.r { text-align: right; }
.warn-text { color: var(--warn); font-weight: 600; display: block; }
.inline { display: inline; }

/* ---------- Header / footer ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo small { font-family: var(--font); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; background: var(--ink); color: var(--paper); padding: 2px 7px; border-radius: 99px; }
.logo-mark { width: 22px; height: 22px; border-radius: 50% 50% 6px 6px; background: var(--accent); box-shadow: inset 0 -6px 0 rgba(0,0,0,.15); }
nav { display: flex; align-items: center; gap: 22px; }
nav a, .linklike { color: var(--ink); text-decoration: none; font-weight: 500; }
nav a:hover, .linklike:hover { color: var(--accent); }
.pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .78rem; font-weight: 700; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; padding: 24px 0; }
.site-footer a { color: inherit; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 12px 22px; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.linklike.danger, .danger { color: #b3261e; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
.form label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
input, select, textarea { font: inherit; color: inherit; background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.narrow { max-width: 420px; margin: 40px auto; }
.delete-form { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Flash messages ---------- */
.flash { margin: 20px 0 0; padding: 12px 16px; border-radius: 10px; background: #e7f4ec; color: var(--ok); border: 1px solid #cbe7d5; }
.flash-warn { background: #fff4de; color: var(--warn); border-color: #f2dfb6; }
.flash-error { background: #fdeceb; color: #b3261e; border-color: #f5cdca; }

/* ---------- Shop home ---------- */
.hero { padding: 36px 0 8px; }
.hero h1 { margin: 0 0 6px; }
.hero p { margin: 0; color: var(--muted); font-size: 1.1rem; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin: 26px 0 22px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .chips { margin: 0; }
.chip { padding: 7px 14px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .92rem; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search input { width: 240px; border-radius: 99px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.card { background: var(--paper); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(31,27,22,.06), 0 14px 32px rgba(31,27,22,.1); }
.thumb { aspect-ratio: 1; background: #f1ebe2; position: relative; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.noimg { color: var(--muted); font-size: .9rem; }
.tag { position: absolute; top: 10px; left: 10px; background: var(--ink); color: var(--paper); font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.tag.low { background: var(--accent); }
.sold-out .thumb img { filter: grayscale(1); opacity: .6; }
.card-body { padding: 14px 16px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-body h2 { font-family: var(--font); font-size: 1rem; font-weight: 600; margin: 0; }
.price { font-weight: 700; white-space: nowrap; }
.price.big { font-size: 1.6rem; margin: 0 0 6px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- Product page ---------- */
.crumbs { margin: 24px 0 0; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; margin-top: 20px; }
.product-photo { aspect-ratio: 1; background: #f1ebe2; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-photo.small { margin-bottom: 12px; }
.product-info h1 { margin-top: 0; }
.stock { color: var(--ok); font-weight: 600; margin: 0 0 20px; }
.stock.out { color: #b3261e; }
.add-form { display: flex; gap: 12px; align-items: end; margin-bottom: 28px; }
.add-form label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.add-form input { width: 80px; }
.add-form { flex-wrap: wrap; }
.add-form .variant-pick { flex: 1 1 100%; }
.add-form select { width: 100%; }
.variant-name { display: block; color: var(--muted); font-size: .85rem; }
.variants { border: 0; padding: 0; margin: 0 0 16px; }
.variants legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.variant-table { margin-bottom: 10px; box-shadow: none; border: 1px solid var(--line); }
.variant-table th, .variant-table td { padding: 8px 10px; }
.variant-table input[type=number] { width: 90px; }
.variant-table .check { white-space: nowrap; font-size: .9rem; }
.small-btn { padding: 8px 16px; font-size: .9rem; }

/* Postage choice at checkout */
.ship-options { display: grid; gap: 8px; }
.form label.ship-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; font-weight: 500; }
.ship-option input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.ship-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ship-name { flex: 1; }
.ship-name small { display: block; font-weight: 400; }
.ship-price { font-weight: 700; white-space: nowrap; }
.ship-tag { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.order-notes { border: 1.5px dashed var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; white-space: normal; }

/* Checkout tick boxes */
.form label.check.consent { align-items: flex-start; }
.consent input { margin-top: 2px; flex: none; }

/* Subscribers */
.sub-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 16px 0; }
.sub-tools form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.sub-tools input { width: auto; min-width: 200px; }
.description { border-top: 1px solid var(--line); padding-top: 20px; color: #3b352e; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fcfaf7; }
.table th.r, .table td.r { text-align: right; }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { border-bottom: 0; }
.table .grand td { font-weight: 700; }
.table .item { display: flex; align-items: center; gap: 12px; }
.table .item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.table .item a { color: var(--ink); font-weight: 600; text-decoration: none; }
.table input[type=number] { width: 76px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fcfaf7; }

.basket-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.totals { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; width: min(340px, 100%); display: grid; gap: 8px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 6px; }

/* ---------- Checkout ---------- */
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: start; }
.summary { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.sum-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.sum-line.grand { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
address { font-style: normal; line-height: 1.6; }
.thanks { max-width: 520px; margin: 40px auto; text-align: center; }
.thanks .summary { text-align: left; margin: 24px 0; }
.tick { width: 64px; height: 64px; border-radius: 50%; background: #e7f4ec; color: var(--ok); display: grid; place-items: center; font-size: 2rem; margin: 0 auto; }

/* ---------- Admin ---------- */
.is-admin { --accent: #2f5bd1; --accent-soft: #e3eafb; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.order-head h1 { margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 28px; }
.stat { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; color: var(--muted); }
.stat a { color: inherit; text-decoration: none; }
.stat span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--ink); font-family: var(--display); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.badge-paid { background: #e7f4ec; color: var(--ok); }
.badge-shipped { background: #e3eafb; color: #2f5bd1; }
.badge-pending { background: #fff4de; color: var(--warn); }
.badge-cancelled { background: #eee; color: #666; }

/* ---------- Info pages ---------- */
.page { max-width: 720px; }
.page-body { font-size: 1.05rem; }
.page-body h2 { margin: 32px 0 10px; }
.page-body ul { padding-left: 1.2em; }
.page-body li { margin: 4px 0; }
.contact-form { margin-top: 28px; background: var(--paper); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.help { margin: 8px 0 0; padding-left: 1.1em; line-height: 1.9; }
.footer-cols { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.footer-links { gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-weight: 400; }

/* ---------- Home page ---------- */
.home-title { text-align: center; padding: 56px 0 40px; }
.home-title h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0; }
.home-title p { margin: 10px 0 0; color: var(--muted); font-size: 1.2rem; }
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.feature-image { display: flex; justify-content: center; align-items: center; }
.feature-image.empty { aspect-ratio: 4 / 3; background: #f1ebe2; border-radius: 10px; text-align: center; padding: 16px; }
/* Whole picture is always shown, at its own shape: never cropped */
.feature-image img { display: block; width: auto; height: auto; max-width: 100%; max-height: 600px; border-radius: 10px; }
.feature-text .page-body h2:first-child { margin-top: 0; }
.section-title { font-size: 1.7rem; margin: 56px 0 20px; text-align: center; }
.center { text-align: center; }
.news { max-width: 820px; margin: 0 auto; }
.news-item { display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: start; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.news-img { width: 160px; height: 160px; object-fit: cover; border-radius: 10px; }
.news-date { display: grid; place-content: center; text-align: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.news-date span { display: block; font-family: var(--display); font-size: 3rem; line-height: 1; letter-spacing: 0; }
.news-item h3 { font-family: var(--display); font-size: 1.35rem; margin: 4px 0 8px; }
.news-item .page-body p:first-child { margin-top: 0; }
.news-item .page-body p:last-child { margin-bottom: 0; }
.form > .summary { margin-bottom: 10px; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .product, .checkout { grid-template-columns: 1fr; gap: 24px; }
  .feature { gap: 20px; padding: 16px; }
  .row { grid-template-columns: 1fr; }
  .search, .search input { width: 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card-body { flex-direction: column; gap: 2px; padding: 10px 12px 14px; }
  nav { gap: 14px; font-size: .95rem; }
  .site-header nav a.pg { display: none; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 4px 16px; }
  .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85rem; }
  .table td.r { text-align: left; }
  .table tfoot { display: block; }
}

/* Phones only: stack the home picture above its text, and shrink news pictures */
@media (max-width: 600px) {
  .feature { grid-template-columns: 1fr; }
  .news-item { grid-template-columns: 88px 1fr; gap: 14px; padding: 14px; }
  .news-img { width: 88px; height: 88px; }
  .news-date span { font-size: 2rem; }
}

/* ---------- Print (packing slip) ---------- */
@media print {
  .site-header, .site-footer, form, .crumbs, button { display: none !important; }
  .checkout { grid-template-columns: 1fr 1fr; }
  .table, .summary { box-shadow: none; border: 1px solid #ccc; }
}
