/* Lenita's See's Candy Fundraiser */

:root {
  --bg: #fbf6ef;
  --paper: #ffffff;
  --ink: #3a231a;
  --ink-2: #66463a;
  --muted: #86695c;
  --line: #eadccf;
  --accent: #a8232b;
  --accent-hover: #8e1c23;
  --accent-ink: #ffffff;
  --accent-soft: #f9e6e3;
  --gold: #b3852b;
  --ok: #2d6a39;
  --ok-soft: #e5f2e6;
  --warn-soft: #fff4dc;
  --hero-bg: #3a231a;
  --hero-ink: #fbf1e6;
  --hero-muted: #dcc6b6;
  --photo-bg: #ffffff;
  --shadow: 0 1px 2px rgba(58, 35, 26, .06), 0 8px 24px rgba(58, 35, 26, .07);
  --radius: 18px;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17100d;
    --paper: #221814;
    --ink: #f5ebe3;
    --ink-2: #dcc8bb;
    --muted: #b09a8d;
    --line: #3b2b24;
    --accent: #e3666c;
    --accent-hover: #ec8287;
    --accent-ink: #1d0f0c;
    --accent-soft: #3b1f1d;
    --gold: #d9b46e;
    --ok: #86c993;
    --ok-soft: #1d3222;
    --warn-soft: #3a2f17;
    --hero-bg: #0e0907;
    --hero-ink: #f8ede3;
    --hero-muted: #c8b1a2;
    --photo-bg: #fbf8f5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.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;
}

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--paper); color: var(--ink); padding: 8px 14px; border-radius: 10px;
  box-shadow: var(--shadow); font-weight: 700;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.preview-banner {
  background: var(--warn-soft); color: var(--ink); text-align: center;
  font-size: 14px; font-weight: 700; padding: 8px 16px; border-bottom: 1px solid var(--line);
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(179, 133, 43, .28), transparent 60%),
    radial-gradient(800px 300px at -10% 120%, rgba(168, 35, 43, .35), transparent 60%),
    var(--hero-bg);
  color: var(--hero-ink);
  padding: 44px 0 36px;
}
.hero-inner { position: relative; }
.eyebrow {
  margin: 0 0 10px; color: var(--hero-muted); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; font-size: 13px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 7vw, 56px); line-height: 1.05; margin: 0 0 14px;
  letter-spacing: -.01em; text-wrap: balance;
}
.intro { margin: 0 0 22px; max-width: 46ch; font-size: 18px; color: var(--hero-muted); }
.intro:empty { display: none; }

.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.facts:empty { display: none; }
.fact {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px; padding: 10px 14px; min-width: 0;
}
.fact dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--hero-muted); font-weight: 700; }
.fact dd { margin: 2px 0 0; font-weight: 700; font-size: 16px; }

.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; font-weight: 600; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--hero-ink); }
.step-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold); color: #2a170f; font-weight: 800; font-size: 14px;
}

/* ---------- Sections ---------- */

main { padding-bottom: 48px; }
.section-title {
  font-family: var(--font-display); font-weight: 700; font-size: 28px;
  margin: 36px 0 16px; letter-spacing: -.01em;
}
.section-title:focus { outline: none; }

.status {
  margin: 28px 0 0; padding: 16px 18px; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: flex-start;
}
.status.error { background: var(--accent-soft); }
.status.info { background: var(--warn-soft); }
.status.ok { background: var(--ok-soft); }
.status p { margin: 0; }
.status strong { display: block; margin-bottom: 2px; }
.spinner {
  flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Menu grid ---------- */

.grid { display: grid; gap: 12px; }

.item {
  display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.item.in-cart { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.item-photo {
  background: var(--photo-bg); border-radius: 12px; overflow: hidden; aspect-ratio: 1;
}
.item-photo img { width: 100%; height: 100%; object-fit: contain; }
.item-body { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.item h3 { margin: 0; font-size: 17px; line-height: 1.25; font-weight: 800; }
.item .size { display: block; color: var(--muted); font-weight: 600; font-size: 14px; margin-top: 1px; }
.item .desc { margin: 6px 0 10px; color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.item-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 18px; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
  .item { grid-template-columns: 1fr; padding: 14px; }
  .item-photo { margin-bottom: 2px; }
}

/* ---------- Buttons & stepper ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); font-weight: 800; text-decoration: none;
  cursor: pointer; transition: background .15s, transform .05s, border-color .15s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.big { width: 100%; min-height: 54px; font-size: 17px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn.add { min-height: 40px; padding: 8px 18px; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }

.stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--accent);
  border-radius: 999px; overflow: hidden; background: var(--paper);
}
.stepper button {
  width: 40px; height: 40px; border: 0; background: transparent; color: var(--accent);
  font-size: 22px; font-weight: 800; line-height: 1; cursor: pointer;
}
.stepper button:hover:not([disabled]) { background: var(--accent-soft); }
.stepper button[disabled] { opacity: .35; cursor: not-allowed; }
.stepper .qty { min-width: 28px; text-align: center; font-weight: 800; }
.stepper.mini button { width: 32px; height: 32px; font-size: 18px; }
.stepper.mini .qty { min-width: 22px; font-size: 15px; }

/* ---------- Checkout ---------- */

.checkout-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) {
  .checkout-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
  .checkout-side { position: sticky; top: 16px; }
}
.checkout-main { display: grid; gap: 16px; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin: 0; min-width: 0;
}
fieldset.card legend {
  float: left; width: 100%; padding: 0; margin: 0 0 12px;
  font-weight: 800; font-size: 18px;
}
fieldset.card legend + * { clear: both; }
.card-title { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.optional { font-weight: 600; color: var(--muted); font-size: 14px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.field { margin: 0 0 12px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; font-size: 15px; }
.field-row { display: grid; gap: 0 14px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-row .field:last-child { margin-bottom: 0; }
@media (max-width: 559px) { .field-row .field { margin-bottom: 12px; } }

input, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  padding: 11px 13px; font-size: 16px; min-height: 46px;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
input[aria-invalid="true"] { border-color: var(--accent); }
.field-error, .form-error { color: var(--accent); font-weight: 700; font-size: 14px; margin: 4px 0 0; }
.field-error:empty, .form-error:empty { display: none; }
.form-error { margin: 0 0 12px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Payment methods */
.methods { display: grid; gap: 10px; }
@media (min-width: 560px) { .methods { grid-template-columns: 1fr 1fr; } }
.method {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer;
  background: var(--bg); transition: border-color .15s, background .15s;
}
.method:hover { border-color: var(--ink-2); }
.method input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.method:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.method:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.method-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-weight: 800; }
.method-hint { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; margin-top: 2px; }
.method.card-method { grid-column: 1 / -1; }
.fee-badge {
  display: inline-block; background: var(--warn-soft); color: var(--ink); border: 1px solid var(--gold);
  border-radius: 999px; padding: 1px 9px; font-size: 13px; font-weight: 800;
}
.method-fee { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* Summary */
.summary-empty { margin: 0 0 8px; color: var(--muted); }
.summary-list { list-style: none; margin: 0; padding: 0; }
.summary-line {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.summary-line:first-child { padding-top: 0; }
.summary-name { font-weight: 700; line-height: 1.3; }
.summary-name small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; }
.summary-line .line-total { font-weight: 800; text-align: right; }
.summary-line .stepper { grid-column: 1; justify-self: start; }

.totals { margin: 12px 0 16px; }
.totals-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--ink-2); }
.totals-row.grand { color: var(--ink); font-weight: 800; font-size: 20px; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); }
.fine-print { color: var(--muted); font-size: 13px; margin: 10px 0 0; text-align: center; }

/* ---------- Floating cart bar (phones) ---------- */

.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--hero-bg); color: var(--hero-ink);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .18);
}
.cartbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cartbar-text { margin: 0; display: flex; flex-direction: column; line-height: 1.2; }
.cartbar-text span { color: var(--hero-muted); font-weight: 700; }
body.has-cartbar { padding-bottom: 76px; }

/* ---------- Confirmation ---------- */

.confirmation { padding-top: 28px; max-width: 760px; margin: 0 auto; }
.confirmation:focus { outline: none; }
.confirm-head { text-align: center; margin: 8px 0 24px; }
.confirm-check {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok);
}
.confirm-head h2 { font-family: var(--font-display); font-size: clamp(28px, 6vw, 40px); margin: 0 0 6px; }
.confirm-head p { margin: 0; color: var(--ink-2); font-size: 17px; }
.order-id { font-weight: 800; color: var(--ink); white-space: nowrap; }
.confirmation .card { margin-bottom: 16px; }
.card-kicker {
  margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.pay-amount { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin: 0 0 10px; }
.pay-steps { margin: 12px 0 0; padding-left: 20px; color: var(--ink-2); }
.pay-steps li { margin: 4px 0; }
.copy-rows { display: grid; gap: 8px; margin: 8px 0 0; }
.copy-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; background: var(--bg);
}
.copy-row span { min-width: 0; overflow-wrap: anywhere; }
.copy-row small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.paid-badge {
  display: inline-flex; align-items: center; gap: 8px; background: var(--ok-soft); color: var(--ok);
  border-radius: 999px; padding: 6px 14px; font-weight: 800;
}
.party-when { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.party-where { margin: 0; color: var(--ink-2); }
.party-notes { margin: 10px 0 0; }
.party-cant { margin: 12px 0 0; font-style: italic; color: var(--ink-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.center { text-align: center; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 24px 0 32px; text-align: center; color: var(--ink-2); }
.footer p { margin: 0; }
