:root {
  /* Palette taken from the Teds Bread logo */
  --cream: #f9f0e1;
  --flour: #fffaf1;
  --crust: #8a3a1c;
  --crust-dark: #4e1d0e;
  --wheat: #e6ad45;
  --berry: #c8302a;
  --ink: #2e160a;
  --muted: #7d6656;
  --line: #ead9c2;
  --gingham: repeating-linear-gradient(90deg, rgba(200, 48, 42, .55) 0 10px, transparent 10px 20px), repeating-linear-gradient(0deg, rgba(200, 48, 42, .55) 0 10px, #fff 10px 20px);
  --good: #2f6b3a;
  --good-bg: #e7f2e4;
  --bad: #9b2c1f;
  --bad-bg: #fbe9e5;
  --warn-bg: #fdf3dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(46, 22, 10, .06), 0 8px 24px rgba(46, 22, 10, .06);
  --display: 'Fraunces', Georgia, serif;
  --body: 'Work Sans', system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--cream); line-height: 1.55; font-size: 16px; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.2rem; }
a { color: var(--crust-dark); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; background: var(--crust); color: var(--flour); border: 0; border-radius: 999px; padding: .85em 1.5em; font: 600 1rem var(--body); text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: var(--crust-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #c9b7a3; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--crust-dark); box-shadow: inset 0 0 0 2px var(--crust); }
.btn-ghost:hover { background: rgba(138, 58, 28, .08); }
.btn-small { padding: .5em 1.1em; font-size: .92rem; }
.btn-block { width: 100%; padding: 1em; font-size: 1.05rem; }
:focus-visible { outline: 3px solid var(--wheat); outline-offset: 2px; }

/* Header */
/* The header stays at the top of the screen while scrolling (shop and admin) */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(248, 241, 229, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.site-header.scrolled { box-shadow: 0 4px 16px rgba(46, 22, 10, .12); }
/* Jump links (#order, #events…) stop below the header instead of behind it */
[id] { scroll-margin-top: 80px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .55em; font: 700 1.35rem var(--display); color: var(--crust-dark); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; color: var(--crust); }
.brand-logo { height: 48px; width: auto; display: block; filter: drop-shadow(0 1px 2px rgba(46, 22, 10, .15)); }
.brand small { font-size: .7em; font-weight: 500; }
.gingham { height: 10px; background: var(--gingham); opacity: .9; }
.nav { display: flex; align-items: center; gap: 1.4em; }
.nav-links { display: flex; align-items: center; gap: 1.4em; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--crust); }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--flour); color: var(--crust-dark); cursor: pointer; place-items: center; padding: 0; }
.menu-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.menu-toggle .i-close, .menu-open .menu-toggle .i-open { display: none; }
.menu-open .menu-toggle .i-close { display: inline; }

.announcement { background: var(--crust-dark); color: var(--flour); text-align: center; padding: .6em 20px; font-weight: 500; }

/* Hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 100px); background:
  radial-gradient(ellipse at 80% 40%, rgba(230, 173, 69, .30), transparent 55%),
  radial-gradient(ellipse at 10% 90%, rgba(200, 48, 42, .07), transparent 50%); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero-logo { width: 100%; max-width: 440px; justify-self: center; height: auto; filter: drop-shadow(0 18px 30px rgba(78, 29, 14, .22)); transform: rotate(1.5deg); }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .8rem; font-weight: 600; color: var(--crust); margin: 0 0 1em; font-family: var(--display); }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); margin-bottom: .35em; }
.lede { font-size: 1.15rem; max-width: 36em; color: #4a3828; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.8em; }

/* How */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; margin-bottom: 72px; }
.how-item { background: var(--flour); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.how-item p { margin: 0; color: #4a3828; }
.how-num { display: inline-grid; place-items: center; min-width: 48px; height: 48px; padding: 0 10px; border-radius: 999px; background: var(--wheat); color: var(--crust-dark); font: 700 1.3rem var(--display); margin-bottom: 12px; }
.how-num svg { width: 24px; height: 24px; }

/* Breads */
.breads { background: var(--flour); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 72px 0; }
.section-head { margin-bottom: 28px; }
.section-head p { margin: 0; color: var(--muted); }
.menu-sub { display: flex; align-items: baseline; gap: .6em; flex-wrap: wrap; font-size: 1.45rem; margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 2px dashed var(--line); }
.menu-sub:first-child { margin-top: 0; }
.menu-sub small { font: 500 .9rem var(--body); color: var(--muted); }
.flavor .price small { display: block; font: 500 .8rem var(--body); color: var(--muted); white-space: nowrap; }
.totals .deposit-rows { display: block; padding-bottom: 0; }
.deposit-rows { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; }
.deposit-rows dt, .deposit-rows dd { font-size: .93rem; }
.deposit-rows div:first-child dd { color: var(--crust-dark); font-weight: 700; }
#deposit-note { font-size: .93rem; }
.flavor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.flavor { position: relative; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.flavor-photo { margin: -20px -20px 10px; aspect-ratio: 4 / 3; background: #efe2cf; display: grid; place-items: center; overflow: hidden; }
.flavor-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flavor-photo.empty { background: radial-gradient(circle at 50% 60%, #f3e3c8, #ead5b4); }
.flavor-photo.empty svg { width: 64px; height: 64px; color: rgba(138, 58, 28, .35); }
.flavor .badge { z-index: 1; }
.flavor.selected { border-color: var(--crust); box-shadow: 0 0 0 2px rgba(138, 58, 28, .25); }
.flavor.soldout { opacity: .6; }
.flavor h3 { margin: 0; font-size: 1.15rem; }
.flavor p { margin: 0; color: #4a3828; font-size: .95rem; flex: 1; }
.flavor .price { font: 700 1.15rem var(--display); color: var(--crust-dark); }
.badge { position: absolute; top: 16px; right: 16px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: .25em .6em; border-radius: 999px; }
.badge.seasonal { background: var(--wheat); color: var(--crust-dark); }
.badge.out { background: #e2d6c6; color: var(--muted); }
.flavor-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--flour); }
.stepper button { width: 38px; height: 38px; border: 0; background: none; font-size: 1.3rem; color: var(--crust-dark); cursor: pointer; border-radius: 999px; }
.stepper button:hover:not(:disabled) { background: rgba(138, 58, 28, .1); }
.stepper button:disabled { color: #c9b7a3; cursor: not-allowed; }
.stepper input { width: 42px; text-align: center; border: 0; background: none; font: 600 1rem var(--body); color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Order */
.order { padding: 72px 20px; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.card { background: var(--flour); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
fieldset.card { margin: 0 0 18px; min-width: 0; }
legend { font: 700 1.1rem var(--display); padding: 0 .3em; margin-left: -.3em; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .grow { flex: 1 1 200px; }
.field.state { flex: 0 1 90px; }
.field.zip { flex: 0 1 120px; }
label { font-weight: 500; font-size: .93rem; }
input, textarea, select { font: inherit; color: inherit; background: #fff; border: 1px solid #d8c7ae; border-radius: 10px; padding: .7em .8em; width: 100%; }
input:focus, textarea:focus, select:focus { border-color: var(--crust); outline: 2px solid rgba(138, 58, 28, .2); }
.hint { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
.hint.secure { display: flex; gap: .5em; align-items: center; }
.hint.secure svg { width: 16px; height: 16px; flex: none; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice > span { display: flex; flex-direction: column; border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; transition: border-color .15s; }
.choice small { color: var(--muted); font-size: .85rem; }
.choice input:disabled + span { opacity: .5; cursor: not-allowed; }
.choice input:checked + span { border-color: var(--crust); background: #fff8ee; }
.choice input:focus-visible + span { outline: 3px solid var(--wheat); outline-offset: 2px; }
.address-block { margin-top: 6px; }
.pickup-block { margin-top: 6px; }
.pickup-address { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 14px; background: #f6efe4; border-radius: 10px; font-size: .95rem; }
.pickup-address svg { width: 20px; height: 20px; flex: none; color: var(--crust); margin-top: 2px; }
.label { font-weight: 500; font-size: .93rem; }
.chip.window { padding: .55em 1em; }
.pickup-pay { margin-top: 4px; }
select { appearance: auto; }
.venmo-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: #eef5fc; border: 1px solid #cfe2f5; }
.venmo-box img { width: 140px; height: 140px; object-fit: contain; background: #fff; border-radius: 8px; padding: 6px; }
.venmo-box .vu { font: 700 1.15rem var(--body); color: #1d6fb8; }
.btn-app { color: #fff; }
.btn-app:hover { filter: brightness(.9); }
.pay-due { background: var(--warn-bg); border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .4em .9em; font: 500 .88rem var(--body); cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--crust); }
.chip.active { background: var(--crust); color: var(--flour); border-color: var(--crust); }
.status { margin-top: 12px; padding: .7em .9em; border-radius: 10px; font-size: .93rem; background: var(--warn-bg); }
.status.good { background: var(--good-bg); color: var(--good); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
.status.info { background: #f1ebe2; color: var(--muted); }
#card-container { min-height: 90px; }
.demo-note { background: var(--warn-bg); border-radius: 10px; padding: .8em 1em; font-size: .93rem; }

.order-side { position: sticky; top: 84px; }
.summary h3 { margin-bottom: .6em; }
.summary-lines { list-style: none; padding: 0; margin: 0 0 12px; }
.summary-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.totals { margin: 0 0 16px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 500; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.totals .grand dt, .totals .grand dd { color: var(--ink); font: 700 1.25rem var(--display); }
#form-error { margin: 0 0 12px; }

/* Confirmation */
.confirmation { padding: 72px 20px; }
.confirm-card { max-width: 620px; margin: 0 auto; text-align: center; padding: 40px 28px; }
.confirm-icon { width: 64px; height: 64px; border-radius: 999px; background: var(--good-bg); color: var(--good); display: grid; place-items: center; font-size: 2rem; margin: 0 auto 16px; }
#conf-details { text-align: left; margin: 20px 0 28px; }
#conf-details ul { padding-left: 1.2em; }

/* Events */
.next-event { display: inline-flex; align-items: center; gap: .5em; margin-top: 1.4em; color: var(--crust-dark); text-decoration: none; font-size: .95rem; background: rgba(255, 250, 241, .8); border: 1px solid var(--line); border-radius: 999px; padding: .45em 1em; max-width: 100%; }
.next-event:hover { border-color: var(--crust); }
.next-event svg { width: 18px; height: 18px; flex: none; color: var(--crust); }
.events { background: var(--flour); border-top: 1px solid var(--line); padding: 72px 0; }
.event-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.event { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.event-photo { position: relative; aspect-ratio: 16 / 9; background: #efe2cf; }
.event-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-photo.empty { aspect-ratio: auto; height: 76px; background: radial-gradient(circle at 80% 40%, rgba(230, 173, 69, .45), transparent 60%), #ead5b4; }
.event-date { position: absolute; left: 14px; bottom: -22px; width: 58px; text-align: center; background: var(--flour); border: 1px solid var(--line); border-radius: 12px; padding: 6px 0 4px; box-shadow: var(--shadow); line-height: 1.05; }
.event-date span { display: block; text-transform: uppercase; font-size: .72rem; font-weight: 600; letter-spacing: .08em; color: var(--berry); }
.event-date strong { font: 700 1.5rem var(--display); color: var(--crust-dark); }
.event-body { padding: 32px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.event-body h3 { margin: 0; }
.event-body p { margin: 0; }
.event-venue { color: #4a3828; font-weight: 500; }
.event-when { color: var(--crust-dark); font-weight: 600; }
.event-addr { display: flex; gap: 8px; align-items: flex-start; color: #4a3828; font-size: .95rem; }
.event-addr svg { width: 18px; height: 18px; flex: none; color: var(--crust); margin-top: 2px; }
.event-notes { color: var(--muted); font-size: .93rem; }
.event-body .btn { align-self: flex-start; margin-top: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-inner p { margin: 0; }
.footer-inner { align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { height: 56px; width: auto; }
.site-footer { background: var(--flour); }

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-logo { order: -1; max-width: 300px; }
  .order-grid { grid-template-columns: 1fr; }
  .order-side { position: static; }
  .how { grid-template-columns: 1fr; margin-top: 0; }
}
/* Phones and small tablets: header links move into a drop-down menu behind the ☰ button */
@media (max-width: 720px) {
  .nav { gap: 10px; }
  .menu-toggle { display: inline-grid; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--flour); border-bottom: 1px solid var(--line); box-shadow: 0 10px 24px rgba(46, 22, 10, .12); padding: 6px 20px 12px; }
  .menu-open .nav-links { display: flex; }
  .nav-links a:not([hidden]) { display: block; padding: 14px 4px; font-size: 1.05rem; }
  .nav-links a + a { border-top: 1px solid var(--line); }
  .brand, .nav > .btn-small { white-space: nowrap; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .nav-links { padding: 6px 16px 12px; }
  .brand { font-size: 1.12rem; gap: .4em; }
  .brand-logo { height: 40px; }
  .nav > .btn-small { padding: .55em .95em; font-size: .9rem; }
  .choice-row { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .order, .confirmation { padding: 48px 16px; }
  .events, .breads { padding: 48px 0; }
  .event-list { grid-template-columns: 1fr; }
}
@media (max-width: 359px) {
  .brand small { display: none; }
  .nav { gap: 8px; }
}
