/* The shop's layout and components, shared by every theme. A theme is only its theme.css token
   block, appended after this file by the generator - so a rule added here reaches every theme and
   the two cannot drift into one shop having a fix the other is missing.

   Self-contained by design: no CDN fonts, no frameworks. A farm's web space may be slow,
   offline-mirrored, or on a rural connection, and the shop must render identically in all. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.011em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.75rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 2px; }
img { max-width: 100%; display: block; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.band { padding-block: clamp(2rem, 1.2rem + 3vw, 3.75rem); }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Keyboard users land here first; it stays out of the way until focused. */
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--accent); color: var(--accent-ink);
    padding: .65rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* --- Header --- */

.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-row { display: flex; align-items: center; gap: 1rem; padding-block: .85rem; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; margin-right: auto; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px; flex: none; background-color: var(--accent);
    /* The same leaf as the favicon, so the tab and the header agree. */
    -webkit-mask: center/22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 25c0-7 4-11 10-11 0 7-4 11-10 11zm0 0c0-7-4-11-10-11 0 7 4 11 10 11z' fill='%23fff'/%3E%3C/svg%3E");
    mask: center/22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 25c0-7 4-11 10-11 0 7-4 11-10 11zm0 0c0-7-4-11-10-11 0 7 4 11 10 11z' fill='%23fff'/%3E%3C/svg%3E");
}
.brand-name { display: block; font-weight: 700; font-size: 1.06rem; }
.tagline { display: block; margin: 0; font-size: .8rem; color: var(--ink-soft); }

.site-nav { display: flex; gap: .25rem; }
.site-nav a { display: inline-block; padding: .45rem .75rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav a:hover { background: var(--paper); }
.site-nav a.is-current { background: var(--accent); color: var(--accent-ink); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; cursor: pointer; }
.nav-bars, .nav-bars::before, .nav-bars::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; }
.nav-bars::before, .nav-bars::after { content: ""; position: absolute; }
.nav-bars::before { top: -6px; }
.nav-bars::after { top: 6px; }

.cart-toggle {
    background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
    padding: .5rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: .5rem;
}
.cart-count { background: rgba(255,255,255,.25); border-radius: 999px; min-width: 1.5rem; padding: 0 .4rem; text-align: center; font-size: .85rem; }

/* --- Hero --- */

.hero { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--paper)), var(--paper)); border-bottom: 1px solid var(--line); }
.hero-inner { padding-block: clamp(2.5rem, 1.5rem + 5vw, 5.5rem); max-width: 46rem; }
.hero-lede { font-size: 1.15rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 0; }

/* --- Buttons --- */

.btn { display: inline-block; border: 1px solid transparent; border-radius: 999px; padding: .6rem 1.15rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--card); }
.btn-block { display: block; width: 100%; margin-top: .75rem; }

/* --- Home sections --- */

.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.promises h2 { font-size: 1.05rem; }
.promises p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

.callout { text-align: center; }
.callout p:last-child { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

.group-head { margin-top: 2rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }

/* --- Products --- */

.product-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); }
.product-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.product-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper); }

/* A product with no photo still needs to look deliberate rather than broken. */
.product-image-placeholder {
    background:
        radial-gradient(circle at 30% 70%, color-mix(in srgb, var(--accent) 18%, transparent) 0 22%, transparent 23%),
        radial-gradient(circle at 68% 40%, color-mix(in srgb, var(--accent) 12%, transparent) 0 18%, transparent 19%),
        var(--paper);
}

.product-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.product-name { margin: 0 0 .15rem; }
.product-grade { margin: 0 0 .5rem; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.product-desc { color: var(--ink-soft); font-size: .92rem; margin-bottom: 1rem; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.product-price { font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.product-unit { display: block; font-size: .78rem; font-weight: 500; color: var(--ink-soft); }

.grid-empty { color: var(--ink-soft); text-align: center; padding: 2.5rem 0; }

/* --- Prose pages --- */

.prose { max-width: 44rem; }
.prose h2 { margin-top: 2rem; }
.prose ol, .prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .5rem; }
.page-lede { color: var(--ink-soft); }

/* --- Contact --- */

.contact-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.contact-card h2 { margin-top: 0; font-size: 1.15rem; }
.contact-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; }
.contact-list dt { color: var(--ink-soft); font-size: .88rem; }
.contact-list dd { margin: 0; font-weight: 500; }
address { font-style: normal; line-height: 1.7; }

/* --- Footer --- */

.site-footer { background: var(--card); border-top: 1px solid var(--line); margin-top: 3rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr; padding-block: 2.5rem 1.5rem; }
.footer-brand { font-weight: 700; margin-bottom: .5rem; }
.site-footer h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--line); padding-block: 1rem; }
.footer-legal p { margin: 0; font-size: .85rem; color: var(--ink-soft); }

/* --- Basket --- */

.cart-panel { position: fixed; inset: 0; background: var(--overlay); display: flex; justify-content: flex-end; z-index: 50; }
.cart-panel[hidden] { display: none; }
.cart-box { background: var(--card); width: min(26rem, 100%); height: 100%; padding: 1.5rem; overflow-y: auto; display: flex; flex-direction: column; }
.cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cart-head h2 { margin: 0; }
.cart-close { background: none; border: 0; font-size: 1.75rem; line-height: 1; cursor: pointer; color: var(--ink-soft); }

.cart-line { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.cart-line-main { flex: 1; }
.cart-line-name { font-weight: 600; }
.cart-line-unit { font-size: .8rem; color: var(--ink-soft); }
.cart-qty { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; }
.cart-qty button { width: 1.85rem; height: 1.85rem; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; cursor: pointer; font-size: 1rem; line-height: 1; }
.cart-qty span { min-width: 1.6rem; text-align: center; }
.cart-line-total { font-weight: 600; white-space: nowrap; }
.cart-empty { color: var(--ink-soft); padding: 1.5rem 0; }
.cart-total-row { display: flex; justify-content: space-between; padding: 1rem 0; font-size: 1.1rem; }
.cart-note { font-size: .85rem; color: var(--ink-soft); }

#checkout-form label { display: block; font-size: .88rem; font-weight: 600; margin-top: .75rem; }
#checkout-form input, #checkout-form textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--paper); }
.checkout-title { margin-top: 0; }
.checkout-privacy { font-size: .82rem; color: var(--ink-soft); margin-top: 1rem; }
.form-error { color: #a3231a; font-weight: 600; }
.order-ref { font-size: .9rem; color: var(--ink-soft); }

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Small screens --- */

@media (max-width: 760px) {
    .nav-toggle { display: block; order: 2; }
    .cart-toggle { order: 3; }
    .site-nav { order: 4; flex-basis: 100%; flex-direction: column; border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .6rem; }
    .site-nav:not(.is-open) { display: none; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media print {
    .site-header, .site-footer, .cart-panel, .hero-actions, .skip-link { display: none !important; }
}

/* Farm Shop theme - warmer, squarer, closer to a roadside board than a market stall.
   Tokens only. The layout lives in _shared/style.css and is appended before this. */

:root {
    --ink: #2b2118;
    --ink-soft: #6b5a49;
    --paper: #fdf9f3;
    --card: #ffffff;
    --line: #e8ddcd;
    --accent: #b45309;          /* overridden per publish by the generator */
    --accent-ink: #ffffff;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(43, 33, 24, .06), 0 8px 24px rgba(43, 33, 24, .06);
    --overlay: rgba(43, 33, 24, .45);
    --wrap: 1120px;
}
