/* =============================================================
   theme.css — design tokens, base elements, header, footer,
   buttons and the animation system.
   Change the brand colour in ONE place: --brand below.
   ============================================================= */

:root {
  /* brand */
  --brand: #E31937;
  --brand-ink: #B3122C;
  --brand-glow: rgba(227, 25, 55, 0.28);

  /* light theme surfaces */
  --bg: #FFFFFF;
  --bg-soft: #F6F6F8;
  --surface: #FFFFFF;
  --surface-2: #FBFBFC;
  --line: rgba(16, 18, 24, 0.10);
  --line-strong: rgba(16, 18, 24, 0.18);
  --text: #14161B;
  --text-dim: #575C6B;
  --muted: #7A8090;
  --brand-soft: rgba(227, 25, 55, 0.07);
  --shadow-sm: 0 1px 2px rgba(16, 18, 24, .06), 0 4px 12px rgba(16, 18, 24, .05);
  --shadow-md: 0 8px 30px rgba(16, 18, 24, .10);
  --shadow-lg: 0 24px 60px rgba(16, 18, 24, .14);
  --header-bg: rgba(255, 255, 255, 0.82);
  --ok: #17886A;
  --warn: #B4690E;

  /* type */
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* shape + rhythm */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --wrap: 1200px;
  --gutter: 24px;
  --header-h: 74px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme='dark'] {
  --bg: #0B0C10;
  --bg-soft: #0F1117;
  --surface: #14161D;
  --surface-2: #191C24;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --text: #ECEEF3;
  --text-dim: #A9AFBE;
  --muted: #858C9C;
  --brand-soft: rgba(227, 25, 55, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 10px 34px rgba(0, 0, 0, .55);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, .65);
  --header-bg: rgba(11, 12, 16, 0.78);
  --ok: #35C99B;
  --warn: #E5A54B;
}

/* ------------------------------ base ------------------------------ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
p { margin: 0 0 1rem; color: var(--text-dim); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--soft { background: var(--bg-soft); }
.center { text-align: center; }
.price-num { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* eyebrow label — used above every section heading */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 22px; height: 2px; background: var(--brand); }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; }
.section-head p { font-size: 1.05rem; }

/* ------------------------------ buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: var(--r-pill); border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 20px var(--brand-glow); }
.btn--primary:hover { background: var(--brand-ink); transform: translateY(-2px); box-shadow: 0 12px 28px var(--brand-glow); }
.btn--ghost { border-color: var(--line-strong); background: transparent; color: var(--text); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.btn--solid { background: var(--text); color: var(--bg); }
.btn--solid:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--sm { padding: 9px 16px; font-size: .85rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  background: var(--brand-soft); color: var(--brand);
}
.chip--muted { background: var(--bg-soft); color: var(--muted); }
.chip--ok { background: rgba(23,136,106,.12); color: var(--ok); }
.chip--warn { background: rgba(180,105,14,.14); color: var(--warn); }

/* ------------------------------ header ------------------------------ */
/* Floating capsule nav, rounded on both ends — modelled on vaisoft.net. */
.site-header {
  position: sticky; top: 14px; z-index: 90;
  margin: 14px 16px 0;
  border-radius: var(--r-pill);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease), border-color .3s var(--ease), top .3s var(--ease);
}
.site-header.scrolled { top: 8px; border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.header-inner {
  max-width: var(--wrap); margin-inline: auto;
  height: var(--header-h); display: flex; align-items: center; gap: 18px;
  padding-inline: 14px 10px;
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--brand);
  display: grid; place-items: center; color: #fff; font-size: .95rem; font-weight: 800;
  box-shadow: 0 4px 14px var(--brand-glow);
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: 14px; }
.nav a {
  position: relative; padding: 8px 13px; border-radius: var(--r-pill);
  font-size: .92rem; font-weight: 500; color: var(--text-dim); transition: color .2s;
}
.nav a::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 2px;
  background: var(--brand); transform: scaleX(0); transform-origin: left;
  transition: transform .28s var(--ease);
}
.nav a:hover, .nav a.active { color: var(--text); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

/* "Shop by category" mega menu — the standard-ecommerce nav pattern,
   swapped in for a handful of hard-coded category links. */
.nav-cats { position: relative; }
.nav-cats-trigger {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: var(--r-pill); border: none; background: none; cursor: pointer;
  font-size: .92rem; font-weight: 500; color: var(--text-dim); font-family: var(--font-body);
  transition: color .2s;
}
.nav-cats-trigger svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.nav-cats:hover .nav-cats-trigger, .nav-cats:focus-within .nav-cats-trigger { color: var(--text); }
.nav-cats:hover .nav-cats-trigger svg, .nav-cats:focus-within .nav-cats-trigger svg { transform: rotate(180deg); }

.cats-mega {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translate(-50%, 8px);
  width: min(680px, 88vw); padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  z-index: 95;
}
.nav-cats:hover .cats-mega, .nav-cats:focus-within .cats-mega {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
}
.cats-mega-empty { color: var(--muted); font-size: .88rem; padding: 8px 2px; }
.cats-mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 22px; }
.cats-mega-col { display: flex; flex-direction: column; gap: 3px; }
.cats-mega-parent {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .93rem;
  color: var(--text); margin-bottom: 5px; padding: 4px 0;
}
.cats-mega-parent:hover { color: var(--brand); }
.cats-mega-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cats-mega-col li a {
  display: block; padding: 4px 0; font-size: .86rem; color: var(--text-dim); transition: color .18s, padding-left .18s;
}
.cats-mega-col li a:hover { color: var(--brand); padding-left: 3px; }
.cats-mega-viewall {
  display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line); font-size: .84rem; font-weight: 600; color: var(--brand);
}
.cats-mega-viewall svg { width: 15px; height: 15px; }

/* mobile drawer categories */
.drawer-cats { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.drawer-cats-label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 2px; }
.drawer-cat summary {
  display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer;
  padding: 11px 10px; border-radius: var(--r-sm); font-weight: 500;
}
.drawer-cat summary::-webkit-details-marker { display: none; }
.drawer-cat summary:hover { background: var(--bg-soft); color: var(--brand); }
.drawer-cat summary a { display: flex; align-items: center; gap: 8px; flex: 1; }
.drawer-cat summary svg { width: 14px; height: 14px; transition: transform .2s; color: var(--muted); }
.drawer-cat[open] summary svg { transform: rotate(180deg); }
.drawer-subcats { display: flex; flex-direction: column; padding-left: 18px; }
.drawer-subcats a { padding: 8px 10px; border-radius: var(--r-sm); font-size: .92rem; color: var(--text-dim); }
.drawer-subcats a:hover { background: var(--bg-soft); color: var(--brand); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: var(--r-pill);
  display: grid; place-items: center; background: transparent; border: 1px solid transparent;
  cursor: pointer; color: var(--text-dim); transition: all .2s var(--ease);
}
.icon-btn:hover { background: var(--bg-soft); color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
.badge {
  position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--brand); color: #fff;
  font-size: .68rem; font-weight: 700; display: grid; place-items: center;
  transform: scale(0); transition: transform .25s var(--ease);
}
.badge.show { transform: scale(1); }
.badge.bump { animation: badge-bump .45s var(--ease); }
@keyframes badge-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.45); }
  60% { transform: scale(.92); }
  100% { transform: scale(1); }
}

.header-search { flex: 1; max-width: 340px; position: relative; }
.header-search input {
  width: 100%; padding: 10px 14px 10px 38px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--bg-soft); font-size: .9rem;
  transition: border-color .2s, background .2s;
}
.header-search input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.header-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }

.burger { display: none; }

/* mobile drawer */
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(320px, 84vw); z-index: 120;
  background: var(--surface); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .34s var(--ease);
  padding: 22px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer a { padding: 12px 10px; border-radius: var(--r-sm); font-weight: 500; }
.drawer a:hover { background: var(--bg-soft); color: var(--brand); }
.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 110;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.scrim.open { opacity: 1; pointer-events: auto; }

/* ------------------------------ footer ------------------------------ */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 64px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer-grid h4 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-family: var(--font-body); font-weight: 600; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-grid li a { color: var(--text-dim); font-size: .93rem; transition: color .2s, padding-left .2s; }
.footer-grid li a:hover { color: var(--brand); padding-left: 4px; }
.footer-bottom {
  margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: .86rem; color: var(--muted);
}
.pay-badges { display: flex; gap: 8px; }
.pay-badges span {
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: .72rem; font-weight: 600; color: var(--text-dim); background: var(--surface);
}

/* ------------------------------ toast ------------------------------ */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: .9rem; font-weight: 500; max-width: 340px;
  animation: toast-in .34s var(--ease);
}
.toast::before { content: ''; width: 4px; align-self: stretch; border-radius: 4px; background: var(--brand); }
.toast--ok::before { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* ------------------------------ animation system ------------------------------ */
/* Add class="reveal" to any element. Add style="--d:.1s" to stagger it. */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease) var(--d, 0s), transform .7s var(--ease) var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal--left { transform: translateX(-30px); }
.reveal--right { transform: translateX(30px); }
.reveal--zoom { transform: scale(.94); }

/* staged hero entrance on page load */
.hero-stage > * { animation: rise .8s var(--ease) both; }
.hero-stage > *:nth-child(1) { animation-delay: .05s; }
.hero-stage > *:nth-child(2) { animation-delay: .15s; }
.hero-stage > *:nth-child(3) { animation-delay: .25s; }
.hero-stage > *:nth-child(4) { animation-delay: .35s; }
.hero-stage > *:nth-child(5) { animation-delay: .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }

/* infinite marquee */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* skeleton shimmer for loading states */
.skeleton {
  background: linear-gradient(100deg, var(--bg-soft) 30%, var(--surface-2) 50%, var(--bg-soft) 70%);
  background-size: 220% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md);
}
@keyframes shimmer { to { background-position: -220% 0; } }

.lift { transition: transform .32s var(--ease), box-shadow .32s var(--ease), border-color .32s; }
.lift:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

/* gentle pulse for low-stock / urgency chips — draws the eye without shouting */
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.flag--urgent { background: var(--warn); color: #fff; animation: pulse-soft 1.7s ease-in-out infinite; }
.chip--urgent { animation: pulse-soft 1.7s ease-in-out infinite; }

/* back-to-top */
.back-to-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 85;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px) scale(.8); pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease), background .2s;
}
.back-to-top svg { width: 19px; height: 19px; }
.back-to-top:hover { background: var(--brand-ink); transform: translateY(-3px); }
.back-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
body.has-mobile-buy-bar .back-to-top { bottom: 92px; }

@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; }
}

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 1000px) {
  .nav, .header-search { display: none; }
  .burger { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .site-header { margin: 10px 10px 0; }
  .header-inner { padding-inline: 10px 6px; }
  .footer-grid { grid-template-columns: 1fr; }
  .toast-stack { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
  .back-to-top { right: 14px; bottom: 18px; }
}
