:root {
  --navy: #0B1150;
  --navy-hover: #1A237A;
  --blue: #0784C3;
  --green: #0E6B2C;
  --green-hover: #0B5A24;
  --olive: #6F7D16;
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --tint: #F0F2F7;
  --muted: #5B6178;
  --line: #E4E6EE;
  --danger: #B42318;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 17, 80, .04), 0 8px 24px rgba(11, 17, 80, .07);
  color-scheme: light;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--navy);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0; }
[hidden] { display: none !important; }
.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand img { height: 40px; width: auto; }
.cart-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--navy); }
.cart-btn:hover { background: var(--tint); }
.cart-count { position: absolute; top: 0; right: -2px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; }
.footer { border-top: 1px solid var(--line); padding-block: 24px; color: var(--muted); font-size: 13px; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); }
.btn-secondary { background: var(--green); color: #fff; }
.btn-secondary:hover { background: var(--green-hover); }
.btn-outline { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1px var(--line); }
.btn-outline:hover { background: var(--tint); }
.btn-ghost { background: none; color: var(--danger); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-block { width: 100%; }
.link-btn { padding: 6px 0 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
input, textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 400; color: inherit; }
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }

/* Home */
.hero { display: grid; gap: 32px; align-items: center; padding-block: 40px 24px; }
.eyebrow, .kicker { margin: 0 0 10px; color: var(--olive); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; }
.lede { max-width: 34em; margin: 16px 0 24px; color: var(--muted); font-size: 18px; }
.pin-check { display: flex; flex-wrap: wrap; gap: 8px; max-width: 440px; }
.pin-check input { flex: 1 1 180px; width: auto; }
.pin-result { min-height: 1.5em; margin-top: 10px; font-weight: 600; }
.is-ok { color: var(--green); }
.is-error { color: var(--danger); }
.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 460px; padding-bottom: 24px; }
.hero-art > div { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-art > div:nth-child(2) { transform: translateY(24px); }
@media (min-width: 800px) {
  .hero { grid-template-columns: 1.15fr .85fr; padding-block: 64px 40px; }
  .hero-art { max-width: none; }
}

.shop { padding-block: 32px; }
.shop-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.shop-head h2 { font-size: 28px; }
.tabs { display: flex; gap: 4px; max-width: 100%; padding: 4px; overflow-x: auto; background: #EBEDF3; border-radius: 999px; }
.tab { min-height: 40px; padding: 8px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tab[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(11, 17, 80, .12); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.card .kicker { margin: 0; font-size: 11px; }
.card h3 { font-size: 16px; }
.card-notes { color: var(--muted); font-size: 13px; }
.card-price { margin-top: auto; padding-top: 8px; font-weight: 700; }
.perks { display: grid; gap: 12px; padding-block: 16px 56px; }
@media (min-width: 720px) { .perks { grid-template-columns: repeat(3, 1fr); } }
.perk { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.perk span { color: var(--muted); font-size: 14px; }

/* Shared page pieces */
.page { padding-block: 24px 56px; }
.back { display: inline-block; margin-bottom: 16px; font-weight: 600; text-decoration: none; }
.page-title { margin-bottom: 24px; font-size: clamp(28px, 4vw, 36px); }
.empty { padding-block: 80px; text-align: center; }
.empty p { margin: 8px 0 24px; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; }

/* Product */
.product { display: grid; gap: 28px; }
.product-art { overflow: hidden; border-radius: 20px; }
@media (min-width: 800px) {
  .product { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
  .product-art { position: sticky; top: 88px; }
}
.product-info h1 { margin-bottom: 12px; font-size: clamp(28px, 4vw, 40px); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--tint); font-size: 13px; font-weight: 600; }
.roast { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.roast i { width: 10px; height: 10px; border-radius: 50%; background: #DDE0EA; }
.roast i.on { background: var(--navy); }
.roast span { margin-right: 4px; }
.notes-line { margin: 18px 0 8px; font-weight: 600; }
.desc { color: var(--muted); }
.field { margin: 24px 0 0; padding: 0; border: 0; }
.field legend { margin-bottom: 10px; padding: 0; font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.pill span { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 10px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 600; text-align: center; }
.pill small { color: var(--muted); font-size: 12px; font-weight: 500; }
.pill input:checked + span { background: #F3F4FA; border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.pill input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.buy-bar { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.btn-grow { flex: 1; }
@media (max-width: 799px) {
  .buy-bar { position: sticky; bottom: 0; margin-inline: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: rgba(250, 250, 247, .97); border-top: 1px solid var(--line); }
}
.stepper { display: inline-flex; align-items: center; height: 48px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.stepper button { width: 44px; height: 100%; border: 0; border-radius: 999px; background: none; color: var(--navy); font-size: 20px; cursor: pointer; }
.stepper output { min-width: 28px; font-weight: 700; text-align: center; }
.stepper-sm { height: 38px; }
.stepper-sm button { width: 36px; }

/* Cart & checkout */
.cart-layout, .checkout-layout { display: grid; gap: 24px; align-items: start; }
@media (min-width: 880px) {
  .cart-layout, .checkout-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .summary { position: sticky; top: 88px; }
}
.cart-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cart-item { display: flex; gap: 14px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.cart-thumb { flex-shrink: 0; width: 88px; overflow: hidden; border-radius: 12px; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item h3 { font-size: 16px; }
.cart-item .muted { margin: 2px 0 10px; }
.cart-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.summary { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.summary h2 { margin-bottom: 12px; font-size: 18px; }
.summary-items { margin: 0 0 8px; padding: 0 0 8px; list-style: none; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.summary-items li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.totals { margin: 0 0 16px; }
.totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.totals dd { margin: 0; font-weight: 600; }
.totals .total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 800; }
.totals .total dd { font-weight: 800; }
.free { color: var(--green); }
.hint { margin: -6px 0 14px; color: var(--olive); font-size: 13px; font-weight: 600; }
.panel { margin-bottom: 16px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { margin-bottom: 14px; font-size: 18px; }
.input-label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.field-row { display: grid; gap: 0 14px; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
.phone-input { display: flex; }
.phone-input .prefix { display: grid; place-items: center; padding: 0 12px; background: var(--tint); border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; font-weight: 600; }
.phone-input input { border-radius: 0 12px 12px 0; }
.help { color: var(--muted); font-size: 13px; }
.pay-option { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.pay-option input { flex-shrink: 0; width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--navy); }
.pay-option span { display: flex; flex-direction: column; }
.pay-option small { color: var(--muted); font-size: 13px; }
.pay-option:has(input:checked) { background: #F5F6FB; border-color: var(--navy); }
.pay-option.is-disabled { opacity: .55; cursor: not-allowed; }
.form-error { margin-top: 12px; color: var(--danger); font-size: 14px; font-weight: 600; }
.form-error:empty { display: none; }

/* Order placed */
.done { max-width: 620px; margin-inline: auto; }
.done-head { text-align: center; margin-bottom: 24px; }
.done-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 8px auto 16px; border-radius: 50%; background: #E4F2E8; color: var(--green); }
.done-head h1 { font-size: clamp(26px, 4vw, 34px); }
.done-head p { margin-top: 8px; color: var(--muted); }
.done .summary { margin-bottom: 20px; }
.done address { font-style: normal; color: var(--muted); font-size: 14px; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 600; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#toast a { margin-left: 10px; color: #9FD8FF; }
@media (max-width: 799px) { #toast { bottom: calc(92px + env(safe-area-inset-bottom)); } }

/* Orders dashboard */
.admin-tag { margin-right: auto; color: var(--muted); font-size: 14px; font-weight: 700; }
.auth { max-width: 420px; margin: 40px auto; }
.auth p { margin-bottom: 16px; color: var(--muted); }
.admin-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.admin-head .page-title { margin-bottom: 16px; }
.orders { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.order { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.order.is-fresh { border-color: var(--green); box-shadow: 0 0 0 3px rgba(14, 107, 44, .15); }
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.order-head h2 { font-size: 18px; }
.order-grid { display: grid; gap: 20px; }
@media (min-width: 760px) { .order-grid { grid-template-columns: 1fr 1fr; } }
.order h3 { margin-bottom: 8px; color: var(--olive); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.order section p { margin-bottom: 6px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 14px; }
.contact-links a { font-weight: 700; }
.contact-links .wa { color: var(--green); }
.note { padding: 6px 10px; background: #FAFAF2; border-left: 3px solid var(--olive); }
.order-items { margin: 0 0 8px; padding: 0; list-style: none; }
.order-items li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.order-items small { display: block; color: var(--muted); }
.order .totals { margin-bottom: 8px; font-size: 14px; }
.order .totals .total { font-size: 16px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.order-actions:empty { display: none; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-new { background: #E3F2FB; color: #05629A; }
.badge-confirmed { background: #E8E9F5; color: var(--navy); }
.badge-out_for_delivery { background: #F1F3DE; color: #556012; }
.badge-delivered { background: #E4F2E8; color: var(--green); }
.badge-cancelled { background: #F2F2F4; color: #6B6F80; }
.no-orders { padding: 48px 0; color: var(--muted); text-align: center; }
