/* SAREI shared styles: tokens, base, header, controls, drawer, toast */
/* Single light theme by design: white ground, warm neutrals, pastel fills. */
:root {
  color-scheme: light;
  --ground: #FFFFFF;
  --surface: #FFFFFF;
  --sunk: #F7F4F1;
  --ink: #2E2C2A;
  --muted: #7A7570;
  --line: #ECE7E3;
  --accent: #A8566F;          /* deep rose, for text and outlines on white */
  --accent-ink: #2E2C2A;
  --blush: #F7D9E0;
  --blush-deep: #F0C4D0;
  --sage: #DDE8D5;
  --lavender: #E6E0F3;
  --butter: #F8EFCB;
  --sky: #DCE9F2;
  --moss: #5E7A4C;
  --stem: #8AA678;
  --peak: #DDE8D5;
  --limited: #F8EFCB;
  --ending: #F7D9E0;
  --danger: #B3261E;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1180px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.6 var(--body);
  padding-inline: var(--gutter);
}
img { max-width: 100%; }
.wrap { max-width: var(--max); margin-inline: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; font-variation-settings: "SOFT" 100; line-height: 1.1; text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h3 { font-size: 1.5rem; }
p { margin: 0; }
a { color: inherit; }
.eyebrow { font: 500 0.95rem/1.2 var(--body); color: var(--accent); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 0.95rem/1 var(--body); padding: 14px 22px; border-radius: 999px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none; transition: background .2s, color .2s;
}
.btn:hover { background: var(--ink); color: var(--ground); }
.btn.primary { background: var(--blush); border-color: var(--blush); color: var(--ink); }
.btn.primary:hover { background: var(--blush-deep); border-color: var(--blush-deep); color: var(--ink); }
.btn.small { padding: 9px 14px; font-size: 0.85rem; }
.btn.quiet { border-color: var(--line); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--surface); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: var(--ink); }
.btn.primary:disabled:hover { background: var(--blush); border-color: var(--blush); color: var(--ink); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* Header */
header.site {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  margin-inline: calc(var(--gutter) * -1); padding: 14px var(--gutter);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 0;
}
header.site .wrap { display: flex; align-items: center; gap: 20px; }
/* Logo: the name in a geometric sans, its upside-down reflection at half size spread to the same width,
   and FLORAL set small on the right (from the SAREI brand artwork). --logo sets the overall size. */
.logo {
  --logo: 1.6rem;
  display: inline-grid; grid-template-columns: max-content; justify-items: stretch; row-gap: calc(var(--logo) * 0.2);
  color: var(--ink); text-decoration: none; line-height: 0.74; white-space: nowrap;
  font-family: "Jost", Futura, "Futura PT", "Century Gothic", "Avenir Next", sans-serif; text-transform: uppercase;
}
.logo-word { font-weight: 400; font-size: var(--logo); letter-spacing: 0.035em; margin-right: -0.035em; }
.logo-mirror { display: flex; justify-content: space-between; font-weight: 300; font-size: calc(var(--logo) * 0.48); transform: rotate(180deg); }
.logo-floral { justify-self: end; margin-top: calc(var(--logo) * 0.06); font: 400 max(10px, calc(var(--logo) * 0.13))/1 var(--body); letter-spacing: 0.12em; color: var(--muted); }
.logo.compact .logo-floral { display: none; }
.logo.large { --logo: 3rem; }
.gate .logo, .auth .logo { margin-bottom: 28px; }
nav.links { display: flex; gap: 22px; margin-left: auto; }
nav.links a { text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--muted); }
nav.links a:hover, nav.links a[aria-current="page"] { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.account-link { font-weight: 500; font-size: 0.95rem; text-decoration: none; color: var(--ink); white-space: nowrap; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.account-link:hover { color: var(--accent); }
.count {
  font: 500 0.75rem/1 var(--mono); background: var(--blush); color: var(--ink);
  border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding-inline: 6px;
}
@media (max-width: 860px) { nav.links { display: none; } .header-actions { margin-left: auto; } }

/* Forms */
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-weight: 600; font-size: 0.92rem; }
.field small { color: var(--muted); font-size: 0.82rem; }
.fields { display: grid; gap: 14px; }
.fields.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .fields.two { grid-template-columns: 1fr; } }
textarea, input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], select {
  width: 100%; font: 400 1rem/1.4 var(--body); color: var(--ink); background: var(--ground);
  border: 1px solid color-mix(in srgb, var(--muted) 45%, var(--line)); border-radius: 6px; padding: 11px 13px;
}
textarea { resize: vertical; line-height: 1.5; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 0.95rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--moss); }
.form-error { color: var(--danger); font-weight: 500; font-size: 0.92rem; }
.form-ok { color: var(--moss); font-weight: 500; font-size: 0.92rem; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 0.92rem; color: var(--muted); }
.segmented input:checked + span { background: var(--blush); color: var(--ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 0.8rem/1 var(--body); padding: 6px 10px; border-radius: 999px; white-space: nowrap; color: var(--ink); background: var(--sunk); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; }
.pill.peak, .pill.done, .pill.ready { background: var(--sage); }
.pill.limited, .pill.out { background: var(--butter); }
.pill.confirmed { background: var(--sky); }
.pill.ending, .pill.new { background: var(--blush); }
.pill.cancelled, .pill.hiddenstate, .pill.soldout { background: var(--sunk); color: var(--muted); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.12); flex: none; }

/* Basket drawer */
.scrim { position: fixed; inset: 0; background: rgba(46, 44, 42, .28); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 41;
  background: var(--surface); border-left: 1px solid var(--line);
  display: grid; grid-template-rows: auto 1fr auto;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: slide .28s ease-out;
}
@keyframes slide { from { transform: translateX(30px); opacity: .4; } }
.drawer > header { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.drawer > footer { padding: 18px 22px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.drawer .body { overflow-y: auto; padding: 8px 22px 22px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.item .what { font-weight: 600; }
.item .detail { grid-column: 1; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.item .p { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.item button { grid-column: 2; justify-self: end; background: none; border: 0; color: var(--muted); font: 400 0.8rem/1 var(--mono); text-decoration: underline; cursor: pointer; padding: 4px 0; }
.sumrow { display: flex; justify-content: space-between; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.sumrow.grand { color: var(--ink); font-size: 1.1rem; }
.empty { color: var(--muted); padding-block: 28px; }
.note { font-size: 0.85rem; color: var(--muted); }
.x { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--ink); cursor: pointer; padding: 4px 8px; }
.checkout { display: grid; gap: 18px; padding-top: 16px; }
.checkout h4 { margin: 0 0 8px; font-size: 0.95rem; }
.saved-addr { display: grid; gap: 8px; }
.saved-addr label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; cursor: pointer; font-size: 0.92rem; }
.saved-addr label:has(input:checked) { border-color: var(--blush-deep); background: color-mix(in srgb, var(--blush) 35%, white); }
.saved-addr input { margin-top: 4px; accent-color: var(--accent); }
.done-view { display: grid; gap: 14px; padding-top: 24px; }
.done-view .big { font: 400 2.4rem/1 var(--display); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--ground); padding: 12px 18px; border-radius: 999px; z-index: 60;
  font-weight: 500; font-size: 0.92rem; max-width: calc(100% - 32px); text-align: center;
}

footer.site { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-block: 48px 56px; color: var(--muted); font-size: 0.9rem; }

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