/* =========================================
   MASUQIK STORE - Design System
   Type:  Plus Jakarta Sans (UI) + Geist Mono (codes, timers)
   Color: forest green from the logo, one accent per theme
   Shape: surfaces 16px, controls 10px, chips/badges full pill
   Theme: html[data-theme="light" | "dark"], set before first paint
   ========================================= */

/* ===== TOKENS: LIGHT (default) ===== */
:root,
[data-theme="light"] {
  --font-sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --primary: #1d5a3b;
  --primary-hover: #174b31;
  --primary-dark: #123b27;
  --primary-light: #e4eee8;
  --primary-glow: rgba(29, 90, 59, 0.22);
  --on-primary: #ffffff;
  --on-primary-line: rgba(255, 255, 255, 0.24);
  --logo-ink: #1d5a3b;

  /* Admin-only secondary hue (manual products, popular flags) */
  --accent: #d4581f;
  --accent-hover: #b94a17;
  --accent-glow: rgba(212, 88, 31, 0.22);

  --success: #1d7347;
  --success-soft: #e3f1e8;
  --success-border: #bcdcc8;
  --warning: #8f5207;
  --warning-soft: #fbf0dc;
  --warning-border: #efd3a0;
  --danger: #b02e26;
  --danger-soft: #fbe8e6;
  --danger-border: #f0c1bc;
  --on-danger: #ffffff;
  --neutral: #59625c;
  --neutral-soft: #eceeed;
  --neutral-border: #d6dbd8;

  --bg-main: #f3f5f3;
  --bg-body: #f3f5f3;
  --bg-card: #ffffff;
  --bg-card-hover: #f8faf8;
  --bg-input: #eef2ef;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-nav: rgba(243, 245, 243, 0.84);

  --text-main: #101812;
  --text-muted: #4b5850;
  --text-faint: #66736b;

  --border: #dde4df;
  --border-hover: #c3cdc6;
  --border-strong: #c3cdc6;

  --shadow-sm: 0 1px 2px rgba(16, 24, 18, 0.06);
  --shadow-md: 0 1px 2px rgba(16, 24, 18, 0.05), 0 10px 28px -12px rgba(16, 24, 18, 0.16);
  --shadow-lg: 0 2px 4px rgba(16, 24, 18, 0.04), 0 28px 56px -24px rgba(16, 24, 18, 0.26);
  --shadow-glow: 0 0 0 1px var(--border-hover);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spot: rgba(29, 90, 59, 0.09);
  --transition: all 0.2s var(--ease);

  --header-h: 64px;
  --gutter: 1.5rem;

  /* Z-index scale */
  --z-header: 50;
  --z-fab: 55;
  --z-bottomnav: 60;

  /* "only" opts out of browser auto-darkening; we ship a real dark theme */
  color-scheme: only light;
}

/* ===== TOKENS: DARK ===== */
[data-theme="dark"] {
  --primary: #74cf9b;
  --primary-hover: #8fdbae;
  --primary-dark: #5bb985;
  --primary-light: rgba(116, 207, 155, 0.12);
  --primary-glow: rgba(116, 207, 155, 0.3);
  --on-primary: #06200f;
  --on-primary-line: rgba(6, 32, 15, 0.2);
  --spot: rgba(116, 207, 155, 0.11);
  --logo-ink: #d3eadc;

  --accent: #ff6b35;
  --accent-hover: #e85d04;
  --accent-glow: rgba(255, 107, 53, 0.25);

  --success: #74cf9b;
  --success-soft: rgba(116, 207, 155, 0.1);
  --success-border: rgba(116, 207, 155, 0.28);
  --warning: #e8b55e;
  --warning-soft: rgba(232, 181, 94, 0.1);
  --warning-border: rgba(232, 181, 94, 0.3);
  --danger: #f2877d;
  --danger-soft: rgba(242, 135, 125, 0.1);
  --danger-border: rgba(242, 135, 125, 0.3);
  --on-danger: #2b0906;
  --neutral: #a3ada7;
  --neutral-soft: rgba(163, 173, 167, 0.1);
  --neutral-border: rgba(163, 173, 167, 0.26);

  --bg-main: #0c100e;
  --bg-body: #0c100e;
  --bg-card: #131916;
  --bg-card-hover: #18201b;
  --bg-input: #1a221d;
  --bg-glass: rgba(19, 25, 22, 0.88);
  --bg-nav: rgba(12, 16, 14, 0.8);

  --text-main: #e6ece8;
  --text-muted: #a2afa7;
  --text-faint: #87958c;

  --border: #232c27;
  --border-hover: #36423b;
  --border-strong: #36423b;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 28px 56px -20px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1 0 auto; }

[hidden] { display: none !important; }

h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
img { max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::selection { background: var(--primary-glow); }

.mono { font-family: var(--font-mono); font-feature-settings: 'zero' 1; }
.tabular { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute;
  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: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.skip-link:focus { top: 0.75rem; }

#scrollSentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 8px;
  pointer-events: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 3px solid var(--bg-main);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ===== ICONS (Lucide) ===== */
svg.lucide {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon svg { display: block; width: 1em; height: 1em; }

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
}

.container-narrow { max-width: 640px; }

.section { padding-top: 3rem; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.section-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.page-section { padding-top: 1.5rem; padding-bottom: 2rem; }

.page-head { margin-bottom: 1.5rem; }

.page-head h1 {
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.page-head p {
  margin-top: 0.375rem;
  color: var(--text-muted);
  max-width: 52ch;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg-nav);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.site-header.scrolled { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--header-h);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
}

/* Logo rendered through a mask so it takes the theme's ink color */
.brand-mark {
  display: block;
  height: 44px;
  aspect-ratio: 348 / 149;
  background-color: var(--logo-ink);
  -webkit-mask: url('/images/logo-main-masuqik-page.webp') center / contain no-repeat;
  mask: url('/images/logo-main-masuqik-page.webp') center / contain no-repeat;
}

.main-nav { margin-right: auto; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-muted);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover { color: var(--text-main); background: var(--bg-input); }
.nav-link.active { color: var(--text-main); font-weight: 600; }

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.5rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover { color: var(--text-main); background: var(--bg-input); }
.icon-btn svg { transition: rotate 0.4s var(--ease-spring), scale 0.2s var(--ease-spring); }
.theme-toggle:hover svg { rotate: 25deg; }
.icon-btn:hover > svg { scale: 1.08; }
.icon-btn:active { transform: translateY(1px); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; }
.icon-btn svg { width: 18px; height: 18px; }

.icon-btn-outline { border-color: var(--border); background: var(--bg-card); }

/* Theme toggle shows the mode you would switch to */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline-flex; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline-flex; }

.nav-cta-desktop.active {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-bottomnav);
  background: var(--bg-nav);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
}

.mobile-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0 0.55rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.mobile-nav-item svg { width: 22px; height: 22px; }

.mobile-nav-item.active { color: var(--primary); }

.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  width: 28px;
  height: 2px;
  transform: translateX(-50%);
  background: var(--primary);
  border-radius: 0 0 2px 2px;
}

/* ===== BUTTONS ===== */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s var(--ease), box-shadow 0.2s ease;
}

.btn-pill:active { transform: translateY(1px) scale(0.99); }
.btn-pill svg { width: 18px; height: 18px; }

.btn-pill:disabled,
.btn-pill[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

/* A single sweep of light on hover; sits under the label */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  translate: -120% 0;
  transition: translate 0.7s var(--ease-out);
  pointer-events: none;
}

.btn-primary:hover:not(:disabled)::after { translate: 120% 0; }

.btn-pill svg { transition: translate 0.2s var(--ease-out), rotate 0.3s var(--ease-spring); }
.btn-pill:hover svg.lucide-arrow-right,
.text-link:hover svg.lucide-arrow-right { translate: 3px 0; }
.btn-pill:hover svg.lucide-arrow-down { translate: 0 2px; }
.btn-pill:hover svg.lucide-arrow-left { translate: -3px 0; }

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-ghost:hover:not(:disabled) { background: var(--bg-input); }

.btn-danger {
  background: var(--danger);
  color: var(--on-danger);
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }

/* Admin keeps a secondary hue for manual-product actions */
.btn-accent {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-accent:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.8125rem; gap: 0.375rem; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 0.875rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link svg { width: 16px; height: 16px; }

/* ===== HERO (no banners) ===== */
.hero-intro {
  padding-top: 3.5rem;
  padding-bottom: 0.5rem;
}

.hero-intro h1 {
  max-width: 18ch;
  font-size: clamp(2.125rem, 1.4rem + 2.8vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-intro p {
  margin-top: 1rem;
  max-width: 44ch;
  font-size: 1.0625rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* ===== BANNER CAROUSEL ===== */
.hero { padding-top: 1.25rem; }

.banner-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  max-height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-input);
  isolation: isolate;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease), visibility 0s linear 0.6s;
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s var(--ease), visibility 0s;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 14, 12, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f4f7f5;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.15s ease;
}

.carousel-btn:hover { background: rgba(10, 14, 12, 0.75); }
.carousel-btn:active { transform: translateY(calc(-50% + 1px)); }
.carousel-btn svg { width: 20px; height: 20px; }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }

.banner-carousel:hover .carousel-btn,
.carousel-btn:focus-visible { opacity: 1; }

@media (hover: none) {
  .carousel-btn { display: none; }
}

.carousel-dots {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.carousel-dot {
  position: relative;
  width: 22px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.42);
  overflow: hidden;
  cursor: pointer;
}

/* Larger hit area without changing the visual size */
.carousel-dot::before {
  content: '';
  position: absolute;
  inset: -10px -3px;
}

.carousel-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: left;
}

.carousel-dot.active::after { transform: scaleX(1); }

/* Autoplay timing lives in the active dot's fill; JS advances on animationend */
.banner-carousel.is-autoplay .carousel-dot.active::after {
  animation: dot-fill 5s linear forwards;
}

@media (hover: hover) {
  .banner-carousel:hover .carousel-dot.active::after { animation-play-state: paused; }
}

.banner-carousel:focus-within .carousel-dot.active::after { animation-play-state: paused; }

@keyframes dot-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ===== HOW TO BUY ===== */
.section-sub {
  margin-top: 0.25rem;
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  list-style: none;
}

.how-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Chevron in the gap shows the direction of the flow */
.how-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -0.75rem;
  width: 0.55rem;
  height: 0.55rem;
  border-top: 2px solid var(--text-faint);
  border-right: 2px solid var(--text-faint);
  transform: translate(50%, -50%) rotate(45deg);
}

.how-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
}

.how-icon svg { width: 26px; height: 26px; transition: rotate 0.4s var(--ease-spring), scale 0.3s var(--ease-spring); }
.how-step { transition: border-color 0.2s ease, box-shadow 0.3s var(--ease), translate 0.3s var(--ease-out); }
.how-step:hover { translate: 0 -3px; border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.how-step:hover .how-icon svg { rotate: -8deg; scale: 1.1; }

.how-num {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.75rem;
  font-weight: 800;
}

.how-text h3 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.015em; }
.how-text p { margin-top: 0.25rem; font-size: 0.875rem; color: var(--text-muted); }
.how-text strong { color: var(--text-main); }

.how-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.how-note svg { width: 16px; height: 16px; margin-top: 0.15rem; }
.how-note a { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ===== DELIVERY FORMATS ===== */
.format-code {
  display: block;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-wrap: normal;
  user-select: all;
}

.format-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.format-badge svg { width: 13px; height: 13px; }

.format-box {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.format-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.format-box-label { font-size: 0.875rem; font-weight: 600; }

.format-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.375rem 1.25rem;
  list-style: none;
  font-size: 0.8125rem;
}

.format-fields li { display: flex; gap: 0.5rem; min-width: 0; }
.format-fields .mono { flex-shrink: 0; font-weight: 600; color: var(--text-main); }
.format-fields span:last-child { color: var(--text-muted); }
.format-box-sub { font-size: 0.8125rem; color: var(--text-muted); }

.state-done .format-box { margin: 0 0 1rem; }

/* ===== RAIL (horizontal product row) ===== */
.rail-nav { display: flex; gap: 0.375rem; }
.rail-nav[hidden] { display: none; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3rem) / 4);
  gap: 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* ===== CATALOG TOOLBAR ===== */
.catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.search-field {
  position: relative;
  flex: 0 0 280px;
}

.search-field svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 0.875rem 0 2.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.9375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder { color: var(--text-faint); }

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}

.category-tabs::-webkit-scrollbar { display: none; }

.tab-item {
  flex-shrink: 0;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.tab-item:hover { color: var(--text-main); border-color: var(--border-hover); translate: 0 -1px; }
.tab-item { transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, translate 0.2s var(--ease-out); }

.tab-item.active {
  background: var(--text-main);
  border-color: var(--text-main);
  color: var(--bg-card);
  font-weight: 600;
}

/* ===== PRODUCT GRID & CARD ===== */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
  gap: 1rem;
}

.product-card {
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transition: border-color 0.2s ease, box-shadow 0.3s var(--ease), transform 0.45s var(--ease-out), scale 0.15s var(--ease);
}

.product-card:hover {
  --lift: -4px;
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

/* While the pointer drives the tilt, follow it closely */
.product-card.is-tilting {
  transition: border-color 0.2s ease, box-shadow 0.3s var(--ease), transform 0.1s linear, scale 0.15s var(--ease);
}

/* Soft light that follows the pointer */
.product-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-card:hover::after { opacity: 1; }

/* Physical press on tap or click */
.product-card:active { scale: 0.97; }

.card-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-input);
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out), filter 0.2s ease;
}

.product-card:hover .card-media img { transform: scale(1.07); }

.card-placeholder { color: var(--text-faint); opacity: 0.7; }
.card-placeholder svg { width: 36px; height: 36px; }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.875rem 1rem 1rem;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  margin-top: 0.2rem;
  min-height: calc(2em * 1.35);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stock-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.stock-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.stock-label.is-out { color: var(--danger); }
.stock-label.is-out::before { background: var(--danger); }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.875rem;
}

.price-tag {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-currency {
  margin-right: 0.2em;
  font-size: 0.78em;
  font-weight: 600;
  color: var(--text-muted);
}

.card-cta {
  flex-shrink: 0;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 700;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.product-card:hover .card-cta {
  background: var(--primary);
  color: var(--on-primary);
}

.product-card.is-soldout .card-media img { filter: grayscale(1); opacity: 0.55; }
.product-card.is-soldout .price-tag { color: var(--text-muted); }

.product-card.is-soldout .card-cta,
.product-card.is-soldout:hover .card-cta {
  background: var(--neutral-soft);
  color: var(--text-muted);
}

/* ===== MOTION =====
   Every animation either reveals content in reading order, answers an action,
   or shows a state change. All of it switches off under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* Uses `translate` so it never fights the cards' tilt `transform` */
  .js .reveal:not(.is-in) { opacity: 0; translate: 0 18px; }
  .js .reveal.is-in { animation: reveal-in 0.7s var(--ease-out) var(--d, 0ms) backwards; }
}

html.reveal-all .reveal { opacity: 1 !important; translate: none !important; }

@keyframes reveal-in {
  from { opacity: 0; translate: 0 18px; }
}

@keyframes pop {
  from { scale: 0; }
}

@keyframes icon-in {
  from { opacity: 0; scale: 0.6; rotate: -14deg; }
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes bump {
  40% { scale: 1.14; }
}

@keyframes panel-in {
  from { opacity: 0; translate: 0 6px; }
}

@keyframes fab-in {
  from { opacity: 0; translate: 0 20px; scale: 0.7; }
}

@keyframes fab-ring {
  from { opacity: 0.55; scale: 1; }
  to { opacity: 0; scale: 1.55; }
}

@media (prefers-reduced-motion: no-preference) {
  /* "Cara beli": number badge pops, icon settles, arrow appears after the step */
  .how-step.is-in .how-num { animation: pop 0.5s var(--ease-spring) calc(var(--d, 0ms) + 260ms) backwards; }
  .how-step.is-in .how-icon svg { animation: icon-in 0.6s var(--ease-out) calc(var(--d, 0ms) + 140ms) backwards; }
  .how-step.is-in:not(:last-child)::after { animation: fade-in 0.4s ease calc(var(--d, 0ms) + 420ms) backwards; }

  /* Tab panels ease in when switched */
  .activity-panel [role="tabpanel"]:not([hidden]) { animation: panel-in 0.35s var(--ease-out); }

  /* Quantity and subtotal acknowledge each change */
  .bump { animation: bump 0.32s var(--ease-spring); }
  .copy-btn.is-copied { animation: bump 0.35s var(--ease-spring); }

  /* Slow settle on the active banner */
  .carousel-slide img { scale: 1.06; transition: scale 7s ease-out; }
  .carousel-slide.active img { scale: 1; }

  /* WhatsApp button arrives after the page, then rings twice */
  .wa-fab { animation: fab-in 0.6s var(--ease-spring) 0.9s backwards; }
  .wa-fab::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--primary);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    animation: fab-ring 1.6s var(--ease-out) 1.8s 2;
  }

  /* Page-to-page: content crossfades, chrome stays put, product image morphs */
  @view-transition { navigation: auto; }
}

.site-header { view-transition-name: site-header; }
.mobile-bottom-nav { view-transition-name: bottom-nav; }
.wa-fab { view-transition-name: wa-fab; }
.product-media { view-transition-name: product-hero; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.25s; }

::view-transition-group(product-hero) {
  animation-duration: 0.45s;
  animation-timing-function: var(--ease-out);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-state h3 {
  margin-bottom: 0.375rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-state p { max-width: 40ch; margin: 0 auto; }
.empty-state .btn-pill { margin-top: 1.25rem; }

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-muted);
}

.empty-icon svg { width: 26px; height: 26px; }

/* ===== PRODUCT DETAIL ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  min-width: 0;
}

.breadcrumb a { display: inline-flex; align-items: center; gap: 0.35rem; }
.breadcrumb a:hover { color: var(--text-main); }
.breadcrumb svg { width: 16px; height: 16px; flex-shrink: 0; }
.breadcrumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

.product-media {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.product-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.5rem;
}

.product-media .card-placeholder svg { width: 64px; height: 64px; }

.product-category {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.product-title {
  margin-top: 0.375rem;
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.product-price .per {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}

.stock-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stock-status svg { width: 16px; height: 16px; }
.stock-status.is-out { background: var(--danger-soft); color: var(--danger); }

.product-desc {
  margin-top: 1.25rem;
  max-width: 62ch;
  color: var(--text-muted);
  white-space: pre-line;
}

.buy-panel {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field { display: grid; gap: 0.5rem; border: 0; min-width: 0; }

.field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 0;
}

.field-hint { font-size: 0.8125rem; color: var(--text-muted); }

.qty-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.875rem;
}

.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.qty-stepper button {
  display: grid;
  place-items: center;
  width: 44px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.qty-stepper button:hover:not(:disabled) { background: var(--bg-input); }
.qty-stepper button:disabled { color: var(--text-faint); cursor: not-allowed; }
.qty-stepper button svg { width: 16px; height: 16px; }

.qty-stepper input {
  width: 60px;
  padding: 0.65rem 0;
  border: 0;
  border-inline: 1px solid var(--border);
  background: transparent;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-stepper input:focus { outline: none; background: var(--bg-input); }

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pay-option {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  cursor: pointer;
}

.pay-option input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.pay-option-text { display: grid; line-height: 1.35; }
.pay-option-title { font-weight: 600; font-size: 0.9375rem; }
.pay-option-sub { font-size: 0.8125rem; color: var(--text-muted); }
.pay-option > svg { margin-left: auto; width: 22px; height: 22px; color: var(--primary); }

.pay-option:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }

.buy-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.buy-total-label { font-size: 0.875rem; color: var(--text-muted); }

.buy-total strong {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.buy-note { margin-top: -0.75rem; font-size: 0.8125rem; color: var(--text-muted); }

/* ===== SOLD COUNTS ===== */
.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-top: 0.5rem;
}

.card-meta .stock-label { margin-top: 0; }

.sold-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.product-badges .stock-status { margin-top: 0; }

.sold-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sold-status svg { width: 16px; height: 16px; color: var(--text-muted); }

/* ===== PURCHASE HISTORY ===== */
.activity-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.activity-grid.no-stats { grid-template-columns: minmax(0, 1fr); }

.sales-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: var(--on-primary);
}

.sales-label { font-size: 0.875rem; font-weight: 600; opacity: 0.85; }

.sales-number {
  margin-top: 0.375rem;
  font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.top-sellers-label {
  margin-top: 1.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: 0.85;
}

.top-sellers {
  display: grid;
  gap: 0.125rem;
  margin-top: 0.5rem;
  list-style: none;
  counter-reset: top-seller;
}

.top-sellers li { counter-increment: top-seller; }

.top-sellers a {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
}

.top-sellers a::before {
  content: counter(top-seller);
  font-weight: 700;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.ts-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-sellers a:hover .ts-name { text-decoration: underline; text-underline-offset: 3px; }

.ts-qty { font-size: 0.8125rem; opacity: 0.85; font-variant-numeric: tabular-nums; }

.sales-meta {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1.75rem;
}

.sales-meta div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--on-primary-line);
  font-size: 0.875rem;
}

.sales-meta dt { opacity: 0.85; }
.sales-meta dd { font-weight: 700; font-variant-numeric: tabular-nums; }

.panel.activity-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
}

.activity-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.activity-tab {
  position: relative;
  padding: 0.75rem 0.75rem;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.activity-tab:hover,
.activity-tab[aria-selected="true"] { color: var(--text-main); }

.activity-tabs { position: relative; }

.tab-indicator {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 1px;
  height: 2px;
  background: var(--primary);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out);
}

.activity-tabs.has-indicator .activity-tab[aria-selected="true"]::after { display: none; }

.activity-tab[aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

.activity-panel [role="tabpanel"] { padding: 0.25rem 1.25rem 1rem; }

.feed-list { display: grid; list-style: none; }
.feed-list > li + li { border-top: 1px solid var(--border); }

.feed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  min-width: 0;
}

.feed-thumb {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
}

.feed-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.feed-thumb svg { width: 18px; height: 18px; }

.feed-text { display: grid; flex: 1; min-width: 0; line-height: 1.4; }

.feed-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-sub { font-size: 0.8125rem; color: var(--text-muted); }

.feed-time {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.feed-link {
  margin: 0 -0.5rem;
  padding-inline: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}

.feed-link:hover { background: var(--bg-input); }
.feed-item .feed-thumb { transition: scale 0.25s var(--ease-spring); }
.feed-item:hover .feed-thumb { scale: 1.08; }

.activity-more { margin-top: 0.75rem; }

/* ===== WHATSAPP / MANUAL BUY ===== */
.wa-icon { width: 1.125em; height: 1.125em; flex-shrink: 0; }

/* Floating action is the one pill-shaped button on the page */
.wa-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: var(--z-fab);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.9375rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  transition: translate 0.2s var(--ease), scale 0.15s var(--ease), background-color 0.15s ease;
}

.wa-fab:hover { background: var(--primary-hover); translate: 0 -2px; }
.wa-fab:active { translate: 0; scale: 0.96; }
.wa-fab .wa-icon { width: 22px; height: 22px; }

@media (min-width: 769px) {
  .wa-fab.is-product { display: none; }
}

.manual-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.manual-buy.is-emphasis {
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-light);
}

.manual-buy-text { display: grid; min-width: 0; line-height: 1.4; }
.manual-buy-text strong { font-size: 0.9375rem; font-weight: 700; }
.manual-buy-text span { font-size: 0.8125rem; color: var(--text-muted); }
.manual-buy .btn-pill { flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ===== FORM CONTROLS ===== */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder { color: var(--text-faint); }
.form-control:hover { border-color: var(--text-faint); }

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control.mono { letter-spacing: 0.02em; font-weight: 500; }

select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-card); color: var(--text-main); }

.form-hint { margin-top: 0.375rem; font-size: 0.8125rem; color: var(--text-muted); }

/* ===== ALERTS ===== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border: 1px solid;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}

.alert svg { width: 18px; height: 18px; margin-top: 0.1rem; }
.alert-error { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning); }
.alert-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge svg { width: 14px; height: 14px; }

.status-pending { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-border); }
.status-paid    { background: var(--primary-light); color: var(--primary); border-color: var(--border-hover); }
.status-done    { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.status-failed  { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.status-expired { background: var(--neutral-soft); color: var(--neutral); border-color: var(--neutral-border); }

/* Live indicator for a state that is actively being polled */
.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .live-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: currentColor;
    animation: ping 1.6s var(--ease-out) infinite;
  }
}

@keyframes ping {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* ===== CHECKOUT ===== */
.checkout-head {
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  text-align: center;
}

.checkout-head h1 {
  margin-top: 0.875rem;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.checkout-head p { margin-top: 0.375rem; color: var(--text-muted); }

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
  align-items: start;
}

.pay-panel { text-align: center; }

.timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
}

.timer-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.timer-label svg { width: 16px; height: 16px; }

.countdown-timer {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-main);
  transition: color 0.3s ease;
}

.countdown-timer.is-urgent { color: var(--danger); }

/* QR stays black-on-white in both themes so every scanner reads it */
.qr-wrapper {
  display: inline-block;
  padding: 0.875rem;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid #e2e7e3;
}

.qr-wrapper img {
  display: block;
  width: 240px;
  height: 240px;
  max-width: 100%;
  border-radius: 4px;
}

.qr-apps {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.qr-save { margin-top: 0.75rem; }
/* QR card: always white, like a printed QRIS stand, in every theme.
   `only light` also keeps browser auto-dark modes from greying it out. */
.qr-card {
  color-scheme: only light;
  display: inline-grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 1rem 1.125rem 1.125rem;
  background: #ffffff;
  color: #101812;
  border: 1px solid #dfe5e0;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(16, 24, 18, 0.08), 0 16px 36px -14px rgba(16, 24, 18, 0.45);
}

.qr-card-head {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1d5a3b;
}

.qr-card-head svg { width: 16px; height: 16px; }

.qr-card img {
  display: block;
  width: 240px;
  height: 240px;
  max-width: 100%;
  background: #ffffff;
}

.qr-card-total {
  padding-top: 0.625rem;
  width: 100%;
  border-top: 1px dashed #c3cdc6;
  font-size: 0.8125rem;
  color: #4b5850;
  text-align: center;
}

.qr-card-total strong {
  margin-left: 0.25rem;
  font-size: 1.0625rem;
  font-weight: 800;
  color: #101812;
  font-variant-numeric: tabular-nums;
}

.qr-sm img { width: 220px; height: 220px; }
.state-block .qr-card { margin-top: 1.25rem; }
.form-alert { margin-top: 1rem; }

.summary-title {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 700;
}

.order-summary {
  display: grid;
  gap: 0.625rem;
  font-size: 0.9rem;
}

.order-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.order-key { flex-shrink: 0; color: var(--text-muted); }

.order-val {
  min-width: 0;
  text-align: right;
  font-weight: 600;
  color: var(--text-main);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.order-code { font-family: var(--font-mono); font-weight: 600; }

.order-total {
  margin-top: 0.25rem;
  padding-top: 0.875rem;
  border-top: 1px dashed var(--border-strong);
}

.order-total .order-key { color: var(--text-main); font-weight: 600; }
.order-total .order-val { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }

.actions-stack { display: grid; gap: 0.625rem; margin-top: 1.5rem; }

.pay-steps {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  list-style: none;
  counter-reset: pay-step;
}

.pay-steps li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 0.75rem;
  align-items: start;
  font-size: 0.875rem;
  color: var(--text-muted);
  counter-increment: pay-step;
}

.pay-steps li::before {
  content: counter(pay-step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ===== TRACK ===== */
.track-form { display: grid; gap: 1rem; }
.track-form .form-group { margin-bottom: 0; }

.disclosure summary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
}

.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary:hover { color: var(--text-main); }
.disclosure summary svg { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.disclosure[open] summary svg { transform: rotate(90deg); }
.disclosure[open] summary { margin-bottom: 0.75rem; }

.order-card { margin-top: 1.25rem; }

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.order-code-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 600;
}

.order-code-chip .icon-btn { width: 32px; height: 32px; }
.order-code-chip .icon-btn svg { width: 16px; height: 16px; }

.order-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.5rem;
  list-style: none;
}

.order-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.order-step::before {
  content: '';
  position: absolute;
  top: 13px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
}

.order-step:first-child::before { display: none; }

.order-step.is-done::before,
.order-step.is-current::before { background: var(--primary); }
.order-step.is-failed::before { background: var(--danger); }

.step-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-faint);
}

.step-marker svg { width: 14px; height: 14px; stroke-width: 2.5; }

.is-done .step-marker { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.is-current .step-marker { border-color: var(--primary); color: var(--primary); }
.is-current .step-marker::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.is-failed .step-marker { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }

.order-step.is-done,
.order-step.is-current { color: var(--text-main); font-weight: 600; }
.order-step.is-failed { color: var(--danger); font-weight: 600; }

.state-block {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid;
  border-radius: var(--radius);
}

.state-block-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.state-block-title svg { width: 18px; height: 18px; }
.state-block p { margin-top: 0.375rem; font-size: 0.9rem; color: var(--text-muted); }
.state-block.is-centered { text-align: center; }
.state-block.is-centered .state-block-title { justify-content: center; }

.state-pending { background: var(--warning-soft); border-color: var(--warning-border); }
.state-pending .state-block-title { color: var(--warning); }
.state-failed { background: var(--danger-soft); border-color: var(--danger-border); }
.state-failed .state-block-title { color: var(--danger); }
.state-closed { background: var(--neutral-soft); border-color: var(--neutral-border); }
.state-closed .state-block-title { color: var(--text-main); }
.state-done { background: var(--success-soft); border-color: var(--success-border); }
.state-done .state-block-title { color: var(--text-main); }

.state-block .qr-wrapper { margin-top: 1.25rem; }
.state-block .btn-pill { margin-top: 1.25rem; }

.delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stock-list { display: grid; gap: 0.5rem; list-style: none; }

.stock-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.stock-item code {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-main);
  overflow-wrap: anywhere;
  user-select: all;
}

.stock-item-box {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn.is-copied { color: var(--success); border-color: var(--success-border); }

.history { margin-top: 2rem; }

.history-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  font-size: 1rem;
  font-weight: 700;
}

.history-title svg { width: 18px; height: 18px; color: var(--text-muted); }

.history-list { display: grid; gap: 0.5rem; list-style: none; }

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.history-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.history-code { font-family: var(--font-mono); font-weight: 600; }
.history-date { font-size: 0.8125rem; color: var(--text-muted); }
.history-item > svg { width: 18px; height: 18px; color: var(--text-faint); }

/* ===== DIALOG ===== */
.ui-dialog {
  width: min(420px, calc(100% - 2rem));
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
}

.ui-dialog::backdrop {
  background: rgba(8, 12, 10, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

@media (prefers-reduced-motion: no-preference) {
  .ui-dialog[open] { animation: dialog-in 0.22s var(--ease-out); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.ui-dialog-body { display: grid; gap: 0.5rem; padding: 1.5rem; }
.ui-dialog-body h2 { font-size: 1.125rem; font-weight: 700; }
.ui-dialog-body p { color: var(--text-muted); font-size: 0.9375rem; }

.ui-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 5rem;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand .brand-mark { height: 38px; }
.footer-brand p { margin-top: 0.75rem; max-width: 34ch; }

.footer-nav { display: flex; gap: 3rem; }
.footer-col h2 { margin-bottom: 0.625rem; font-size: 0.875rem; font-weight: 600; color: var(--text-main); letter-spacing: -0.01em; }
.footer-col ul { list-style: none; display: grid; gap: 0.375rem; }
.footer-col a { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-col a:hover { color: var(--text-main); }
.footer-col svg { width: 16px; height: 16px; }

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ===== UTILITIES ===== */
.spin { animation: spin 0.9s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Legacy helpers kept for admin views */
.divider { height: 1px; background: var(--border); margin: 2rem 0; }
.glow-line { height: 1px; background: var(--border); margin: 1.5rem 0; }

.page-card {
  max-width: 580px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ===== MODAL (admin) ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(8, 12, 10, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal-box {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (prefers-reduced-motion: no-preference) {
  .modal-box { animation: dialog-in 0.22s var(--ease-out); }
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }

.modal-title { margin-bottom: 0.3rem; font-size: 1.25rem; font-weight: 800; color: var(--text-main); }
.modal-price { margin-bottom: 1.5rem; font-size: 1.1rem; font-weight: 700; color: var(--primary); }

/* ===== ADMIN LAYOUT (base; admin/layout.ejs refines) ===== */
.admin-container { display: flex; min-height: 100vh; }

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 260px;
  height: 100vh;
  padding: 1.5rem 0;
  overflow-y: auto;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
}

.admin-brand { padding: 0 1.5rem 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.admin-brand-name { font-size: 1.1rem; font-weight: 800; color: var(--text-main); }
.admin-brand-name span { color: var(--primary); }
.admin-brand-sub { margin-top: 0.2rem; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }

.admin-menu { display: flex; flex-direction: column; flex: 1; gap: 0.15rem; padding: 0 0.75rem; list-style: none; }

.admin-menu-section {
  padding: 0.85rem 0.75rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.admin-menu a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.admin-menu a:hover { background: var(--bg-input); color: var(--text-main); }
.admin-menu a.active { background: var(--primary); color: var(--on-primary); font-weight: 600; }

.admin-content { flex: 1; min-width: 0; padding: 2rem; overflow: auto; background: var(--bg-main); }

.admin-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.admin-page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text-main); }

.stat-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

.stat-card {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }

.stat-label { margin-bottom: 0.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: var(--text-main); font-variant-numeric: tabular-nums; }
.stat-icon { margin-bottom: 0.75rem; color: var(--primary); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.data-table th {
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; color: var(--text-main); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }

.admin-form-group { margin-bottom: 1.25rem; }

.admin-form-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.admin-form-control {
  width: 100%;
  padding: 0.7rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-form-control::placeholder { color: var(--text-faint); }
.admin-form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.admin-card { margin-bottom: 1.5rem; padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.admin-card-title { margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); font-size: 1rem; font-weight: 700; color: var(--text-main); }

.admin-alert { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; padding: 0.85rem 1.25rem; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 500; }
.admin-alert-success { background: var(--success-soft); border: 1px solid var(--success-border); color: var(--success); }
.admin-alert-error   { background: var(--danger-soft); border: 1px solid var(--danger-border); color: var(--danger); }
.admin-alert-warning { background: var(--warning-soft); border: 1px solid var(--warning-border); color: var(--warning); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .rail { grid-auto-columns: calc((100% - 2rem) / 3); }
  .search-field { flex-basis: 220px; }
}

@media (max-width: 860px) {
  .product-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .product-media { position: static; aspect-ratio: 4 / 3; }
  .checkout-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
}

@media (max-width: 768px) {
  :root { --gutter: 1rem; --header-h: 60px; }

  .main-nav,
  .nav-cta-desktop,
  .header-divider { display: none; }

  .header-controls { margin-left: auto; }
  .brand-mark { height: 40px; }

  .mobile-bottom-nav { display: block; }

  /* Live blur stutters on low-end phones while scrolling: solid bars instead */
  .site-header,
  .mobile-bottom-nav {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--bg-main);
  }
  body:has(.mobile-bottom-nav) { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

  .section { padding-top: 2.25rem; }
  .section-title { font-size: 1.25rem; }

  .hero { padding-top: 0.75rem; }
  .hero-intro { padding-top: 2rem; }
  .banner-carousel { aspect-ratio: 2 / 1; border-radius: var(--radius); }

  .rail {
    grid-auto-columns: 64%;
    gap: 0.75rem;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 0.25rem;
    scroll-padding-inline: var(--gutter);
  }

  .activity-grid { grid-template-columns: minmax(0, 1fr); }
  .sales-card { padding: 1.25rem; }
  .sales-meta { padding-top: 1.25rem; }
  .activity-panel [role="tabpanel"] { padding: 0.25rem 1rem 0.875rem; }
  .activity-panel .feed-list > li:nth-child(n+5) { display: none; }
  .feed-item { align-items: flex-start; }
  .feed-time { padding-top: 0.1rem; }
  .feed-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .wa-fab {
    right: 1rem;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 0.875rem);
    width: 52px;
    height: 52px;
    padding: 0;
  }
  .wa-fab .wa-label { display: none; }
  .wa-fab .wa-icon { width: 26px; height: 26px; }

  .manual-buy { flex-direction: column; align-items: stretch; text-align: left; }

  .how-steps { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .how-step { padding: 1rem; }
  .how-step:not(:last-child)::after {
    top: auto;
    right: auto;
    left: calc(1rem + 26px);
    bottom: -0.5rem;
    transform: translate(-50%, 50%) rotate(135deg);
  }

  .catalog-toolbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .search-field { flex-basis: auto; }
  .category-tabs { margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); }

  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .card-body { padding: 0.75rem 0.8rem 0.85rem; }
  .card-title { font-size: 0.875rem; }
  .price-tag { font-size: 0.9375rem; }
  .card-cta { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

  .panel { padding: 1.25rem; }
  .page-card { margin: 1.5rem 1rem; padding: 1.5rem; }
  .modal-box { padding: 1.5rem; }

  .footer-nav { gap: 2rem; }
  .site-footer { margin-top: 3.5rem; }
}

@media (max-width: 380px) {
  .catalog-grid { gap: 0.6rem; }
  .card-footer { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .card-cta { align-self: stretch; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
