/* =========================================================
   SmartCart — Design Tokens & Base
   Palette: Marigold #FFC107 / Ink #14151A / Cream surfaces
   Type: system-ui stack (display: heavy tracking-tight,
         body: regular, utility: monospace for numerals)
   ========================================================= */

:root{
  /* Colors */
  --color-primary: #FFC107;
  --color-primary-dark: #E5A600;
  --color-primary-deep: #C98E00;
  --color-primary-tint: #FFF4D6;
  --color-ink: #14151A;
  --color-ink-soft: #3D3F47;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F6F6F2;
  --color-surface-grey: #F0EFEA;
  --color-border: #E7E5DE;
  --color-success: #1E8E5A;
  --color-success-tint: #E7F5EE;
  --color-danger: #E23744;
  --color-danger-tint: #FDEBEC;
  --color-info: #2563A8;
  --color-info-tint: #E9F1FA;

  /* Typography */
  --font-display: -apple-system, "Segoe UI", "Inter", system-ui, sans-serif;
  --font-body: -apple-system, "Segoe UI", "Inter", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  /* Radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(20,21,26,.06), 0 1px 1px rgba(20,21,26,.04);
  --shadow-md: 0 6px 20px rgba(20,21,26,.08);
  --shadow-lg: 0 16px 40px rgba(20,21,26,.14);
  --shadow-btn: 0 10px 22px rgba(255,193,7,.35);

  /* Layout */
  --maxw: 1280px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --fast: .18s;
  --med: .32s;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
html:focus-within{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}

body{
  margin:0;
  font-family:var(--font-body);
  color:var(--color-ink);
  background:var(--color-surface);
  -webkit-font-smoothing:antialiased;
  line-height:1.5;
}

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; }
ul{ list-style:none; margin:0; padding:0; }
h1,h2,h3,h4,h5,p{ margin:0; }

.container{ max-width:var(--maxw); margin:0 auto; padding-inline:var(--gutter); }

/* Focus states — accessible & visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible{
  outline: 2.5px solid var(--color-ink);
  outline-offset: 2px;
  border-radius: 4px;
}

.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;
  background:var(--color-ink); color:#fff;
  padding:10px 16px; border-radius:var(--r-sm);
  z-index:999; transition:top var(--fast) var(--ease);
}
.skip-link:focus{ top:12px; }

/* Section rhythm */
.section{ padding-block: clamp(36px, 5vw, 64px); }
.section-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:16px; margin-bottom:24px; flex-wrap:wrap;
}
.section-head h2{
  font-family:var(--font-display);
  font-size:clamp(22px,3vw,30px);
  font-weight:800; letter-spacing:-.02em;
}
.section-head .eyebrow{
  display:block; font-family:var(--font-mono); font-size:12px;
  letter-spacing:.14em; text-transform:uppercase; color:var(--color-primary-deep);
  font-weight:700; margin-bottom:6px;
}
.section-head .view-all{
  font-weight:700; font-size:14px; display:inline-flex; align-items:center; gap:6px;
  color:var(--color-ink); border-bottom:2px solid var(--color-primary);
  padding-bottom:2px; transition:gap var(--fast) var(--ease);
}
.section-head .view-all:hover{ gap:10px; }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 22px; border-radius:var(--r-pill); border:none;
  font-weight:700; font-size:14.5px; letter-spacing:-.01em;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
  white-space:nowrap; position:relative; overflow:hidden;
}
.btn:active{ transform:scale(.97); }
.btn-primary{ background:var(--color-primary); color:var(--color-ink); box-shadow:var(--shadow-btn); }
.btn-primary:hover{ background:var(--color-primary-dark); transform:translateY(-2px); box-shadow:0 14px 28px rgba(255,193,7,.42); }
.btn-dark{ background:var(--color-ink); color:#fff; }
.btn-dark:hover{ background:#000; transform:translateY(-2px); }
.btn-outline{ background:transparent; color:var(--color-ink); border:1.5px solid var(--color-border); }
.btn-outline:hover{ border-color:var(--color-ink); }
.btn-ghost{ background:var(--color-surface-alt); color:var(--color-ink); }
.btn-ghost:hover{ background:var(--color-surface-grey); }
.btn-sm{ padding:8px 16px; font-size:13px; }
.btn-block{ width:100%; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }

/* Ripple */
.ripple{ position:absolute; border-radius:50%; background:rgba(255,255,255,.55); transform:scale(0); animation:ripple .55s var(--ease); pointer-events:none; }
.btn-dark .ripple, .btn-outline .ripple{ background:rgba(255,255,255,.35); }
@keyframes ripple{ to{ transform:scale(3); opacity:0; } }

/* Badges & chips */
.badge{ display:inline-flex; align-items:center; gap:4px; font-size:11.5px; font-weight:800; padding:4px 9px; border-radius:var(--r-pill); letter-spacing:.02em; }
.badge-sale{ background:var(--color-danger); color:#fff; }
.badge-new{ background:var(--color-info); color:#fff; }
.badge-success{ background:var(--color-success-tint); color:var(--color-success); }

.chip{
  display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:var(--r-pill);
  background:var(--color-surface-alt); border:1px solid var(--color-border); font-size:13.5px; font-weight:600;
  transition: all var(--fast) var(--ease);
}
.chip:hover, .chip.active{ background:var(--color-primary); border-color:var(--color-primary); }

/* Card */
.card{
  background:var(--color-surface); border:1px solid var(--color-border);
  border-radius:var(--r-lg); transition:transform var(--med) var(--ease), box-shadow var(--med) var(--ease), border-color var(--fast);
}
.card:hover{ transform:translateY(-5px); box-shadow:var(--shadow-lg); border-color:transparent; }

/* Skeleton / lazy fade-in */
.lazy-fade{ opacity:0; transform:translateY(14px); transition:opacity .5s var(--ease), transform .5s var(--ease); }
.lazy-fade.in-view{ opacity:1; transform:translateY(0); }

/* Scrollbar niceties */
.hscroll{ display:flex; gap:16px; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:8px; scrollbar-width:thin; }
.hscroll::-webkit-scrollbar{ height:6px; }
.hscroll::-webkit-scrollbar-thumb{ background:var(--color-border); border-radius:99px; }
.hscroll > *{ scroll-snap-align:start; flex:0 0 auto; }

/* Toast */
#toast-region{ position:fixed; bottom:20px; left:50%; transform:translateX(-50%); z-index:1000; display:flex; flex-direction:column; gap:8px; align-items:center; }
.toast{
  background:var(--color-ink); color:#fff; padding:12px 20px; border-radius:var(--r-pill);
  font-size:13.5px; font-weight:600; box-shadow:var(--shadow-lg);
  display:flex; align-items:center; gap:8px;
  animation:toast-in .3s var(--ease);
}
.toast.success{ background:var(--color-success); }
@keyframes toast-in{ from{ opacity:0; transform:translateY(12px) scale(.95);} to{opacity:1; transform:translateY(0) scale(1);} }

/* Breadcrumb */
.breadcrumb{ font-size:13px; color:var(--color-ink-soft); display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.breadcrumb a:hover{ color:var(--color-primary-deep); }
.breadcrumb span[aria-current]{ color:var(--color-ink); font-weight:700; }

/* Rating stars */
.stars{ color:var(--color-primary-deep); font-size:13px; letter-spacing:1px; white-space:nowrap; }
.stars .empty{ color:var(--color-border); }

/* Utility */
.text-muted{ color:var(--color-ink-soft); }
.mono{ font-family:var(--font-mono); }
