/*
  Mena Made customer pages after the front page (design/rules.md; layout from storefront-v2.md):
  checkout review, practice payment, order status, Our story, mailing-list confirm and unsubscribe,
  subscription plans; account.css adds the account, messages and contact parts.
  The frame is CustomerPage (src/features/storefront/views/customer-page.tsx): a cream page band with
  the title (h1) and one Large body sentence, then the content on cream: sections with a Heading over a
  hairline, side columns as plain white panels, the one .btn and plain links. Type comes only from
  base.css; colours follow site.css (cream, white, one dark brown; ink and muted ink; links red-brown).
  Phone first (375px); 960px for the side column.
*/

/* ---- The frame: page band, then the content ---- */
.page-band { border-bottom: 1px solid var(--mm-line); }
.page-band__inner { display: grid; gap: var(--mm-space-4); padding-top: var(--mm-space-7); padding-bottom: var(--mm-space-7); }
@media (min-width: 800px) { .page-band__inner { padding-top: var(--mm-space-8); padding-bottom: var(--mm-space-8); } }
.cpage { display: grid; gap: var(--mm-space-7); align-content: start; min-height: min(50vh, 30rem); padding-top: var(--mm-space-7); padding-bottom: var(--mm-space-8); }
.cpage > * { min-width: 0; }
.cpage--text > * { max-width: 44rem; }
@media (min-width: 800px) { .cpage { padding-top: var(--mm-space-8); padding-bottom: var(--mm-space-9); } }

.cpage__back a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.cpage__notice { max-width: 44rem; }

/* Page header: the title and one plain sentence */
.page-intro { display: grid; gap: var(--mm-space-3); max-width: 46rem; }
.page-intro h1 { overflow-wrap: break-word; }
.page-intro__lead { max-width: 38rem; }
.page-intro__lead strong { overflow-wrap: anywhere; }

/* Section heads on customer pages (PageSection, and a few account parts): a Heading over a hairline */
.rule-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--mm-space-4);
  width: 100%; padding: 0 0 var(--mm-space-3); margin: 0 0 var(--mm-space-3); border-bottom: 1px solid var(--mm-line);
}
.rule-head__step { flex: none; color: var(--mm-ink-soft); }
legend.rule-head { float: left; }
legend.rule-head + * { clear: both; }

/* Sections */
.cpage__section { display: grid; gap: var(--mm-space-3); align-content: start; min-width: 0; }
.cpage__section > .rule-head { margin-bottom: var(--mm-space-2); }
.cpage__section > p { max-width: var(--mm-reading-max); }
.cpage__section h3 { margin-top: var(--mm-space-3); }

/* Content and a side column: the side column is a plain panel, like the front page's order summary */
.cpage__split { display: grid; gap: var(--mm-space-7); }
.cpage__main, .cpage__side { display: grid; gap: var(--mm-space-7); align-content: start; min-width: 0; }
.cpage__side { background: var(--mm-card); border: 1px solid var(--mm-line); border-radius: var(--mm-radius-card); padding: var(--mm-space-5); gap: var(--mm-space-6); }
@media (min-width: 560px) { .cpage__side { padding: var(--mm-space-6); } }
@media (min-width: 960px) {
  .cpage__split { grid-template-columns: minmax(0, 1fr) 23rem; gap: var(--mm-space-7); align-items: start; }
  .cpage__side { position: sticky; top: calc(var(--mm-header-h) + var(--mm-space-5)); }
}

/* A row of actions: one .btn at most, the rest plain links */
.cpage__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mm-space-3) var(--mm-space-6); }
.cpage__actions form { margin: 0; }
@media (max-width: 479px) {
  .cpage__actions { flex-direction: column; align-items: flex-start; }
  .cpage__actions > .btn, .cpage__actions > form > .btn, .cpage__actions > .post-button > .btn { align-self: stretch; width: 100%; }
  .cpage__actions > .post-button { display: flex; align-self: stretch; }
}
.cpage__fine { color: var(--mm-ink-soft); max-width: var(--mm-reading-max); }

/* Label and value rows (SummaryList: dl.kv) */
.cpage .kv { display: grid; margin: 0; }
.cpage .kv > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 2px var(--mm-space-4); padding: var(--mm-space-3) 0; border-top: var(--mm-rule); }
.cpage .kv > div:last-child { border-bottom: var(--mm-rule); }
.cpage .rule-head + .kv > div:first-child { border-top: 0; padding-top: 0; }
.cpage .kv dd { margin: 0; overflow-wrap: anywhere; }
.cpage .kv dd.kv__change { grid-column: 2; }
.cpage__side .kv > div { grid-template-columns: 5rem minmax(0, 1fr); }
.kv__pre { white-space: pre-line; }

/* Order lines with right-aligned money */
.cpage .lines td, .cpage .lines th { padding: var(--mm-space-3) 0; }
.cpage .rule-head + .lines tbody tr:first-child td { padding-top: 0; }
.cpage .lines__total th, .cpage .lines__total td { padding-top: var(--mm-space-4); }
.lines__meta { color: var(--mm-ink-soft); }

/* The where-and-when lines of a collection */
.where { display: grid; gap: 2px; }

/* ---- Order status: where it stands, as five words in a row, the current one in bold ---- */
.cpage .progress { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--mm-space-2) var(--mm-space-5); }

/* ---- Practice payment: the practice card as ruled rows, then the three test outcomes ---- */
.practice-card { font-variant-numeric: tabular-nums; }

/* ---- Our story: page band with the round logo, the cocoa story band, then how ordering works ---- */
.story-page__open { align-items: center; }
.story-page__logo { width: min(11rem, 50%); border-radius: 50%; }
@media (min-width: 800px) {
  .story-page__open { grid-template-columns: minmax(0, 1fr) auto; gap: var(--mm-space-8); }
  .story-page__logo { width: 13rem; }
}
.how__inner { display: grid; gap: var(--mm-space-4); justify-items: start; }
.how__inner > p { max-width: var(--mm-reading-max); }
.how__actions { margin-top: var(--mm-space-3); }

/* ---- Subscription plans: ledger rows, not cards ---- */
.plan-rows { list-style: none; padding: 0; margin: 0; display: grid; max-width: 48rem; border-bottom: var(--mm-rule); }
.plan-row { display: grid; gap: var(--mm-space-3); padding: var(--mm-space-5) 0; border-top: var(--mm-rule); }
.plan-row__body { display: grid; gap: 4px; min-width: 0; }
.plan-row__buy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--mm-space-3); }
.plan-row__price { font-variant-numeric: tabular-nums; }
@media (min-width: 640px) {
  .plan-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--mm-space-6); align-items: start; }
  .plan-row__buy { flex-direction: column; align-items: flex-end; justify-content: flex-start; padding-top: 4px; min-width: 10rem; }
}

/* A sign-up, sign-in or contact form in one column, on a plain panel like the checkout steps */
.cform {
  display: grid; gap: var(--mm-space-5); max-width: 36rem;
  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) { .cform { padding: var(--mm-space-6) var(--mm-space-7) var(--mm-space-7); } }
.cform .field { max-width: 32rem; }
.cform .btn { justify-self: start; }
@media (max-width: 479px) { .cform .btn { justify-self: stretch; } }

@media print {
  .cpage__actions, .cpage__back, .site-header, .site-footer { display: none !important; }
  .cpage__side { position: static; border: 0; padding: 0; }
}

/* The final action in the side column: the one button across the column, the plain links under it */
.review-page__form, .pay-page__actions { display: grid; gap: var(--mm-space-3); justify-items: start; margin-top: var(--mm-space-2); }
.review-page__form .btn, .pay-page__actions .btn { width: 100%; }

.nowrap { white-space: nowrap; }

/* ---- Weekly bake | Ready to collect ----
   Underlined tabs at the top of the front page's order section, only while ready-made loaves are on
   sale beside the weekly bake (the admin's .tabs look). They are links to /?menu=<id>#order. */
.tabs.order-tabs {
  display: flex; flex-wrap: wrap; column-gap: var(--mm-space-5); row-gap: 0;
  margin: 0 0 var(--mm-space-6); border-bottom: var(--mm-rule);
}
.order-tabs .tabs__item {
  display: inline-flex; align-items: center; min-height: 44px; margin-bottom: -1px; max-width: 100%;
  border-bottom: 2px solid transparent; color: var(--mm-ink-soft); text-decoration: none; overflow-wrap: anywhere;
}
.order-tabs .tabs__item:hover { color: var(--mm-ink); text-decoration: underline; text-underline-offset: 6px; }
.order-tabs .tabs__item[aria-current] { color: var(--mm-ink); border-bottom-color: var(--mm-ink); text-decoration: none; }
.ready-intro { margin: 0 0 var(--mm-space-6); max-width: 46rem; }
