/* Colours are taken from Louie: honey fur, brown outlines, denim collar, pink icing. */
:root {
  --cream: #fff8ec;
  --cream-2: #fdecd0;
  --card: #ffffff;
  --honey: #f2b35e;
  --honey-dark: #d98b2b;
  --brown: #5c3412;
  --brown-soft: #8a6446;
  --denim: #2f5da8;
  --denim-dark: #234a88;
  --pink: #ef7896;
  --pink-soft: #fde3ea;
  --green: #2f8a4f;
  --green-soft: #e1f3e6;
  --red: #b4432a;
  --red-soft: #fbe3dc;
  --line: #f1dcb8;
  --radius: 20px;
  --shadow: 0 4px 0 var(--line), 0 10px 30px rgba(92, 52, 18, 0.08);
  --font-head: 'Fredoka', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* Keep "hidden" working even on elements whose class sets a display value (like .btn). */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--denim); }
/* Pictures always keep their own shape: never stretched, never cropped. */
img { max-width: 100%; height: auto; object-fit: contain; }

.wrap { max-width: 1100px; margin: 0 auto; padding-inline: 20px; }
.muted { color: var(--brown-soft); }
.center { text-align: center; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: rgba(255, 248, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; padding-block: 10px; }
/* Small honey bar under section headings. */
.section-head h2::after {
  content: ''; display: block; width: 64px; height: 5px; margin: 12px auto 0;
  border-radius: 999px; background: var(--honey);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brown); }
.brand img { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--honey); background: #fff; }
.brand span { font-family: var(--font-head); font-weight: 600; font-size: 1.45rem; white-space: nowrap; }
@media (max-width: 420px) { .brand span { font-size: 1.2rem; } .brand img { width: 40px; height: 40px; } .site-nav a { padding-inline: 8px; } }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--brown); font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.site-nav a:hover { background: var(--cream-2); }
@media (max-width: 640px) { .site-nav .hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1.05rem var(--font-head);
  padding: 12px 24px;
  border-radius: 999px;
  border: 0;
  background: var(--denim);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--denim-dark);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--denim-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.honey { background: var(--honey); color: var(--brown); box-shadow: 0 4px 0 var(--honey-dark); }
.btn.pink { background: var(--pink); box-shadow: 0 4px 0 #c9536f; }
.btn.ghost { background: transparent; color: var(--brown); box-shadow: inset 0 0 0 2px var(--line); }
.btn.danger { background: var(--red); box-shadow: 0 4px 0 #7f2c1a; }
.btn.small { padding: 7px 14px; font-size: 0.92rem; }
.site-nav .btn { padding: 8px 18px; color: #fff; }
.site-nav .btn:hover { background: var(--denim); }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(circle at 12% 20%, rgba(242, 179, 94, 0.25) 0 70px, transparent 71px),
    radial-gradient(circle at 88% 85%, rgba(239, 120, 150, 0.18) 0 90px, transparent 91px),
    var(--cream);
  overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; padding-block: 48px 32px; }
.hero p.lead { font-size: 1.2rem; max-width: 34ch; }
.hero .art { position: relative; text-align: center; }
.hero .art img { width: min(420px, 100%); filter: drop-shadow(0 12px 18px rgba(92, 52, 18, 0.18)); }
.hero .badge {
  position: absolute; right: 4%; top: 6%;
  background: var(--pink);
  border: 5px solid #fff;
  color: #fff;
  font: 600 0.95rem var(--font-head);
  padding: 10px; border-radius: 50%;
  transform: rotate(10deg);
  width: 124px; height: 124px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  box-shadow: 0 4px 0 #c9536f;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding-block: 28px; }
  .hero p.lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero .art img { width: min(280px, 80%); }
  .hero .badge { width: 90px; height: 90px; font-size: 0.85rem; }
}

.next-delivery {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--card); border: 2px solid var(--line); border-radius: 999px;
  padding: 6px 16px 6px 8px; font-weight: 700; font-size: 0.95rem;
}
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }
.dot.sold { background: var(--red); }

/* ---------- sections ---------- */
section.block { padding-block: 56px; }
section.alt { background: var(--cream-2); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }

.biscuit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.biscuit-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
}
.biscuit-card .photo { background: var(--cream-2); display: flex; align-items: center; justify-content: center; }
/* Same-size frame on every card; the whole photo fits inside it at its own shape. */
.biscuit-card .photo { aspect-ratio: 4 / 3; overflow: hidden; }
.biscuit-card .photo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.biscuit-card .photo img.placeholder { max-width: 58%; max-height: 80%; }
.biscuit-card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.biscuit-card .price { font: 600 1.15rem var(--font-head); color: var(--denim); margin-top: auto; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; }
.step { background: var(--card); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.step img { height: 150px; width: auto; max-width: 100%; }
.step .num {
  display: inline-flex; width: 34px; height: 34px; border-radius: 50%;
  align-items: center; justify-content: center;
  background: var(--honey); font: 600 1.1rem var(--font-head); margin-bottom: 6px;
}

.callout {
  background: var(--card); border: 2px dashed var(--honey); border-radius: var(--radius);
  padding: 20px 24px; display: flex; gap: 18px; align-items: center;
}
.callout img { width: 110px; flex: none; }
@media (max-width: 560px) { .callout { flex-direction: column; text-align: center; } }

.site-footer { padding-block: 32px; text-align: center; color: var(--brown-soft); font-size: 0.92rem; }
.site-footer { border-top: 2px solid var(--line); }
.site-footer .haste { font: 600 1.15rem var(--font-head); color: var(--brown); }

/* History and recipe */
#story { position: relative; overflow: hidden; }
.story { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 820px) { .story { grid-template-columns: 1fr; } }
.story p { font-size: 1.05rem; }
/* Big faded thistles in the corners, so they sit behind the words without getting in the way. */
.story-thistle { position: absolute; width: 170px; opacity: 0.12; pointer-events: none; }
.story-thistle.left { left: -30px; bottom: -40px; transform: rotate(-14deg); }
.story-thistle.right { right: -24px; top: -30px; transform: rotate(16deg) scaleX(-1); }
@media (max-width: 820px) { .story-thistle { width: 120px; } .story-thistle.left { display: none; } }
.story-head { display: flex; align-items: center; gap: 12px; }
.story-head img { width: 34px; flex: none; }
.story-head h2 { margin: 0; }
/* A thin line with a wee saltire in the middle, like an old book divider. */
.flourish { display: flex; align-items: center; gap: 10px; margin: 12px 0 18px; max-width: 340px; }
.flourish span { flex: 1; height: 2px; background: var(--line); }
.flourish img { width: 26px; border-radius: 2px; }
/* Louie stands beside the ratio and scoops, so he doesn't push the card down. */
.recipe-top { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-bottom: 14px; }
.recipe-top .scoops { margin-bottom: 0; }
.story-louie { width: 150px; filter: drop-shadow(0 8px 10px rgba(92, 52, 18, 0.16)); }
@media (max-width: 420px) { .story-louie { width: 110px; } }
.recipe-card {
  position: relative; background: var(--card);
  border: 2px solid var(--honey); outline: 2px solid var(--line); outline-offset: 5px;
  border-radius: 20px; padding: 22px; text-align: center; margin: 7px;
}
.recipe-flag { position: absolute; top: -12px; right: 18px; width: 38px; border-radius: 3px; transform: rotate(6deg); box-shadow: 0 2px 0 rgba(92, 52, 18, 0.15); }
.recipe-card .ratio { font: 600 3rem var(--font-head); letter-spacing: 0.05em; line-height: 1; margin: 4px 0 14px; }
.scoops { display: flex; justify-content: center; gap: 18px; align-items: flex-end; margin-bottom: 14px; }
.scoop-col { display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
.scoop-col b { display: block; width: 44px; height: 26px; border-radius: 22px 22px 8px 8px; border: 2px solid var(--brown); }
.scoop-col.flour b { background: #fffaf0; }
.scoop-col.butter b { background: #f7d774; }
.scoop-col.sugar b { background: #ffffff; background-image: radial-gradient(#d9c7a8 1px, transparent 1.5px); background-size: 6px 6px; }
.scoop-col span { font-weight: 800; font-size: 0.9rem; margin-top: 6px; }
.organic {
  display: flex; gap: 12px; align-items: center; text-align: left;
  background: var(--green-soft); color: var(--green); border-radius: 16px; padding: 12px 14px; font-weight: 700;
}
.organic .leaf { font-size: 1.8rem; line-height: 1; }
.site-footer a { color: var(--brown-soft); }

/* ---------- forms ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-weight: 700; }
.field .hint { font-size: 0.88rem; color: var(--brown-soft); }
input[type='text'], input[type='email'], input[type='tel'], input[type='password'], input[type='number'], input[type='date'], textarea, select {
  font: inherit; color: var(--brown);
  padding: 11px 14px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fffdf8;
  width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(47, 93, 168, 0.3); border-color: var(--denim); }
textarea { min-height: 84px; resize: vertical; }
.field.has-error input, .field.has-error textarea { border-color: var(--red); }
.field-error { color: var(--red); font-weight: 700; font-size: 0.9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.alert { border-radius: 14px; padding: 12px 16px; font-weight: 700; margin-bottom: 16px; }
.alert.error { background: var(--red-soft); color: var(--red); }
.alert.ok { background: var(--green-soft); color: var(--green); }
.alert.info { background: var(--cream-2); color: var(--brown); }

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

/* ---------- order page ---------- */
.order-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; padding-block: 32px 64px; }
@media (max-width: 900px) { .order-layout { grid-template-columns: 1fr; } }
/* Grid children otherwise refuse to shrink below their content and push the page sideways on phones. */
.order-layout > * { min-width: 0; }
.order-step { margin-bottom: 24px; }
.order-step h2 { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; }
.order-step h2 .num {
  display: inline-flex; width: 36px; height: 36px; border-radius: 50%; flex: none;
  align-items: center; justify-content: center; background: var(--honey); font-size: 1.1rem;
}

/* Box builder */
.quick-add { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.quick-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 1rem var(--font-head); color: var(--brown);
  background: #fffdf8; border: 2px solid var(--line); border-radius: 999px; padding: 9px 16px;
  box-shadow: 0 3px 0 var(--line);
}
.quick-btn:hover { border-color: var(--honey); }
.quick-btn.mix { background: var(--honey); border-color: var(--honey-dark); box-shadow: 0 3px 0 var(--honey-dark); }
.quick-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brown); flex: none; }

.box-list { display: flex; flex-direction: column; gap: 16px; }
.box-empty { text-align: center; padding: 16px; border: 2px dashed var(--line); border-radius: 16px; color: var(--brown-soft); }
.box-empty p { margin: 6px 0 0; }
.box-card { border: 3px solid var(--line); border-radius: 18px; background: #fffdf8; overflow: hidden; }
.box-card.is-full { border-color: var(--green); }
.box-card header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--cream-2); }
.box-card header h3 { margin: 0; font-size: 1.15rem; }
.box-body { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 14px; align-items: start; }
@media (max-width: 560px) { .box-body { grid-template-columns: 1fr; } }
.tray-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* Looks like an open biscuit box seen from above: 4 rows of 3. */
.tray {
  display: grid; grid-template-columns: repeat(3, 34px); gap: 6px; padding: 10px;
  background: #c99b66; border: 3px solid var(--brown); border-radius: 12px;
}
.tray i { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--brown); display: block; box-shadow: inset -3px -4px 0 rgba(92, 52, 18, 0.18), inset 3px 3px 0 rgba(255, 255, 255, 0.35); }
.tray i.empty { background: rgba(255, 248, 236, 0.35); border: 2px dashed rgba(92, 52, 18, 0.45); box-shadow: none; }
.box-status { font-weight: 800; font-size: 0.9rem; color: var(--brown-soft); text-align: center; }
.box-status.full { color: var(--green); }
.box-flavors { display: flex; flex-direction: column; gap: 8px; }
.flavor-line { display: flex; align-items: center; gap: 10px; }
.flavor-line .name { flex: 1; font-weight: 700; }
.fill-rest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.9rem; color: var(--brown-soft); margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font: 700 0.85rem var(--font-body); color: var(--brown); cursor: pointer; }
.chip .swatch { width: 12px; height: 12px; }
.link-btn { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--brown-soft); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.88rem; }
.box-card footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 2px solid var(--line); }
.box-card footer .box-price { margin-left: auto; font-family: var(--font-head); color: var(--denim); }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 1.1rem; padding: 6px 8px; border-radius: 10px; color: var(--brown-soft); }
.icon-btn:hover { background: #fff; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper.small button { width: 32px; height: 32px; font-size: 1.15rem; }
.stepper.small output { min-width: 22px; font-size: 1.1rem; }
.stepper button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--honey); color: var(--brown); font: 600 1.4rem var(--font-head); line-height: 1;
}
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper output { min-width: 28px; text-align: center; font: 600 1.25rem var(--font-head); }

.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.day {
  position: relative; border: 2px solid var(--line); background: #fffdf8; border-radius: 16px;
  padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: var(--brown);
}
.day strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; }
.day small { display: block; color: var(--brown-soft); }
.day.selected { border-color: var(--denim); background: #eef3fc; box-shadow: 0 0 0 2px var(--denim); }
.day:disabled { cursor: not-allowed; opacity: 0.6; }
.day .tag { display: inline-block; margin-top: 4px; font-size: 0.8rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.tag.left { background: var(--green-soft); color: var(--green); }
.tag.sold { background: var(--red-soft); color: var(--red); }
.tag.closed { background: #eee; color: #777; }

.summary { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 90px); }
.summary img { width: 140px; display: block; margin: -10px auto 4px; }
.summary-lines { list-style: none; padding: 0; margin: 0 0 12px; }
.summary-lines li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.summary .total { display: flex; justify-content: space-between; border-top: 2px solid var(--line); padding-top: 10px; font: 600 1.3rem var(--font-head); }
.summary .btn { width: 100%; margin-top: 16px; }

/* ---------- status page ---------- */
.status-hero { text-align: center; padding-block: 32px 8px; }
.status-hero img { width: 200px; }
.status-pill { display: inline-block; padding: 6px 16px; border-radius: 999px; font-weight: 800; }
.status-new { background: #fff1d6; color: #9a5b00; }
.status-paid { background: #e5edfb; color: var(--denim); }
.status-delivered { background: var(--green-soft); color: var(--green); }
.status-cancelled { background: var(--red-soft); color: var(--red); }

.timeline { display: flex; justify-content: space-between; list-style: none; padding: 0; margin: 20px 0; position: relative; }
.timeline::before { content: ''; position: absolute; top: 15px; left: 8%; right: 8%; height: 4px; background: var(--line); }
.timeline li { position: relative; flex: 1; text-align: center; font-size: 0.88rem; font-weight: 700; color: var(--brown-soft); }
.timeline li span {
  display: flex; margin: 0 auto 6px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); border: 4px solid var(--line); align-items: center; justify-content: center;
}
.timeline li.done span { background: var(--honey); border-color: var(--honey-dark); }
.timeline li.done { color: var(--brown); }

.narrow { max-width: 680px; margin: 0 auto; padding-block: 16px 64px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.kv dt { font-weight: 800; }
.kv dd { margin: 0; }



/* Big, hard-to-miss warning on the order page while the site is in test mode. */
.test-banner {
  background: #fff1c2; border: 3px dashed #c98a00; color: #5a3b00;
  border-radius: 16px; padding: 14px 18px; margin: 0 0 20px; font-size: 1.05rem; line-height: 1.5;
}
.test-banner strong { display: block; font: 600 1.25rem var(--font-head); margin-bottom: 4px; }
