/* NexMart — shared tokens & primitives (blue / white) */
/* Self-hosted variable fonts (SIL Open Font License) */
@font-face { font-family: "Bricolage Grotesque"; src: url(/vendor/fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(/vendor/fonts/figtree.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  /* Brand blues. --leaf / --turmeric keep their names so every existing rule keeps working. */
  --navy: #03204F;
  --leaf: #062A66;          /* deepest brand blue — dark surfaces */
  --leaf-2: #0B3E8F;        /* links and secondary text on white */
  --blue: #1A6BFF;          /* primary blue */
  --blue-soft: #E8F1FF;
  --sky: #38C6FF;           /* bright accent */
  --sky-soft: #E6F6FF;
  --turmeric: #38C6FF;      /* accent buttons */
  --turmeric-deep: #0FA8E8;
  --sale: #E11D48;
  --sale-2: #FF5A7A;
  /* Blue is the base; these carry the accents so the shop is not monotone. */
  --green: #16A34A;
  --green-2: #4ADE80;
  --amber: #F5A524;
  --amber-2: #FFD24A;
  --purple: #8B5CF6;
  --teal: #0EA5A5;
  --chili: #E11D48;
  --wash: #F3F7FE;
  --paper: #FFFFFF;
  --ink: #0C1B33;
  --muted: #5A6B86;
  --line: #D9E5F7;
  --ok: #0E9F6E;

  --grad-brand: linear-gradient(135deg, #062A66 0%, #0B3E8F 45%, #1A6BFF 100%);
  --grad-sky: linear-gradient(135deg, #0B3E8F 0%, #38C6FF 100%);
  --grad-sale: linear-gradient(135deg, #E11D48 0%, #FF5A7A 100%);
  --grad-ring: conic-gradient(from 210deg, #F5A524 0deg, #16A34A 90deg, #8B5CF6 180deg, #E11D48 260deg, #F5A524 360deg);
  --grad-green: linear-gradient(135deg, #16A34A 0%, #4ADE80 100%);
  --grad-amber: linear-gradient(135deg, #D97706 0%, #FFD24A 100%);

  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, sans-serif;

  --r-s: 8px; --r-m: 14px; --r-l: 22px;
  --shadow-1: 0 1px 2px rgb(6 42 102 / .06), 0 2px 10px rgb(6 42 102 / .07);
  --shadow-2: 0 10px 30px -8px rgb(6 42 102 / .30);
  --shadow-3: 0 22px 60px -18px rgb(6 42 102 / .45);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 140px; }
body {
  margin: 0; font-family: var(--f-body); font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--wash); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--leaf-2); }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  --bg: var(--leaf); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .6em 1.2em; border: 0; border-radius: 999px;
  background: var(--bg); color: var(--fg); font-weight: 650; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease-out), background-color .2s, box-shadow .2s, filter .2s;
  &:hover { background: color-mix(in oklab, var(--bg) 88%, #000); }
  &:active { transform: scale(.97); }
  &:disabled { opacity: .55; cursor: not-allowed; transform: none; }
  &.btn-accent { --bg: var(--sky); --fg: var(--navy); font-weight: 750; box-shadow: 0 6px 18px -8px rgb(56 198 255 / .9); &:hover { background: var(--turmeric-deep); } }
  &.btn-ghost { --bg: transparent; --fg: var(--leaf-2); box-shadow: inset 0 0 0 1.5px var(--line); &:hover { background: var(--blue-soft); } }
  &.btn-danger { --bg: var(--chili); }
  &.btn-green { --bg: var(--green); --fg: #fff; box-shadow: 0 6px 18px -9px rgb(22 163 74 / .95); }
  &.btn-block { width: 100%; }
  &.btn-sm { min-height: 34px; padding: .35em .9em; font-size: .9rem; }
  svg { width: 1.2em; height: 1.2em; flex: none; }
}
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: transparent; color: inherit;
  &:hover { background: color-mix(in oklab, currentColor 10%, transparent); }
  svg { width: 22px; height: 22px; }
}

/* Forms */
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .9rem; }
.field small { color: var(--muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: .65em .9em; border: 1.5px solid var(--line); border-radius: var(--r-m);
  background: var(--paper); transition: border-color .2s, box-shadow .2s;
  &:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgb(26 107 255 / .14); }
  &:user-invalid { border-color: var(--chili); }
}
.field textarea { min-height: 80px; resize: vertical; }

/* Dialog base with @starting-style entry animation */
dialog {
  border: 0; padding: 0; color: inherit; background: var(--paper);
  opacity: 0; transition: opacity .25s, transform .3s var(--ease-out), overlay .3s allow-discrete, display .3s allow-discrete;
  &[open] { opacity: 1; }
  &::backdrop { background: rgb(3 32 79 / 0); backdrop-filter: blur(0); transition: all .3s allow-discrete; }
  &[open]::backdrop { background: rgb(3 32 79 / .5); backdrop-filter: blur(4px); }
}
@starting-style {
  dialog[open] { opacity: 0; }
  dialog[open]::backdrop { background: rgb(3 32 79 / 0); backdrop-filter: blur(0); }
}

/* Toasts */
.toasts { position: fixed; inset: auto 0 20px; display: grid; justify-items: center; gap: 8px; z-index: 100; pointer-events: none; padding: 0 16px; }
.toast {
  background: var(--leaf); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-2);
  font-weight: 550; max-width: 480px; animation: toast-in .35s var(--ease-spring);
  &.error { background: var(--chili); }
  &.out { animation: toast-out .25s forwards; }
}
@keyframes toast-in { from { transform: translateY(20px) scale(.95); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(10px); opacity: 0; } }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 650; background: var(--blue-soft); color: var(--leaf-2); }
.muted { color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid rgb(255 255 255 / .35); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Reveal-on-scroll, driven by EZ.reveal() */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

/* A map tile server we cannot reach says so over the map rather than showing grey squares */
.map-offline {
  position: absolute; inset: auto 12px 12px; z-index: 450; background: var(--leaf); color: #fff;
  padding: 10px 14px; border-radius: 12px; font-size: .85rem; font-weight: 600; box-shadow: var(--shadow-2);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
