/* ==========================================================================
   base.css: design tokens, reset, typography, buttons, forms, utilities
   Brand: Prime Mart US / Stingray (navy · stingray blue · cream · yellow · red)
   ========================================================================== */

:root {
  /* Colour */
  --ink: #06101f;
  --ink-2: #22364f;
  --muted: #5c6b7f;
  --muted-2: #8b97a8;
  --line: #e6e3dc;
  --line-2: #d6d2c8;
  --bg: #ffffff;
  --cream: #f7f5f0;
  --cream-2: #efebe2;
  --brand: #156bc8;          /* primary action: AA contrast with white */
  --brand-hover: #0f57a6;
  --brand-bright: #1b7fe0;   /* decorative stingray blue */
  --brand-soft: #e8f2fd;
  --sky: #41b8ff;
  --accent: #ffd400;         /* highlight yellow */
  --accent-soft: #fff6c2;
  --sale: #d61f28;
  --sale-soft: #fdeaea;
  --success: #15803d;
  --success-soft: #e7f6ec;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --navy: #071428;           /* hero / dark bands */
  --navy-2: #0c2347;
  --espresso: #1d1712;       /* boots edit band */
  --gold: #e9c46a;

  /* Type */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem);
  --fs-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --fs-3xl: clamp(2.4rem, 1.5rem + 3.6vw, 4.25rem);

  /* Space & shape */
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(56px, 8vw, 104px);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(6, 16, 31, 0.06), 0 1px 3px rgba(6, 16, 31, 0.05);
  --shadow: 0 8px 24px -8px rgba(6, 16, 31, 0.16), 0 2px 6px rgba(6, 16, 31, 0.05);
  --shadow-lg: 0 24px 60px -16px rgba(6, 16, 31, 0.28);
  --shadow-xl: 0 40px 90px -30px rgba(6, 16, 31, 0.45);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* overflow-x on <html> (not only <body>): a body value is handed to the viewport, where
   "clip" stops working. Clipping here stops sideways scrolling without breaking sticky. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip; /* modern browsers: clips without breaking position: sticky */
}
img, svg, video { display: block; max-width: 100%; height: auto; }
img { background: transparent; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul[role='list'], ol[role='list'] { list-style: none; margin: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--ink); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
h1, h2, .display { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.02em; }
h1, h2, h3 { text-wrap: balance; }
h1 em, h2 em { font-style: italic; font-weight: 500; color: var(--brand); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 1em; }
small { font-size: var(--fs-sm); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand);
}
.eyebrow-light { color: var(--accent); }
.eyebrow-gold { color: var(--gold); }
.lead { font-size: var(--fs-md); color: var(--ink-2); }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: 820px; }
.section { padding-block: var(--section); }
.section-sm { padding-block: calc(var(--section) * 0.6); }
.bg-cream { background: var(--cream); }
.bg-ink { background: var(--ink); color: #fff; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: clamp(24px, 4vw, 40px); flex-wrap: wrap; }
.section-head h2 { margin: 6px 0 0; }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 560px; }
.section-head-center { justify-content: center; text-align: center; }
.section-head-center p { margin-inline: auto; }
.section-tight-top { padding-top: calc(var(--section) * 0.35); }
.stack > * + * { margin-top: var(--stack, 16px); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

/* ---------- Icons ---------- */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--btn-bg);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px;
  font-weight: 700; font-size: var(--fs-base); line-height: 1.2; text-align: center;
  color: var(--btn-fg); background: var(--btn-bg); border: 1.5px solid var(--btn-bd); border-radius: var(--radius-pill);
  transition: transform 0.25s var(--ease), background 0.2s, box-shadow 0.25s, color 0.2s, border-color 0.2s;
  user-select: none; white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
.btn-primary { --btn-bg: var(--brand); }
.btn-primary:hover { --btn-bg: var(--brand-hover); }
.btn-dark { --btn-bg: var(--ink); }
.btn-dark:hover { --btn-bg: var(--ink-2); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: var(--ink); }
.btn-outline { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line-2); }
.btn-outline:hover { --btn-bd: var(--ink); }
.btn-light { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; }
.btn-accent:hover { --btn-bg: #ffe14d; }
.btn-glass { --btn-bg: rgba(255, 255, 255, 0.08); --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, 0.28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-glass:hover { --btn-bg: rgba(255, 255, 255, 0.16); --btn-bd: rgba(255, 255, 255, 0.5); }
.btn-insta { --btn-bg: linear-gradient(120deg, #f9ce34, #ee2a7b 50%, #6228d7); --btn-bd: transparent; background: var(--btn-bg); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: transparent; }
.btn-ghost:hover { --btn-bg: var(--cream); box-shadow: none; }
.btn-sm { min-height: 38px; padding: 8px 16px; font-size: var(--fs-sm); }
.btn-lg { min-height: 56px; padding: 16px 32px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--btn-fg); border-right-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.link:hover { color: var(--brand-hover); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.link-arrow:hover { color: var(--brand); }
.link-arrow .icon { transition: transform 0.2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 16px;
  background: #fff; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: var(--fs-base); transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2306101f' stroke-width='2'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--sale); }
.field-error { font-size: var(--fs-sm); color: var(--sale); font-weight: 500; }
.field-hint { font-size: var(--fs-xs); color: var(--muted); }
.form-row { display: grid; gap: 0 16px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

/* ---------- Badges & pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.3;
  border-radius: var(--radius-pill); background: var(--ink); color: #fff;
}
.badge-sale { background: var(--sale); }
.badge-accent { background: var(--accent); color: var(--ink); }
.badge-brand { background: var(--brand); }
.badge-soft { background: var(--cream-2); color: var(--ink-2); }
.badge-muted { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: var(--radius-pill); background: #fff; border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600;
}

/* ---------- Alerts / flash ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 500; border: 1px solid transparent; margin-bottom: 16px;
}
.alert-success { background: var(--success-soft); color: #14532d; border-color: #bbe5c8; }
.alert-error { background: var(--sale-soft); color: #7f1d1d; border-color: #f5c2c4; }
.alert-info { background: var(--brand-soft); color: #0c3d73; border-color: #c4dcf7; }
.alert-warning { background: var(--warning-soft); color: #78350f; border-color: #fcd98b; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
/* Scroll-reveal only when JS is running (html.js), so content never hides if scripts fail */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
