/*
  Mena Made public site (design/rules.md, 11 Nov 2026; layout from design/redesign/storefront-v2.md).
  Built on tokens.css and base.css; every rule here is for the public pages only (body.site).
  Text sizes, weights and the font come only from base.css: h1 Display, h2/h3 Heading, p Body,
  .t-small Small, .t-lead Large body. This file sets layout and colour, never type.
  The parts: a cream sticky header; an opening with the logo and a photo inside the page width; full-width
  bands (cream, or the one dark brown); product cards; plain bordered panels for forms and the order
  summary; hairline rows; the one .btn (reversed to cream on dark) and plain links. No status labels,
  no dots, no left bars, no icons, no shadows.
  Colour (design/rules.md): three backgrounds (cream page, white --mm-card panels, dark --mm-cocoa);
  text in ink, with --mm-ink-soft only for Small text (cream and --mm-cream-soft on dark); the
  red-brown only for links; one hairline colour (--mm-line, --mm-cocoa-line on dark). Phone first (375px); 560px two-up cards; 960px desktop header;
  1024px order column.
*/

.wrap { max-width: var(--mm-shop-max); margin: 0 auto; padding: 0 var(--mm-gutter); }
.site-main { display: block; min-height: 50vh; }
.page-notice { padding-top: var(--mm-space-5); }

/* ---- A notice in the page flow: a heading and a sentence, as plain text ---- */
.page-note { display: grid; gap: var(--mm-space-2); max-width: 44rem; }
.page-note--error { color: var(--mm-danger); }

/* ---- The one button on the phone order bar: reversed like base.css's dark band ---- */
.order-bar .btn { background: var(--mm-cream); color: var(--mm-cocoa); }
.order-bar .btn:hover { background: var(--mm-card); color: var(--mm-cocoa); }

/* Fields on the public site: on white */
.site .input, .site input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .site select, .site textarea {
  background: var(--mm-card);
}

/* ---- Header: cream, sticky; logo, nav, then account and the Order button ---- */
.site-header {
  position: sticky; top: 0; z-index: 30; background: var(--mm-cream); border-bottom: 1px solid var(--mm-line);
}
.site-header__inner { display: flex; align-items: center; gap: var(--mm-space-5); min-height: var(--mm-header-h); }
.site-logo { display: block; flex: none; }
.site-logo img { height: 36px; width: auto; }
.site-nav { display: none; }
.site-nav__list { list-style: none; padding: 0; display: flex; gap: var(--mm-space-6); }
.site-nav a, .site-account, .site-menu__panel a { color: var(--mm-ink); text-decoration: none; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.site-nav a:hover, .site-account:hover, .site-menu__panel a:hover { color: var(--mm-ink); text-decoration: underline; text-underline-offset: 6px; }
.site-actions { margin-left: auto; display: flex; align-items: center; gap: var(--mm-space-3); }
.site-icon { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.site-account { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px; }
.site-order__more { display: none; }

.site-menu { position: static; }
.site-menu__toggle {
  list-style: none; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px;
  color: var(--mm-ink); -webkit-tap-highlight-color: transparent;
}
.site-menu__toggle::-webkit-details-marker { display: none; }
.site-menu__word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.site-menu__bars, .site-menu__bars::before, .site-menu__bars::after {
  display: block; width: 22px; height: 1.6px; background: currentColor; border-radius: 2px; transition: transform var(--mm-duration) var(--mm-ease);
}
.site-menu__bars { position: relative; }
.site-menu__bars::before, .site-menu__bars::after { content: ""; position: absolute; left: 0; }
.site-menu__bars::before { top: -7px; }
.site-menu__bars::after { top: 7px; }
.site-menu[open] .site-menu__bars { background: transparent; }
.site-menu[open] .site-menu__bars::before { transform: translateY(7px) rotate(45deg); }
.site-menu[open] .site-menu__bars::after { transform: translateY(-7px) rotate(-45deg); }
.site-menu__panel {
  position: absolute; left: 0; right: 0; top: 100%; background: var(--mm-cream); border-bottom: 1px solid var(--mm-line);
}
.site-menu__panel ul { list-style: none; padding: var(--mm-space-2) var(--mm-gutter) var(--mm-space-4); margin: 0 auto; max-width: var(--mm-shop-max); }
.site-menu__panel li + li { border-top: 1px solid var(--mm-line); }
.site-menu__panel a { display: flex; align-items: center; min-height: 56px; }
@media (min-width: 640px) {
  .site-account { display: inline-flex; }
  .site-order__more { display: inline; }
  .site-account__label { display: none; }
}
@media (min-width: 960px) {
  .site-header__inner { gap: var(--mm-space-8); }
  .site-logo img { height: 52px; }
  .site-nav { display: block; }
  .site-menu { display: none; }
  .site-account__label { display: inline; }
  .site-actions { gap: var(--mm-space-5); }
}

/* ---- Photos (the baker's, or the sample photos in public/img/) ---- */
.photo { position: relative; overflow: hidden; border-radius: var(--mm-radius-card); background-color: var(--mm-cream); }
.photo > picture { display: block; width: 100%; height: 100%; }
.photo > img, .photo > picture > img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Full-width bands: cream (a hairline between two cream bands), or the one dark brown ---- */
.band { padding: var(--mm-band-pad) 0; }
.band--cocoa { background: var(--mm-cocoa); color: var(--mm-cream); }
.band--cocoa h2, .band--cocoa h3, .band--cocoa a:not(.btn) { color: var(--mm-cream); }
.band--cocoa .t-small { color: var(--mm-cream-soft); }
.band--cocoa :focus-visible { outline-color: var(--mm-cream); }
.band--light + .band--light { border-top: 1px solid var(--mm-line); }

/* ---- Opening: on the cream page and inside the page width. The round logo, the headline, one
   line and the one button; the bread photo under them on a phone and beside them from 900px. ---- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
/* Depth: js/hero-parallax.js slides the photo down inside the band at half the scroll speed (a
   transform only), so it moves up slower than the words and the page slides over it. Still for
   people who ask for less motion, and when the script does not run. */
.hero--parallax .hero__media { will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .hero__media { transform: none !important; will-change: auto; }
}
.hero__scrim { position: absolute; inset: 0; z-index: -1; background: rgba(43, 27, 20, 0.6); }
.hero__inner { display: flex; align-items: center; justify-content: center; min-height: 30rem; padding-top: var(--mm-band-pad); padding-bottom: var(--mm-band-pad); }
.hero__content { display: grid; justify-items: center; text-align: center; }
.hero__logo { width: 7.5rem; height: auto; border-radius: 50%; margin-bottom: var(--mm-space-5); }
.hero__title { margin: 0 0 var(--mm-space-3); color: var(--mm-cream); }
.hero__lead { max-width: 30rem; color: var(--mm-cream); }
.hero__actions { margin-top: var(--mm-space-6); }
@media (min-width: 700px) {
  .hero__media img { object-position: 60% 50%; }
  .hero__inner { min-height: clamp(28rem, 52vh, 34rem); }
  .hero__logo { width: 9rem; }
}

/* ---- Week: one card (the same card as the order panel): the state as its heading, then open,
   close and collect, each a Small muted label over plain body text. On a phone the three stack,
   split by hairlines; from 900px the heading and the three share one row. ---- */
.week-band { padding-top: var(--mm-band-pad); }
.week-notice {
  display: grid; gap: var(--mm-space-4);
  background: var(--mm-card); border: 1px solid var(--mm-line); border-radius: var(--mm-radius-card); padding: var(--mm-space-5);
}
.week-state { margin: 0; }
.week { display: grid; margin: 0; }
.week__cell { display: grid; gap: var(--mm-space-1); align-content: start; padding: var(--mm-space-3) 0; }
.week__cell + .week__cell { border-top: 1px solid var(--mm-line); }
.week dt { color: var(--mm-ink-soft); }
.week dd { margin: 0; }
@media (min-width: 900px) {
  .week-notice { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); align-items: start; gap: var(--mm-space-6); padding: var(--mm-space-6); }
  .week { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--mm-space-6); }
  .week__cell { padding: 0; }
  .week__cell + .week__cell { border-top: 0; }
}

/* ---- Menu head ---- */
.menu-head { display: grid; gap: var(--mm-space-3); justify-items: start; margin-bottom: var(--mm-space-7); max-width: 46rem; }

/* ---- Order section ---- */
.order-section { padding: var(--mm-band-pad) 0; scroll-margin-top: var(--mm-header-h); }
.order-page .order-section { padding-top: var(--mm-space-7); }
.order { display: grid; gap: var(--mm-space-7); }
.order-section .error-summary { margin-bottom: var(--mm-space-6); }
@media (min-width: 1024px) {
  .order { grid-template-columns: minmax(0, 1fr) 23rem; gap: var(--mm-space-7); align-items: start; }
  .summary { position: sticky; top: calc(var(--mm-header-h) + var(--mm-space-5)); }
}
.step { border: 0; padding: 0; margin: 0; min-width: 0; }
.step:focus { outline: none; }
.step > .field-error { margin-bottom: var(--mm-space-3); }

/* Also open at the same time (rare): a panel above the menu */
.also-open { padding: var(--mm-space-4) var(--mm-space-5); margin-top: var(--mm-space-6); background: var(--mm-card); border: 1px solid var(--mm-line); border-radius: var(--mm-radius-card); display: grid; gap: var(--mm-space-2); }
.also-open ul { list-style: none; padding: 0; display: grid; gap: 4px; }

/* ---- Product grid and cards ---- */
.product-grid { display: grid; gap: var(--mm-space-5); }
@media (min-width: 560px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .product-grid--wide { grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); } }

.product-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--mm-card); border: 1px solid var(--mm-line); border-radius: var(--mm-radius-card); overflow: hidden;
  transition: border-color var(--mm-duration) var(--mm-ease);
}
.product-card__media { aspect-ratio: 1 / 1; border-radius: 0; }
@media (min-width: 560px) { .product-card__media { aspect-ratio: 4 / 5; } }
.product-card__body { display: grid; gap: var(--mm-space-2); align-content: start; padding: var(--mm-space-5) var(--mm-space-5) var(--mm-space-4); }
.product-card__name { color: var(--mm-ink); }
.product-card__kind { color: var(--mm-ink-soft); margin-top: calc(-1 * var(--mm-space-1)); }
.product-card__facts { color: var(--mm-ink-soft); }
.product-card__ingredients { color: var(--mm-ink-soft); }
.product-card__ingredients summary {
  cursor: pointer; width: fit-content; min-height: 32px; display: flex; align-items: center; gap: 6px; color: var(--mm-ink);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--mm-line);
}
.product-card__ingredients summary:hover { text-decoration-color: var(--mm-ink); }
.product-card__ingredients p { margin-top: 2px; }
.product-card__buy {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--mm-space-3); flex-wrap: wrap;
  padding: var(--mm-space-4) var(--mm-space-5); border-top: 1px solid var(--mm-line); min-height: 76px;
}
.product-card__price, .price { color: var(--mm-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.product-card__note { color: var(--mm-ink-soft); text-align: right; }
.product-card > .field-error { padding: 0 var(--mm-space-5) var(--mm-space-4); }
.product-card.is-sold .product-card__media > img { filter: grayscale(0.55); opacity: 0.7; }
.product-card.is-picked { border-color: var(--mm-ink); }

/* The quantity control: − and + either side of the number (a plain number box without JavaScript) */
.site .is-enhanced .stepper {
  height: 44px; border: 1px solid var(--mm-line); background: var(--mm-card); padding: 0 2px;
  transition: background-color var(--mm-duration) var(--mm-ease), border-color var(--mm-duration) var(--mm-ease);
}
.site .is-enhanced .stepper:focus-within { border-color: var(--mm-focus); outline: 2px solid var(--mm-focus); outline-offset: 2px; }
.site .is-enhanced .stepper__input { width: 2.25rem !important; color: inherit !important; }
.site .stepper__btn { width: 38px; height: 38px; color: inherit; }
.site .stepper__btn:hover:not(:disabled) { background: var(--mm-cream); }
.site .stepper__btn:disabled { color: var(--mm-line); }
.site .is-enhanced .product-card.is-picked .stepper { border-color: var(--mm-ink); }

/* ---- Checkout: plain panels, each with a heading ---- */
.checkout { display: grid; gap: var(--mm-space-4); margin-top: var(--mm-space-8); }
.panel {
  background: var(--mm-card); border: 1px solid var(--mm-line); border-radius: var(--mm-radius-card);
  padding: var(--mm-space-5) var(--mm-space-4) var(--mm-space-6);
}
@media (min-width: 560px) { .panel { padding: var(--mm-space-6) var(--mm-space-6) var(--mm-space-7); } }
legend.step-head { float: left; width: 100%; padding: 0; margin-bottom: var(--mm-space-5); }
legend.step-head + * { clear: both; }

/* Choices (collection, payment): plain rows split by hairlines inside the card, no box per choice.
   label.choice-row > input[type=radio] + span.choice-row__body */
.choice-rows { display: grid; }
.choice-rows:focus { outline: none; }
.choice-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--mm-space-4); align-items: start;
  padding: var(--mm-space-4) 0; min-height: 56px; cursor: pointer;
}
.choice-row + .choice-row { border-top: 1px solid var(--mm-line); }
.choice-rows > .choice-row:first-child { padding-top: 0; }
.choice-rows > .choice-row:last-child { padding-bottom: 0; }
.choice-row:has(input:focus-visible) { outline: 2px solid var(--mm-focus); outline-offset: 4px; }
.choice-row input[type="radio"] { margin: 3px 0 0; accent-color: var(--mm-cocoa); }
.choice-row--single { display: block; padding: 0; min-height: 0; border: 0; background: none; }
.choice-row--single:has(input:checked) { border: 0; }
.choice-row--single .choice-row__body { display: none; }
.choice-row__body { display: grid; gap: 2px; min-width: 0; }
.choice-row__note { color: var(--mm-ink-soft); }
.choice-row__fee { display: block; margin-top: 2px; }
.choice-row.is-full { cursor: not-allowed; background: var(--mm-cream); }
.delivery-field { margin-top: var(--mm-space-5); }
@supports selector(:has(*)) {
  .order-form:not(:has(input[data-kind="delivery"]:checked)) .delivery-field:not(.has-error) { display: none; }
}

/* Fields in the order form */
.fields { display: grid; gap: var(--mm-space-5); }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; column-gap: var(--mm-space-5); } .field--full { grid-column: 1 / -1; } }
/* Side by side, the boxes line up: a hint, then an error, show under the box (the markup keeps
   them before it, so screen readers still hear them first). */
.fields > .field > .hint { order: 1; }
.fields > .field > .field-error { order: 2; }
.field--narrow { max-width: 20rem; margin-top: var(--mm-space-5); }
.optin { margin-top: var(--mm-space-5); padding-top: var(--mm-space-3); border-top: 1px solid var(--mm-line); }

/* ---- Your order: the cart panel (sticky on desktop) ---- */
.summary {
  display: grid; gap: var(--mm-space-4); scroll-margin-top: calc(var(--mm-header-h) + var(--mm-space-4));
  background: var(--mm-card); border: 1px solid var(--mm-line); border-radius: var(--mm-radius-card); padding: var(--mm-space-5);
}
@media (min-width: 560px) { .summary { padding: var(--mm-space-6); } }
.summary__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--mm-space-3); padding-bottom: var(--mm-space-4); border-bottom: 1px solid var(--mm-line); }
.summary__live { display: grid; gap: var(--mm-space-3); }
.order-form:not(.is-enhanced) .summary__live { display: none; }
.order-form.is-enhanced .summary__nojs { display: none; }
.summary__nojs { color: var(--mm-ink-soft); }
.summary__lines { list-style: none; padding: 0; display: grid; }
.summary__lines li { display: flex; justify-content: space-between; gap: var(--mm-space-3); padding: var(--mm-space-2) 0; }
.summary__lines li + li { border-top: 1px solid var(--mm-line); }
.summary__lines li span:last-child { font-variant-numeric: tabular-nums; }
.summary__totals { border-top: 1px solid var(--mm-line); padding-top: var(--mm-space-3); display: grid; gap: var(--mm-space-2); margin: 0; }
.summary__row { display: flex; justify-content: space-between; gap: var(--mm-space-3); }
.summary__row dd { margin: 0; font-variant-numeric: tabular-nums; }
.summary__row--total { align-items: baseline; padding-top: var(--mm-space-3); border-top: 1px solid var(--mm-line); }
.summary__collect { color: var(--mm-ink-soft); }
.summary .btn { width: 100%; }
.summary__trust { color: var(--mm-ink-soft); }

/* Phone order bar: cocoa, shown by order-form.js after the first loaf */
.order-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: var(--mm-space-4);
  min-height: 64px; padding: 8px var(--mm-gutter) calc(8px + env(safe-area-inset-bottom));
  background: var(--mm-cocoa); color: var(--mm-cream);
  transform: translateY(110%); transition: transform 200ms var(--mm-ease);
}
.order-bar.is-shown { transform: none; }
.order-bar__text { font-variant-numeric: tabular-nums; }
.order-bar :focus-visible { outline-color: var(--mm-cream); }
body.has-order-bar { padding-bottom: 64px; }
@media (min-width: 1024px) { .order-bar { display: none !important; } body.has-order-bar { padding-bottom: 0; } }

/* ---- Menu preview (before opening, after closing) ---- */
.preview { display: grid; gap: var(--mm-space-6); }
.preview .menu-head { margin-bottom: 0; }
.preview .page-note, .remind { max-width: 44rem; }
.remind { display: grid; gap: var(--mm-space-3); }

/* ---- Story band ---- */
.story__inner { display: grid; gap: var(--mm-space-7); align-items: center; }
.story__photo { aspect-ratio: 4 / 3; }
.story__text { display: grid; gap: var(--mm-space-4); justify-items: start; max-width: 34rem; }
@media (min-width: 900px) {
  .story__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--mm-space-9); }
  .story__photo { aspect-ratio: 5 / 4; }
}

/* ---- Mailing list band ---- */
.newsletter__inner { max-width: 40rem; margin: 0 auto; display: grid; gap: var(--mm-space-3); justify-items: center; text-align: center; }
.inline-form { display: flex; gap: var(--mm-space-2); width: 100%; max-width: 30rem; }
.inline-form .input { flex: 1; min-width: 0; }
.newsletter .inline-form { margin-top: var(--mm-space-3); }
.newsletter .page-note { text-align: left; width: 100%; }
@media (max-width: 420px) { .inline-form { flex-direction: column; } .inline-form .btn { width: 100%; } }

/* ---- Footer: cocoa, everything centred. One row of page links, then the small round logo
   with the name beside it. ---- */
.site-footer { background: var(--mm-cocoa); color: var(--mm-cream); padding: var(--mm-band-pad) 0; }
.site-footer__inner { display: grid; justify-items: center; gap: var(--mm-space-6); text-align: center; }
.site-footer a { color: var(--mm-cream); text-decoration: none; }
.site-footer a:hover { color: var(--mm-cream); text-decoration: underline; text-underline-offset: 4px; }
.site-footer :focus-visible { outline-color: var(--mm-cream); }
.site-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--mm-space-6); }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer__brand { display: flex; align-items: center; justify-content: center; gap: var(--mm-space-4); margin: 0; }
.site-footer__logo { width: 56px; height: 56px; border-radius: 50%; }

/* ==== Parts shared by the other public pages (shop.css and account.css hold the rest) ==== */

/* Order lines with right-aligned money (review, order status, practice payment) */
.lines { width: 100%; border-collapse: collapse; }
.lines td, .lines th { padding: var(--mm-space-2) 0; border-bottom: var(--mm-border); text-align: left; vertical-align: top; }
.lines td.num { padding-left: var(--mm-space-3); text-align: right; }
.lines__each { display: block; color: var(--mm-ink-soft); }
.lines__total th, .lines__total td { border-bottom: 0; padding-top: var(--mm-space-3); }

/* ---- 404 / error: a customer page (shop.css .cpage) with the detail box in development ---- */
.message-page .error-detail { max-width: 100%; }

/* ---- Print: keep order pages tidy on paper ---- */
@media print {
  .site-nav, .site-actions, .site-footer, .order-bar, .newsletter, .skip-link, .hero__media, .hero__scrim { display: none !important; }
  .hero { background: none; color: var(--mm-ink); }
  .hero__title, .hero__lead { color: var(--mm-ink); }
  .site-header { position: static; }
  body { background: #fff; }
}
