/* Gramma's New-Fashioned Bakery — storefront styles.
 * Mobile-first. Warm bakery palette: cream / crust / gold / berry.
 */
:root {
  --cream: #faf4e8;
  --cream2: #f3e9d4;
  --card: #fffdf8;
  --crust: #5d3a1e;
  --crust-dark: #3c2412;
  --gold: #c98f2d;
  --gold-soft: #e8c97a;
  --berry: #93342f;
  --ink: #2c2015;
  --muted: #7d6c56;
  --line: #ecdfc6;
  --shadow: 0 8px 30px rgba(93, 58, 30, 0.10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: 'Playfair Display', Georgia, serif; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 244, 232, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0.8rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; font-size: 1.2rem; color: var(--crust-dark);
  text-decoration: none;
}
.brand span { color: var(--gold); }
.topbar-links a {
  margin-left: 1.4rem; text-decoration: none;
  color: var(--crust); font-weight: 600; font-size: 0.92rem;
}
.topbar-links a:hover { color: var(--berry); }
@media (max-width: 640px) { .topbar-links { display: none; } }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(201, 143, 45, 0.28), transparent 60%),
    linear-gradient(165deg, var(--crust-dark) 0%, var(--crust) 70%, #4a2c14 100%);
  color: #fdf8ee;
  text-align: center;
  padding: 4.5rem 1.25rem 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.10;
  background-image: radial-gradient(#fff 1px, transparent 1.5px);
  background-size: 34px 34px;
}
.eyebrow {
  display: inline-block; font-size: 0.78rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--gold-soft);
  margin: 0 0 1.1rem; position: relative;
}
.hero h1 {
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  font-weight: 800; line-height: 1.1; margin: 0 auto;
  max-width: 800px; position: relative;
}
.hero h1 em { font-style: italic; color: var(--gold-soft); }
.lede { font-size: 1.1rem; color: #e9dcc4; max-width: 560px; margin: 1.4rem auto 0; position: relative; }
.hero-cta { margin-top: 2.2rem; position: relative; }
.hero-proof { margin-top: 1.6rem; font-size: 0.88rem; color: #c9b995; position: relative; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--crust); color: #fff; border: none;
  border-radius: 999px; padding: 0.8rem 2rem;
  font-size: 1rem; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-primary { background: var(--berry); box-shadow: 0 10px 26px rgba(147, 52, 47, 0.35); }
.btn-ghost {
  background: transparent; border: 2px solid rgba(253, 248, 238, 0.5);
  color: #fdf8ee; margin-left: 0.75rem; box-shadow: none;
}
.btn.ghost { background: var(--cream2); color: var(--crust-dark); box-shadow: none; }
.btn.small { padding: 0.4rem 0.9rem; font-size: 0.88rem; }

/* ---------- announcement / error ---------- */
.announce {
  background: var(--gold); color: var(--crust-dark);
  text-align: center; padding: 0.7rem 1rem; font-weight: 600;
}
#error-bar {
  background: #fbe3e0; color: #7c231b;
  padding: 0.75rem 1rem; text-align: center; font-size: 0.95rem;
}

/* ---------- menu ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.menu-cat { margin-bottom: 3rem; }
.menu-cat > h2 {
  color: var(--crust-dark);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 0.25rem;
}
.menu-cat > .cat-sub {
  color: var(--muted); font-style: italic;
  font-family: 'Playfair Display', Georgia, serif;
  margin: 0 0 1.5rem;
}
.grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.4rem 1.3rem;
  display: flex; flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(93, 58, 30, 0.16); }
.card h3 { margin: 0 0 0.15rem; font-size: 1.2rem; color: var(--crust-dark); }
.unit {
  display: inline-block; align-self: flex-start;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--crust-dark); background: var(--cream2);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 0.2rem 0.7rem; margin-bottom: 0.6rem;
}
.card .desc { color: var(--muted); font-size: 0.92rem; flex: 1; margin: 0 0 0.9rem; }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 700; font-size: 1.2rem; color: var(--berry); }
.card-foot .btn { padding: 0.55rem 1.3rem; font-size: 0.92rem; }

/* ---------- market band ---------- */
.market-band {
  background: linear-gradient(150deg, var(--crust-dark), #54341a);
  color: #f3e9d4; border-radius: 24px;
  padding: 3.5rem 2rem; text-align: center;
  margin: 1rem 0 4rem; position: relative; overflow: hidden;
}
.market-band::before {
  content: ""; position: absolute; inset: 0; opacity: 0.08;
  background-image: radial-gradient(#fff 1px, transparent 1.5px);
  background-size: 30px 30px;
}
.market-band h2 { color: #fdf8ee; margin: 0 0 1.8rem; font-size: clamp(1.6rem, 4vw, 2.4rem); position: relative; }
.kicker {
  font-size: 0.78rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin: 0 0 0.9rem;
}
.kicker.light { color: var(--gold-soft); position: relative; }
.market-facts {
  display: grid; gap: 1rem; margin: 0 auto 1.5rem; max-width: 720px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  position: relative;
}
.market-facts > div {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(232, 201, 122, 0.25);
  border-radius: 14px; padding: 1.1rem 0.8rem;
}
.fact-label {
  display: block; font-size: 0.72rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold-soft); margin-bottom: 0.3rem;
}
.fact-value { font-family: 'Playfair Display', Georgia, serif; font-size: 1.1rem; color: #fff; }
.market-note { color: #d9c9a8; font-size: 0.95rem; position: relative; margin: 0; }

/* ---------- how it works ---------- */
.how { text-align: center; padding: 1rem 0 2rem; }
.how h2 { color: var(--crust-dark); font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 2.2rem; }
.steps { display: grid; gap: 1.8rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step-num {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--crust-dark); color: var(--gold-soft);
  font-family: 'Playfair Display', Georgia, serif; font-weight: 800; font-size: 1.35rem;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.step h3 { color: var(--crust-dark); margin: 0 0 0.4rem; font-size: 1.15rem; }
.step p { color: var(--muted); font-size: 0.94rem; margin: 0; }

/* ---------- footer ---------- */
footer {
  text-align: center; color: var(--muted);
  padding: 2.5rem 1rem 4.5rem; font-size: 0.9rem;
  border-top: 1px solid var(--line);
}
.fname { font-family: 'Playfair Display', Georgia, serif; font-size: 1.1rem; color: var(--crust-dark); margin: 0 0 0.3rem; }
footer p { margin: 0.2rem 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- basket ---------- */
#basket-toggle {
  position: fixed; right: 1.25rem; bottom: 1.25rem;
  background: var(--berry); color: #fff; border: none;
  border-radius: 999px; padding: 0.9rem 1.5rem;
  font-size: 1rem; font-weight: 700; font-family: inherit;
  cursor: pointer; box-shadow: 0 6px 20px rgba(147, 52, 47, 0.45);
  z-index: 40;
}
#basket-toggle:disabled { opacity: 0.45; }
#basket-overlay {
  position: fixed; inset: 0;
  background: rgba(58, 42, 26, 0.45);
  z-index: 48;
}
#basket-overlay[hidden] { display: none; }
#basket-drawer {
  position: fixed; top: 0; right: -360px;
  width: 340px; max-width: 92vw; height: 100%;
  background: var(--card); z-index: 50;
  display: flex; flex-direction: column;
  padding: 1.25rem;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
  transition: right 0.25s ease;
  border-left: 1px solid var(--line);
}
#basket-drawer.open { right: 0; }
#basket-drawer h2 { margin: 0 0 0.8rem; color: var(--crust-dark); }
#basket-items { flex: 1; overflow-y: auto; }
.brow {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.brow .bname { flex: 1; }
.brow .bprice { font-weight: 600; }
.blink {
  border: 1px solid var(--crust); background: #fff; color: var(--crust);
  width: 28px; height: 28px; border-radius: 8px;
  cursor: pointer; font-size: 1rem; line-height: 1;
}
.basket-total-row {
  display: flex; justify-content: space-between;
  font-size: 1.15rem; font-weight: 700; color: var(--crust-dark);
  padding: 0.8rem 0;
}
.drawer-actions { display: flex; gap: 0.5rem; }
.drawer-actions .btn { flex: 1; }

/* ---------- modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(58, 42, 26, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--card); border-radius: 18px;
  padding: 1.75rem; width: 440px; max-width: 100%;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}
.modal-box h2 { margin: 0 0 0.4rem; color: var(--crust-dark); }
.modal-box label { display: block; margin: 0.7rem 0; font-size: 0.95rem; }
.modal-box input, .modal-box textarea {
  width: 100%; margin-top: 0.25rem;
  padding: 0.6rem; font-size: 1rem; font-family: inherit;
  border: 1px solid #d9cbb4; border-radius: 8px;
  background: #fff;
}
.pickup-field {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0.8rem 1rem; margin: 0.9rem 0;
  background: var(--cream);
}
.pickup-field legend {
  font-weight: 700; color: var(--crust-dark); padding: 0 0.5rem;
  font-size: 0.95rem;
}
.pickup-field .radio {
  display: flex; gap: 0.7rem; align-items: flex-start;
  margin: 0.5rem 0; cursor: pointer;
}
.pickup-field .radio input { width: auto; margin-top: 0.3rem; }
.pickup-field .radio small { color: var(--muted); }
.pickup-field #f-pickup-detail { margin-top: 0.4rem; }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.modal-actions .btn { flex: 1; }
