/* =====================================================================
   MAMA ROO'S BAKERY: THEME
   Every color, font and size that defines the look lives in :root below.
   Change these to retune the whole site; nothing else needs touching.
   ===================================================================== */
:root {
  /* Ink and paper: taken from the black-and-white logo */
  --color-ink: #1d1a17;          /* main text, borders, logo ink */
  --color-ink-soft: #4a433c;     /* secondary text (AA on cream) */
  --color-cream: #fdf8ee;        /* page background */
  --color-paper: #ffffff;        /* cards, inputs */
  --color-line: #d9cfbd;         /* light dividers */

  /* Sunflower yellow (Erin's favorite): accents only, never under white text */
  --color-sunflower: #f5b700;
  --color-sunflower-light: #ffe7a1;  /* soft highlight backgrounds */
  --color-sunflower-wash: #fff6dc;   /* very light tint */
  --color-sunflower-deep: #8a6200;   /* yellow-family color dark enough for text */

  /* Status colors (admin + messages) */
  --color-success: #2f6b3a;
  --color-success-bg: #e6f2e6;
  --color-danger: #a12a1f;
  --color-danger-bg: #fbe9e6;

  /* Fonts */
  --font-script: "Dancing Script", "Brush Script MT", cursive;          /* headings */
  --font-caps: "Cormorant Garamond", "Cinzel", Georgia, serif;          /* small wide-tracked labels */
  --font-body: "Lora", Georgia, "Times New Roman", serif;               /* body text */
  --tracking-caps: 0.22em;

  /* Shape */
  --radius: 10px;
  --radius-small: 6px;
  --border-double: 4px double var(--color-ink);   /* the logo's double-line frame */
  --shadow: 0 2px 10px rgba(29, 26, 23, 0.07);

  /* Layout */
  --container: 1100px;
  --space: 1rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-ink); text-decoration-color: var(--color-sunflower); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--color-ink); }
:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-script); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); }
h2 { font-size: clamp(2rem, 5vw, 2.6rem); }
h3 { font-size: 1.7rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--color-paper); padding: 0.6rem 1rem; border: 2px solid var(--color-ink); z-index: 100; }
.skip-link:focus { top: 1rem; }

/* Small wide-tracked caps label, like "COOKIES" / "HOMEMADE WITH LOVE" in the logo */
.caps {
  font-family: var(--font-caps);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  font-size: 0.95rem;
}
.muted { color: var(--color-ink-soft); }

/* Heart accent: <span class="heart" aria-hidden="true"></span> */
.heart::before { content: "\2661"; font-family: Georgia, serif; font-size: 1.1em; }

/* Divider: line / sunflower / line */
.divider { display: flex; align-items: center; gap: 0.9rem; margin: 2rem auto; max-width: 420px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 2px solid var(--color-ink); }
.divider img { width: 30px; height: 30px; }

/* ---------- Header ---------- */
.site-header { background: var(--color-cream); border-bottom: var(--border-double); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { height: 64px; width: auto; mix-blend-mode: multiply; } /* hides the logo's white box on cream */
.nav-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; }
.nav-list a {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.7rem; min-height: 44px;
  font-family: var(--font-caps); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.95rem;
  text-decoration: none; border-bottom: 3px solid transparent;
}
.nav-list a:hover { border-bottom-color: var(--color-sunflower-light); }
.nav-list a[aria-current="page"] { border-bottom-color: var(--color-sunflower); }
.cart-count {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 0.35em;
  border-radius: 999px; background: var(--color-sunflower); color: var(--color-ink);
  font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 0; font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.4rem;
  font-family: var(--font-caps); font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--color-ink); background: var(--color-sunflower);
  border: 2px solid var(--color-ink); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.btn:hover { background: #ffc829; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-outline { background: var(--color-paper); }
.btn-outline:hover { background: var(--color-sunflower-wash); }
.btn-danger { background: var(--color-paper); color: var(--color-danger); border-color: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger-bg); }
.btn-small { min-height: 40px; padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 2rem 0 1rem; text-align: center; }
.hero-frame { background: var(--color-paper); border: var(--border-double); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.hero-logo { margin: 0 auto; width: min(560px, 100%); mix-blend-mode: multiply; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.25rem; }
.pickup-badge {
  display: inline-block; margin-top: 1rem; padding: 0.35rem 1rem;
  border: 2px solid var(--color-ink); border-radius: 999px; background: var(--color-sunflower-wash);
}

/* ---------- Sections ---------- */
.section { padding: 1.5rem 0 2.5rem; }
.section-title { text-align: center; }
.section-title .caps { display: block; color: var(--color-ink-soft); margin-bottom: 0.25rem; }
.intro { max-width: 680px; margin: 0 auto; text-align: center; font-size: 1.125rem; }
.page-head { text-align: center; padding: 2rem 0 0.5rem; }

/* ---------- Menu cards ---------- */
.menu-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) { .menu-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .menu-grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--color-paper); border: 2px solid var(--color-ink); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.card-photo { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--color-sunflower-wash); border-bottom: 2px solid var(--color-ink); }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.card-head h3 { margin: 0; font-size: 1.75rem; }
.price { font-weight: 700; white-space: nowrap; font-size: 1.15rem; border-bottom: 3px solid var(--color-sunflower); }
.card-desc { margin: 0; }
.allergens { margin: 0; font-size: 0.95rem; }
.allergens strong { font-family: var(--font-caps); letter-spacing: 0.1em; text-transform: uppercase; }
.card details { font-size: 0.95rem; }
.card summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.card-actions { margin-top: auto; padding-top: 0.5rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* Quantity stepper */
.qty { display: inline-flex; align-items: stretch; border: 2px solid var(--color-ink); border-radius: var(--radius); overflow: hidden; background: var(--color-paper); }
.qty button { width: 44px; min-height: 44px; border: 0; background: var(--color-sunflower-wash); font-size: 1.3rem; cursor: pointer; color: var(--color-ink); }
.qty button:hover { background: var(--color-sunflower-light); }
.qty input[type="number"] { width: 3.2rem; min-height: 44px; padding: 0; border-radius: 0; box-shadow: none; border: 0; text-align: center; font: inherit; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Cart & checkout ---------- */
.cart-layout { display: grid; gap: 2rem; }
@media (min-width: 900px) { .cart-layout { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.panel { background: var(--color-paper); border: var(--border-double); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.panel h2 { font-size: 2rem; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 64px 1fr; gap: 0.75rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--color-line); }
.cart-line img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-small); border: 1px solid var(--color-ink); }
.cart-line-name { font-weight: 700; }
.cart-line-controls { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
@media (min-width: 520px) { .cart-line { grid-template-columns: 64px 1fr auto; } .cart-line-controls { grid-column: auto; } }
.link-button { background: none; border: 0; padding: 0.4rem; font: inherit; color: var(--color-danger); text-decoration: underline; cursor: pointer; min-height: 44px; }
.totals { display: flex; justify-content: space-between; font-size: 1.25rem; font-weight: 700; padding-top: 1rem; }
.empty-state { text-align: center; padding: 2rem 1rem; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.field label, .field legend, .label { font-weight: 700; }
.hint { font-size: 0.9rem; color: var(--color-ink-soft); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], select, textarea {
  font: inherit; color: var(--color-ink); background: var(--color-paper);
  border: 2px solid var(--color-ink-soft); border-radius: var(--radius-small);
  padding: 0.65rem 0.75rem; min-height: 48px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--color-ink); box-shadow: 0 0 0 3px var(--color-sunflower-light); outline: none; }
fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
.choice { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; margin-bottom: 0.5rem; border: 2px solid var(--color-line); border-radius: var(--radius); cursor: pointer; background: var(--color-paper); }
.choice:has(input:checked) { border-color: var(--color-ink); background: var(--color-sunflower-wash); }
.choice input { width: 22px; height: 22px; accent-color: var(--color-ink); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Messages ---------- */
.notice { padding: 0.9rem 1rem; border-radius: var(--radius); border: 2px solid var(--color-ink); background: var(--color-sunflower-wash); margin-bottom: 1rem; }
.notice-error { border-color: var(--color-danger); background: var(--color-danger-bg); color: var(--color-danger); }
.notice-success { border-color: var(--color-success); background: var(--color-success-bg); color: var(--color-success); }
.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%) translateY(150%);
  background: var(--color-ink); color: var(--color-paper); padding: 0.9rem 1.3rem; border-radius: var(--radius);
  border-left: 6px solid var(--color-sunflower); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  z-index: 200; transition: transform 0.25s ease; max-width: calc(100% - 2rem); font-weight: 600;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-left-color: #ff8a80; }

.order-summary dl { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; }
.order-summary dt { font-weight: 700; }
.order-summary dd { margin: 0; }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 800px) { .about-grid { grid-template-columns: 1fr 1.4fr; } }
.about-photo { border: var(--border-double); border-radius: var(--radius); background: var(--color-paper); padding: 0.5rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: var(--border-double); background: var(--color-paper); padding: 2rem 0 1.5rem; text-align: center; font-size: 0.95rem; }
.footer-name { font-family: var(--font-script); font-size: 2rem; font-weight: 700; margin: 0; }
.footer-tagline { margin: 0 0 1rem; }
.cottage-note { max-width: 640px; margin: 1rem auto 0; font-size: 0.85rem; color: var(--color-ink-soft); }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.admin-tabs button { flex: 1 1 auto; }
.admin-tabs button[aria-selected="true"] { background: var(--color-sunflower); }
.admin-tabs button[aria-selected="false"] { background: var(--color-paper); }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.admin-item { background: var(--color-paper); border: 2px solid var(--color-ink); border-radius: var(--radius); padding: 1rem; display: grid; grid-template-columns: 72px 1fr; gap: 0.75rem 1rem; }
.admin-item.is-hidden { opacity: 0.75; border-style: dashed; }
.admin-item img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-small); border: 1px solid var(--color-ink); }
.admin-item-title { font-weight: 700; font-size: 1.15rem; }
.admin-item-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--color-ink); margin-right: 0.3rem; }
.badge-yellow { background: var(--color-sunflower-light); }
.badge-gray { background: #eee; }
.badge-green { background: var(--color-success-bg); color: var(--color-success); border-color: var(--color-success); }
.badge-red { background: var(--color-danger-bg); color: var(--color-danger); border-color: var(--color-danger); }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.5rem; border: 2px solid var(--color-line); border-radius: var(--radius); cursor: pointer; font-weight: 600; background: var(--color-paper); }
.switch input { width: 22px; height: 22px; accent-color: var(--color-ink); }
dialog.editor { width: min(640px, 100%); max-height: 100%; border: var(--border-double); border-radius: var(--radius); padding: 0; background: var(--color-cream); color: var(--color-ink); }
dialog.editor::backdrop { background: rgba(29, 26, 23, 0.55); }
.editor-inner { padding: 1.25rem; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; margin-top: 1rem; }
.photo-preview { width: 100%; max-width: 320px; aspect-ratio: 4 / 3; object-fit: cover; border: 2px solid var(--color-ink); border-radius: var(--radius-small); background: var(--color-sunflower-wash); }
.order-card { background: var(--color-paper); border: 2px solid var(--color-ink); border-radius: var(--radius); padding: 1rem; }
.order-card h3 { font-family: var(--font-body); font-size: 1.1rem; margin: 0 0 0.25rem; }
.order-card ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.order-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.pickup-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.pickup-row input { flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Small phones: logo on top, all nav links on one row */
@media (max-width: 520px) {
  .header-inner { justify-content: center; }
  .brand-logo { height: 58px; }
  .nav-list { justify-content: center; gap: 0; }
  .nav-list a { padding: 0.5rem 0.5rem; letter-spacing: 0.08em; font-size: 0.9rem; }
  .pickup-badge { letter-spacing: 0.12em; font-size: 0.85rem; }
}
dialog.editor { max-width: calc(100% - 1rem); }
.admin-item-actions [data-move] { font-size: 1.25rem; min-width: 48px; }
