/* =============================================================================
   Blended — cart hire cost calculator
   Colours are taken from the Blended logo and shopfront illustration:
     deep green  #1d6828   logo wordmark
     leaf green  #4ba565   shopfront
     coral       #e88687   interior tiles
     terracotta  #db6a2e
     cream       #e7cf9c / #f3e6c8
     off-white   #f5f8f3
   Every colour is a token below, so the whole look changes from one place.
   ========================================================================== */

:root {
  --bg: #f4f7f1;
  --surface: #ffffff;
  --surface-2: #fbfcf8;
  --border: #dfe8db;
  --text: #1b2a1f;
  --text-muted: #5d6f60;
  --accent: #1d6828;
  --accent-hover: #175621;
  --accent-soft: #e6f1e4;
  --accent-text: #ffffff;
  --leaf: #4ba565;
  --coral: #e88687;
  --cream: #f3e6c8;
  --good: #1d6828;
  --danger: #a3261f;
  --warn-bg: #fdf1e7;
  --warn-border: #f0c9a9;
  --warn-text: #a9521f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(27, 42, 31, .05), 0 10px 28px rgba(27, 42, 31, .07);
  --maxw: 1100px;
  --font-display: "Baloo 2", ui-rounded, "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1711;
    --surface: #182219;
    --surface-2: #131c15;
    --border: #2b3a2d;
    --text: #eaf3e8;
    --text-muted: #9fb3a3;
    --accent: #5fbd73;
    --accent-hover: #74ca86;
    --accent-soft: #1e2e21;
    --accent-text: #0b140d;
    --leaf: #4ba565;
    --coral: #e88687;
    --cream: #222d1f;
    --good: #7fd193;
    --danger: #f08b82;
    --warn-bg: #2d2114;
    --warn-border: #5a3f24;
    --warn-text: #e9b98d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1711;
  --surface: #182219;
  --surface-2: #131c15;
  --border: #2b3a2d;
  --text: #eaf3e8;
  --text-muted: #9fb3a3;
  --accent: #5fbd73;
  --accent-hover: #74ca86;
  --accent-soft: #1e2e21;
  --accent-text: #0b140d;
  --leaf: #4ba565;
  --coral: #e88687;
  --cream: #222d1f;
  --good: #7fd193;
  --danger: #f08b82;
  --warn-bg: #2d2114;
  --warn-border: #5a3f24;
  --warn-text: #e9b98d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }

/* Any rule that sets `display` beats the browser's own [hidden] rule, so a
   hidden button with a .btn class stays on screen. This puts that right for
   every element rather than one at a time. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); 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;
}

/* --- Header ---------------------------------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 16px; padding-bottom: 16px;
}
.brand-logo {
  display: block;
  height: 34px;
  width: auto;
}
/* The deep-green wordmark needs a lift against a dark background. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo { filter: brightness(1.5) saturate(1.1); }
}
:root[data-theme="dark"] .brand-logo { filter: brightness(1.5) saturate(1.1); }
/* Shown only if the logo image is missing. */
.brand {
  margin: 0; font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 800; color: var(--accent); letter-spacing: -.01em;
}
.tagline { margin: 4px 0 0; font-size: .85rem; color: var(--text-muted); }

.theme-toggle {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }

/* --- Layout ---------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-top: 24px;
  padding-bottom: 48px;
  align-items: start;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 24px; }
  .quote { position: sticky; top: 24px; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
@media (min-width: 640px) { .panel { padding: 28px; } }

.page-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15;
}
@media (min-width: 640px) { .page-title { font-size: 2.15rem; } }
.page-intro { margin: 0 0 24px; color: var(--text-muted); }

/* --- Hero illustration ------------------------------------------------ */
.hero {
  margin: 0 0 24px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  line-height: 0;
  text-align: center;
}
.hero img {
  display: inline-block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 8px;
}

/* --- Form ------------------------------------------------------------ */
.field { border: 0; padding: 0; margin: 0 0 28px; }
.label {
  display: block; padding: 0; margin-bottom: 12px;
  font-size: .8rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}
.label-note { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .8; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.input-group label {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; font-weight: 550; font-size: .95rem;
}
.input-group input[type="number"],
.input-group input[type="date"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.input-group input:focus-visible,
.cart-option:focus-within,
.addon:focus-within,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.value-badge {
  margin-inline-start: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin: 6px 0 0;
}

.hint { margin: 6px 0 0; font-size: .8rem; color: var(--text-muted); min-height: 1em; }
.hint.is-alert { color: var(--warn-text); }

.check-standalone { display: flex; align-items: flex-end; }
.checkbox {
  display: flex; align-items: center; gap: 10px;
  margin: 0; font-weight: 450; cursor: pointer;
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* --- Cart chooser ----------------------------------------------------- */
.cart-options { display: grid; gap: 10px; }
@media (min-width: 560px) { .cart-options { grid-template-columns: repeat(3, 1fr); } }

.cart-option {
  position: relative;
  display: block;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cart-option:hover { border-color: var(--accent); }
.cart-option input { position: absolute; opacity: 0; pointer-events: none; }
.cart-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.cart-option-emoji { font-size: 1.5rem; line-height: 1; }
.cart-option-name { display: block; margin: 8px 0 4px; font-weight: 650; }
.cart-option-blurb { display: block; font-size: .8rem; color: var(--text-muted); }
.cart-option-from { display: block; margin-top: 8px; font-size: .8rem; font-weight: 650; color: var(--accent); }

/* --- Menu: one row per item, with a cup counter ----------------------- */
.menu-group {
  margin: 20px 0 8px;
  font-size: .8rem; font-weight: 700; color: var(--accent);
  letter-spacing: .02em;
}
.menu-group:first-child { margin-top: 0; }

.menu-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.menu-item + .menu-item { margin-top: 8px; }
.menu-item.is-chosen { border-color: var(--accent); background: var(--accent-soft); }

.menu-item-text { flex: 1 1 auto; min-width: 0; }
.menu-item-name { display: block; font-weight: 650; font-size: .95rem; }
.menu-item-note { display: block; font-size: .78rem; color: var(--text-muted); }
.menu-item-price {
  display: block; margin-top: 3px;
  font-size: .78rem; font-weight: 650; color: var(--accent);
}

.qty { flex: none; display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem; font-weight: 600; line-height: 1;
  cursor: pointer;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qty-input {
  width: 64px;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit; font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 420px) {
  .menu-item { flex-wrap: wrap; }
  .qty { width: 100%; justify-content: flex-end; }
}

.cups-total {
  margin: 14px 0 0;
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
}
.cups-total.is-alert { color: var(--warn-text); }

/* --- Select ------------------------------------------------------------ */
.input-group select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.input-group select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Add-ons ---------------------------------------------------------- */
.addons { display: grid; gap: 10px; }
@media (min-width: 560px) { .addons { grid-template-columns: 1fr 1fr; } }

.addon {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.addon:hover { border-color: var(--accent); }
.addon.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.addon input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.addon-name { display: block; font-weight: 550; font-size: .95rem; }
.addon-note { display: block; font-size: .78rem; color: var(--text-muted); }
.addon-price { display: block; margin-top: 3px; font-size: .78rem; font-weight: 650; color: var(--accent); }

/* --- Quote panel ------------------------------------------------------ */
.quote-head { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.quote-eyebrow {
  margin: 0; font-size: .75rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
}
.quote-total {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.quote-sub { margin: 4px 0 0; font-size: .85rem; color: var(--text-muted); }

.quote-warnings:not(:empty) { margin-top: 16px; display: grid; gap: 8px; }
.warning {
  padding: 10px 12px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: .82rem;
}

.breakdown {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: .88rem;
}
.breakdown td { padding: 8px 0; vertical-align: top; }
.breakdown tbody tr + tr td { border-top: 1px dashed var(--border); }
.breakdown .cell-amount {
  text-align: end; white-space: nowrap; padding-inline-start: 12px;
  font-variant-numeric: tabular-nums; font-weight: 550;
}
.breakdown .cell-detail { display: block; font-size: .78rem; color: var(--text-muted); }
.breakdown tfoot td { padding-top: 10px; border-top: 1px solid var(--border); }
.breakdown tfoot tr + tr td { border-top: 0; padding-top: 4px; }
.breakdown .row-total td {
  padding-top: 12px; border-top: 2px solid var(--border);
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 800;
}
.breakdown .row-discount td { color: var(--good); }
.breakdown .row-deposit td { color: var(--text-muted); font-size: .82rem; }

.disclaimer { margin: 16px 0 0; font-size: .78rem; color: var(--text-muted); }

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-block; width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit; font-weight: 600;
  cursor: pointer;
}
.btn-primary { margin-top: 16px; background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  width: auto; background: transparent; color: var(--text-muted);
  border-color: var(--border); font-weight: 500; font-size: .875rem; padding: 9px 16px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

/* --- Footer ----------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  font-size: .8rem;
  color: var(--text-muted);
}
.site-footer p { margin: 0; }

/* --- Print: just the estimate ----------------------------------------- */
@media print {
  .site-header, .site-footer, .form, .btn, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .layout { display: block; padding: 0; }
  .panel { border: 0; box-shadow: none; padding: 0; }
  .quote { position: static; }
}

/* --- Sticky running total on phones ----------------------------------- */
.mobile-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(42, 33, 27, .12);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.mobile-bar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.mobile-bar-label {
  margin: 0; font-size: .7rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted);
}
.mobile-bar-total {
  margin: 1px 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.mobile-bar-btn { width: auto; flex: none; margin-top: 0; padding: 10px 16px; font-size: .9rem; }

/* Only on phones — the desktop layout already keeps the estimate in view. */
@media (min-width: 900px) { .mobile-bar { display: none; } }
@media (max-width: 899px) { body.has-mobile-bar { padding-bottom: 84px; } }
@media print { .mobile-bar { display: none !important; } }

/* --- The order minimum, stated before anything is chosen --------------- */
.minimum-banner {
  margin: 0 0 24px;
  padding: 12px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .88rem;
  font-weight: 600;
}

.field-note {
  margin: -4px 0 14px;
  font-size: .82rem;
  color: var(--text-muted);
}

/* --- Enquiry form ------------------------------------------------------ */
.input-group-wide { margin-top: 18px; }

.input-group textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.input-group input[type="text"],
.input-group input[type="tel"],
.input-group input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.input-group textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.error {
  margin: 6px 0 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--danger);
}
.error:empty { display: none; }

.btn-send { margin-top: 20px; }

.send-status { margin: 12px 0 0; font-size: .85rem; color: var(--text-muted); }
.send-status:empty { display: none; }
.send-status.is-error { color: var(--danger); font-weight: 600; }
.send-status a { color: var(--accent); font-weight: 700; }

/* --- After sending ----------------------------------------------------- */
.sent-panel {
  margin: 0 0 28px;
  padding: 20px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.sent-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 800; color: var(--accent);
}
.sent-body { margin: 0 0 16px; font-size: .9rem; color: var(--text); }

@media print {
  .minimum-banner, .sent-panel { display: none !important; }
}

/* The minimum quantity, shown on every menu item so it is never a surprise */
.menu-item-min {
  display: inline-block;
  margin-top: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
}

/* "Choose your flavours later" — said by the menu, and again once sent */
.choose-later {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-inline-start: 3px solid var(--leaf);
  border-start-end-radius: var(--radius-sm);
  border-end-end-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: .82rem;
}

/* The date stands alone at the top, so it does not need full width */
.input-group-date { max-width: 320px; }


/* --- Language switch --------------------------------------------------- */
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.lang-toggle {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font: inherit;
  font-size: .85rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }
.lang-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Reading right to left ---------------------------------------------
   The layout is built from flex and grid, which mirror themselves, so only
   the few places that assume a direction need saying again. */
[dir="rtl"] .menu-item-min,
[dir="rtl"] .value-badge { font-variant-numeric: normal; }

/* Latin digits inside Arabic text still read left to right; isolating the
   numeric runs keeps "120 × 1.5" from being shuffled. */
[dir="rtl"] .cell-amount,
[dir="rtl"] .menu-item-price,
[dir="rtl"] .addon-price,
[dir="rtl"] .cart-option-from,
[dir="rtl"] .menu-item-min,
[dir="rtl"] .quote-total,
[dir="rtl"] .mobile-bar-total,
[dir="rtl"] .value-badge,
[dir="rtl"] .cell-detail {
  unicode-bidi: isolate;
}

/* The date and range inputs stay left to right: their controls are built
   that way and a mirrored one is harder to use, not easier. */
[dir="rtl"] input[type="date"],
[dir="rtl"] input[type="range"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="email"] {
  direction: ltr;
  text-align: start;
}
[dir="rtl"] input[type="date"] { text-align: end; }

/* The quantity counter keeps − on the left and + on the right in both
   directions, which is what a hand expects wherever it reads from. */
[dir="rtl"] .qty { flex-direction: row-reverse; }

/* Extras the customer counts out sit above the tick boxes */
.extra-counters { display: grid; gap: 8px; margin-bottom: 14px; }
.extra-counters .menu-item + .menu-item { margin-top: 0; }
.menu-item-min:empty { display: none; }

/* The link back to the mail app, if it did not open by itself */
.sent-again { margin: 0 0 16px; }
.sent-again a { color: var(--accent); font-weight: 700; font-size: .9rem; }
.sent-again a[hidden] { display: none; }
