/* ============================================================
   Compralia — Design System
   Marketplace MX · v1.0
   Single-file CSS for use in PHP / classic HTML pages.
   ============================================================
   TABLE OF CONTENTS
   1.  Tokens (CSS variables)
   2.  Themes (dark) and modifiers (density, radius)
   3.  Reset + base elements
   4.  Typography utilities
   5.  Layout helpers (container, grid, flex, stack)
   6.  Buttons
   7.  Badges & chips
   8.  Form controls (input, select, textarea, checkbox, radio)
   9.  Cards (product card, product row, shop card)
   10. Price, stars, rating bars
   11. Placeholder imagery (striped svg)
   12. Header (utility strip, main bar, search, nav)
   13. Footer
   14. Hero, promo tiles, section headers
   15. Category chips
   16. Flash deals banner
   17. Trust strip
   18. Filters (sidebar)
   19. Product detail (gallery, info, buy box, tabs, reviews)
   20. Cart, checkout (stepper, fields, address summary)
   21. Empty state, success state
   22. Utilities
   23. PHP runtime extras (toast, drawers, overlays)
   ============================================================ */


/* ---------- 1. TOKENS ---------- */
:root {
  /* Colors */
  --color-bg: #fdfbf7;
  --color-surface: #ffffff;
  --color-surface-2: #f5f1ea;
  --color-fg: #1c1a16;
  --color-fg-muted: #6b655a;
  --color-border: #e8e2d5;
  --color-border-strong: #d6cfbe;

  --color-primary: #4A1D7E;
  --color-primary-hover: #4a2470;
  --color-primary-dark: #341952;
  --color-primary-tint: #ede5f7;
  --color-primary-tint-hover: #ddd0ee;
  --color-primary-contrast: #ffffff;

  --color-accent: #E8B81E;
  --color-accent-dark: #c99a0a;

  --color-success: #2d7a5f;
  --color-success-bg: #d1fae5;
  --color-warning: #e8a33c;
  --color-warning-bg: #fde68a;
  --color-warning-fg: #713f12;
  --color-error: #dc2626;
  --color-error-bg: #fee2e2;
  --color-info: #3b82f6;
  --color-info-bg: #dbeafe;
  --color-rating: #e8a33c;

  /* Hero gradients */
  --hero-bg: linear-gradient(100deg, #1a3a30 0%, #2d5f4f 60%, #3e8472 100%);
  --hero-bg-purple:   linear-gradient(110deg, #341952 0%, #5B2D8C 55%, #7a3eb8 100%);
  --hero-bg-forest:   linear-gradient(100deg, #1a3a30 0%, #2d5f4f 60%, #3e8472 100%);
  --hero-bg-sunset:   linear-gradient(100deg, #8e3419 0%, #c94e2c 55%, #e8a33c 100%);
  --hero-bg-midnight: linear-gradient(100deg, #0f172a 0%, #1e293b 55%, #334155 100%);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 56px;
  --space-11: 64px;
  --space-12: 80px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(30, 20, 10, .06);
  --shadow-md: 0 4px 24px -12px rgba(30, 20, 10, .10);
  --shadow-lg: 0 8px 24px -8px rgba(30, 20, 10, .15);
  --shadow-xl: 0 12px 40px -8px rgba(30, 20, 10, .18);

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 24px;
  --fs-4xl: 28px;
  --fs-5xl: 30px;
  --fs-hero: 52px;

  /* Layout */
  --container-max: 1400px;
  --container-pad: 28px;
  --header-h: 130px;

  /* Motion */
  --transition: .15s ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-drawer:   400;
  --z-modal:    500;
  --z-toast:    600;
}


/* ---------- 2. THEMES & MODIFIERS ---------- */
[data-theme="dark"],
[data-dark="1"] {
  --color-bg: #14120f;
  --color-surface: #1c1a16;
  --color-surface-2: #262220;
  --color-fg: #f5f1ea;
  --color-fg-muted: #9b9486;
  --color-border: #2e2a25;
  --color-border-strong: #3d3830;
  --color-primary-tint: rgba(91, 45, 140, .22);
  --color-primary-tint-hover: rgba(91, 45, 140, .32);
}

[data-density="compact"] { --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; --radius-xl: 14px; }
[data-density="airy"]    { --radius-sm: 10px; --radius-md: 14px; --radius-lg: 18px; --radius-xl: 26px; }
[data-radius="square"]   { --radius-sm: 2px; --radius-md: 3px; --radius-lg: 4px; --radius-xl: 6px; }
[data-radius="pill"]     { --radius-sm: 12px; --radius-md: 16px; --radius-lg: 22px; --radius-xl: 32px; }

[data-hero="purple"]   { --hero-bg: var(--hero-bg-purple); }
[data-hero="forest"]   { --hero-bg: var(--hero-bg-forest); }
[data-hero="sunset"]   { --hero-bg: var(--hero-bg-sunset); }
[data-hero="midnight"] { --hero-bg: var(--hero-bg-midnight); }


/* ---------- 3. RESET + BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-fg);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, h3, h4, h5, h6, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
input::placeholder { color: var(--color-fg-muted); opacity: .7; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--color-primary-tint); color: var(--color-primary); }

.app-bg { min-height: 100vh; background: var(--color-bg); }


/* ---------- 4. TYPOGRAPHY ---------- */
.h1 { font-size: var(--fs-hero); line-height: 1.02; font-weight: 600; letter-spacing: -.035em; text-wrap: balance; }
.h2 { font-size: var(--fs-5xl); line-height: 1.1; font-weight: 600; letter-spacing: -.025em; }
.h3 { font-size: var(--fs-3xl); line-height: 1.1; font-weight: 600; letter-spacing: -.025em; }
.h4 { font-size: var(--fs-xl); line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.h5 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }
.text-xs   { font-size: var(--fs-xs); }
.text-sm   { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-md   { font-size: var(--fs-md); }
.text-lg   { font-size: var(--fs-lg); }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--color-fg-muted); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-rating { color: var(--color-rating); }
.text-pretty { text-wrap: pretty; }
.text-balance { text-wrap: balance; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; letter-spacing: .06em; }
.tabular { font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  color: var(--color-fg-muted);
}


/* ---------- 5. LAYOUT HELPERS ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}
.section { padding-top: var(--space-9); padding-bottom: var(--space-9); }

.grid { display: grid; }
.grid-2  { grid-template-columns: repeat(2, 1fr); }
.grid-3  { grid-template-columns: repeat(3, 1fr); }
.grid-4  { grid-template-columns: repeat(4, 1fr); }
.grid-5  { grid-template-columns: repeat(5, 1fr); }
.grid-6  { grid-template-columns: repeat(6, 1fr); }
.grid-10 { grid-template-columns: repeat(10, 1fr); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-7 { gap: var(--space-7); }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.flex-col { flex-direction: column; }
.flex-1   { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-6); }


/* ---------- 6. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 18px;
  font-size: var(--fs-base);
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -.005em;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  cursor: pointer;
  transition: background var(--transition), transform .05s, border-color var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--color-primary-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--secondary {
  background: var(--color-primary-tint);
  color: var(--color-primary);
}
.btn--secondary:hover { background: var(--color-primary-tint-hover); }

.btn--outline {
  background: transparent;
  color: var(--color-fg);
  border-color: var(--color-border);
}
.btn--outline:hover { background: var(--color-surface-2); }

.btn--ghost {
  background: transparent;
  color: var(--color-fg);
}
.btn--ghost:hover { background: var(--color-surface-2); }

.btn--dark {
  background: var(--color-fg);
  color: var(--color-bg);
}
.btn--dark:hover { background: var(--color-fg-muted); }

.btn--on-dark {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
}
.btn--on-dark:hover { background: rgba(255, 255, 255, .12); }

.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--md { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn--xl { height: 56px; padding: 0 32px; font-size: 16px; }
.btn--full { width: 100%; }


/* Icon button */
.icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-fg-muted);
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
}
.icon-btn:hover { color: var(--color-primary); }
.icon-btn.is-active { color: var(--color-primary); }


/* ---------- 7. BADGES & CHIPS ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 8px;
  background: var(--color-surface-2);
  color: var(--color-fg);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.4;
  border-radius: var(--radius-full);
}
.badge--primary { background: var(--color-primary); color: var(--color-primary-contrast); }
.badge--success { background: var(--color-success); color: #fff; }
.badge--warning { background: var(--color-warning-bg); color: var(--color-warning-fg); }
.badge--dark    { background: var(--color-fg); color: var(--color-bg); }
.badge--ghost   { background: rgba(255, 255, 255, .9); color: var(--color-fg); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  background: var(--color-primary-tint);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.chip__remove {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .1);
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* ---------- 8. FORM CONTROLS ---------- */
.input,
.select,
.textarea {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: var(--fs-base);
  font-family: inherit;
  color: var(--color-fg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.textarea { height: auto; padding: 12px 14px; min-height: 96px; resize: vertical; }
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-tint);
}
.input--sm { height: 34px; padding: 0 10px; font-size: 13px; }
.input--num { font-variant-numeric: tabular-nums; }

.field { display: block; }
.field__label {
  font-size: var(--fs-xs);
  color: var(--color-fg-muted);
  display: block;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.field--full { grid-column: 1 / -1; }

.checkbox,
.radio { accent-color: var(--color-primary); }

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}
.check-row__count {
  margin-left: auto;
  color: var(--color-fg-muted);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

/* Quantity stepper */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty__btn {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--color-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qty__btn:hover { background: var(--color-surface-2); }
.qty__val {
  width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
}


/* ---------- 9. CARDS ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.card--flat { box-shadow: none; }
.card--elevated { box-shadow: var(--shadow-md); }

/* Product card (grid) */
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-decoration: none;
  color: inherit;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border-strong);
}
.product-card--compact { padding: 10px; gap: 8px; }
.product-card__media {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.product-card__badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
}
.product-card__fav {
  position: absolute;
  top: 8px;
  right: 8px;
}
.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.product-card__title {
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-fg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}
.product-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--color-fg-muted);
  margin-top: auto;
}
.product-card__shipping {
  font-size: 11.5px;
  color: var(--color-success);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.product-card__installments {
  font-size: 11.5px;
  color: var(--color-success);
  font-weight: 500;
}
.product-card--compact .product-card__title { font-size: 12px; }

/* Product row (list) */
.product-row {
  display: grid;
  grid-template-columns: 160px 1fr 220px;
  gap: 20px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  cursor: pointer;
  align-items: stretch;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.product-row:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); }
.product-row__media { border-radius: var(--radius-md); overflow: hidden; }
.product-row__body { display: flex; flex-direction: column; gap: 6px; }
.product-row__title { font-size: var(--fs-md); line-height: 1.3; text-wrap: pretty; }
.product-row__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.product-row__meta { font-size: var(--fs-sm); color: var(--color-fg-muted); margin-top: auto; }
.product-row__buy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}

/* Shop card */
.shop-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--color-surface);
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.shop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.shop-card__avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--color-primary-tint);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.03em;
}
.shop-card__name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.shop-card__cat  { font-size: 11px; color: var(--color-fg-muted); margin-bottom: 8px; }
.shop-card__row  { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 11px; }


/* ---------- 10. PRICE, STARS, RATING BARS ---------- */
.price { display: flex; flex-direction: column; gap: 2px; }
.price__list {
  font-size: 12px;
  text-decoration: line-through;
  color: var(--color-fg-muted);
  font-variant-numeric: tabular-nums;
}
.price__row { display: flex; align-items: baseline; gap: 8px; }
.price__amount {
  font-size: 22px;
  font-weight: 500;
  color: var(--color-fg);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  line-height: 1;
}
.price__discount {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-success);
  letter-spacing: .02em;
}
.price--sm .price__amount { font-size: 15px; }
.price--sm .price__list   { font-size: 11px; }
.price--lg .price__amount { font-size: 34px; }
.price--lg .price__list   { font-size: 15px; }
.price--xl .price__amount { font-size: 46px; }
.price--xl .price__list   { font-size: 16px; }

.stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-fg-muted);
  font-size: 13px;
}
.stars__icon { color: var(--color-rating); display: inline-flex; }
.stars__rating {
  font-variant-numeric: tabular-nums;
  color: var(--color-fg);
}
.stars__count { font-variant-numeric: tabular-nums; }

.rating-bar { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.rating-bar__num { width: 14px; font-variant-numeric: tabular-nums; }
.rating-bar__track {
  flex: 1;
  height: 6px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.rating-bar__fill { height: 100%; background: var(--color-rating); }
.rating-bar__pct {
  width: 32px;
  text-align: right;
  color: var(--color-fg-muted);
  font-variant-numeric: tabular-nums;
}


/* ---------- 11. PLACEHOLDER IMAGERY ---------- */
.placeholder {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  background: #f3ede2;
  aspect-ratio: 1 / 1;
}
.placeholder__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.placeholder__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.placeholder__label > span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: rgba(0, 0, 0, .42);
  text-transform: lowercase;
  background: rgba(255, 255, 255, .6);
  padding: 3px 7px;
  border-radius: 4px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}


/* ---------- 12. HEADER ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.header--scrolled { box-shadow: var(--shadow-md); }
.header__util {
  background: var(--color-fg);
  color: var(--color-bg);
  font-size: var(--fs-sm);
}
.header__util-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 7px var(--container-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.header__util-group {
  display: flex;
  align-items: center;
  gap: 20px;
  opacity: .85;
}
.header__util-group > span { display: inline-flex; align-items: center; gap: 5px; }

.header__main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 18px var(--container-pad);
  display: flex;
  align-items: center;
  gap: 24px;
}
.header__brand { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
.header__search-wrap { flex: 1; position: relative; max-width: 720px; }

.search-bar {
  display: flex;
  align-items: stretch;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 48px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-tint);
}
.search-bar__icon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--color-fg-muted);
}
.search-bar__input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: var(--fs-base);
  color: var(--color-fg);
}
.search-bar__btn {
  border: 0;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  padding: 0 28px;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
}
.search-bar__btn:hover { background: var(--color-primary-hover); }

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 8px;
  z-index: var(--z-dropdown);
  display: none;
}
.suggest.is-open { display: block; }
.suggest__heading {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-fg-muted);
  padding: 6px 10px;
  font-weight: 600;
}
.suggest__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.suggest__item:hover { background: var(--color-surface-2); }
.suggest__thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.suggest__title {
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.header-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  color: var(--color-fg);
  transition: background var(--transition);
  position: relative;
}
.header-action:hover { background: var(--color-surface-2); }
.header-action__icon { position: relative; }
.header-action__count {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.header-action__labels {
  text-align: left;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.header-action__sub {
  font-size: 10px;
  color: var(--color-fg-muted);
  font-weight: 400;
}
.header-action__main { font-size: 13px; font-weight: 500; }

.header__nav {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}
.header__nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  overflow: hidden;
}
.header__nav-all {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-fg);
  padding: 0 14px;
  height: 100%;
  font-family: inherit;
  border-right: 1px solid var(--color-border);
  text-decoration: none;
  white-space: nowrap;
}
.header__nav-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-fg-muted);
  padding: 0 14px;
  height: 100%;
  font-family: inherit;
  transition: color var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.header__nav-link:hover { color: var(--color-primary); }
.header__nav-promo {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--color-primary);
  font-weight: 600;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -.04em;
  position: relative;
  flex-shrink: 0;
}
.logo__dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-bg);
}
.logo__name {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo__name-main {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--color-fg);
}
.logo__name-sub {
  font-size: 9px;
  color: var(--color-fg-muted);
  letter-spacing: .24em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 2px;
}

/* Mobile hamburger */
.header__hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  color: var(--color-fg);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header__hamburger:hover { background: var(--color-surface-2); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-bg);
  font-size: var(--fs-xs);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), border-color var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,.1); }


/* ---------- 13. FOOTER ---------- */
.footer {
  background: var(--color-fg);
  color: var(--color-bg);
  margin-top: 80px;
}
.footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 56px var(--container-pad) 32px;
}
.footer__cols {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr);
  gap: 40px;
}
.footer__about {
  font-size: 13px;
  opacity: .7;
  margin-top: 16px;
  line-height: 1.6;
  max-width: 280px;
}
.footer__col-title {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .6;
  font-weight: 600;
  margin-bottom: 16px;
}
.footer__col-list { display: flex; flex-direction: column; gap: 10px; }
.footer__col-list > * { font-size: 13px; opacity: .8; cursor: pointer; }
.footer__col-list > *:hover { opacity: 1; }
.footer__legal {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-sm);
  opacity: .6;
}
.footer__legal-links { display: flex; gap: 20px; }

/* Footer mobile accordion */
.footer__col-toggle {
  display: none;
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  align-items: center;
  justify-content: space-between;
}
.footer__col-body { display: flex; flex-direction: column; gap: 10px; }


/* ---------- 14. HERO, PROMO TILES, SECTION HEADERS ---------- */
.hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--hero-bg);
  color: #fff;
  padding: 56px 48px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 30%, rgba(255, 255, 255, .15), transparent 50%);
  pointer-events: none;
}
[data-hero="purple"] .hero,
.hero--purple { --hero-bg: var(--hero-bg-purple); }
[data-hero="forest"] .hero,
.hero--forest  { --hero-bg: var(--hero-bg-forest); }
[data-hero="sunset"] .hero,
.hero--sunset  { --hero-bg: var(--hero-bg-sunset); }
[data-hero="midnight"] .hero,
.hero--midnight { --hero-bg: var(--hero-bg-midnight); }

.hero__inner { position: relative; z-index: 1; }
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, .14);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero__title {
  font-size: 52px;
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -.035em;
  max-width: 620px;
  text-wrap: balance;
}
.hero__title em { font-style: normal; color: #e8d7bc; }
.hero__sub {
  font-size: 16px;
  opacity: .85;
  margin-top: 16px;
  max-width: 480px;
  line-height: 1.5;
  text-wrap: pretty;
}
.hero__cta { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.hero__art {
  position: absolute;
  right: 40px;
  bottom: 40px;
  top: 40px;
  width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__art-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: rotate(-4deg);
}

.promo-tile {
  background: var(--color-surface-2);
  color: var(--color-fg);
  padding: 24px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 160px;
}
.promo-tile--success { background: var(--color-success); color: #fff; }
.promo-tile__icon { position: absolute; right: -10px; top: -10px; opacity: .2; }
.promo-tile__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .8;
}
.promo-tile__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: 6px;
}
.promo-tile__sub { font-size: 13px; opacity: .85; line-height: 1.4; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}
.section-header__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.section-header__sub {
  font-size: var(--fs-base);
  color: var(--color-fg-muted);
  margin-top: 6px;
}
.section-header__action {
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  text-decoration: none;
}


/* ---------- 15. CATEGORY CHIPS ---------- */
.category-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  min-width: 92px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-fg);
  transition: all var(--transition);
  font-family: inherit;
  text-decoration: none;
}
.category-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.category-chip.is-active {
  background: var(--color-primary-tint);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.category-chip__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary-tint);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-chip.is-active .category-chip__icon {
  background: var(--color-primary);
  color: #fff;
}


/* ---------- 16. FLASH DEALS BANNER ---------- */
.flash-deals {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-lg);
  color: var(--color-primary-contrast);
}
.flash-deals__head { display: flex; align-items: center; gap: 14px; }
.flash-deals__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.flash-deals__title { font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.flash-deals__sub   { font-size: 12px; opacity: .85; margin-top: 3px; }
.flash-deals__timer { display: flex; align-items: center; gap: 10px; }
.flash-deals__cells {
  display: flex;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.flash-deals__cell {
  background: rgba(0, 0, 0, .28);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
}
.flash-deals__sep { align-self: center; opacity: .6; }


/* ---------- 17. TRUST STRIP ---------- */
.trust-strip {
  padding: 32px 40px;
  background: var(--color-surface-2);
  border-radius: var(--radius-xl);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.trust-item { display: flex; gap: 14px; align-items: flex-start; }
.trust-item__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.trust-item__title { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.trust-item__body  { font-size: 12.5px; color: var(--color-fg-muted); margin-top: 3px; line-height: 1.45; }


/* ---------- 18. FILTERS SIDEBAR ---------- */
.filters { position: sticky; top: 140px; }
.filters__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-group {
  border-top: 1px solid var(--color-border);
  padding: 16px 0;
}
.filter-group__head {
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-fg);
  margin-bottom: 12px;
  font-family: inherit;
}
.filter-group__body { display: flex; flex-direction: column; gap: 2px; }
.filter-group.is-collapsed .filter-group__body { display: none; }

.price-range { display: flex; gap: 8px; margin-bottom: 12px; }
.price-range__cell { flex: 1; }
.price-range__label {
  font-size: 10px;
  color: var(--color-fg-muted);
  margin-bottom: 2px;
}
.price-range__preset {
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 12.5px;
  padding: 4px 0;
  cursor: pointer;
  color: var(--color-fg);
  font-family: inherit;
}
.price-range__preset:hover { color: var(--color-primary); }


/* ---------- 19. PRODUCT DETAIL ---------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--color-fg-muted);
  margin-bottom: 20px;
}
.breadcrumbs__sep { display: inline-flex; }
.breadcrumbs__current {
  color: var(--color-fg);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.product-detail { display: grid; grid-template-columns: 1.05fr 1fr 320px; gap: 28px; }

.gallery { display: flex; gap: 12px; }
.gallery__thumbs { display: flex; flex-direction: column; gap: 8px; }
.gallery__thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--color-border);
  padding: 0;
  cursor: pointer;
  background: transparent;
  transition: border-color var(--transition);
}
.gallery__thumb.is-active,
.gallery__thumb:hover { border-color: var(--color-primary); }
.gallery__main {
  flex: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  position: relative;
}
.gallery__overlay-tl { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.gallery__overlay-tr { position: absolute; top: 12px; right: 12px; }

.product-info__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--color-fg-muted);
  margin-bottom: 10px;
}
.product-info__title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.15;
  margin-bottom: 14px;
  text-wrap: balance;
}
.product-info__rating-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 13px;
}
.product-info__cta-installments {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-success);
  font-weight: 500;
}

.variants { margin-top: 28px; }
.variants__label { font-size: 13px; color: var(--color-fg-muted); margin-bottom: 10px; }
.variants__swatches { display: flex; gap: 8px; }
.swatch {
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.swatch.is-active { border-color: var(--color-primary); }
.swatch__color {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .1);
}

.assurances {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.assurance { display: flex; align-items: flex-start; gap: 12px; }
.assurance__icon { color: var(--color-fg-muted); margin-top: 1px; }
.assurance__icon--success { color: var(--color-success); }
.assurance__title { font-size: 13.5px; font-weight: 600; }
.assurance__title--success { color: var(--color-success); }
.assurance__body { font-size: 13.5px; color: var(--color-fg-muted); }

.buy-box {
  position: sticky;
  top: 140px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}
.buy-box__seller-label { font-size: 12px; color: var(--color-fg-muted); margin-bottom: 4px; }
.buy-box__seller {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.buy-box__seller-name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.buy-box__seller-tag { font-size: 11px; color: var(--color-fg-muted); margin-top: 2px; }

.ship-to {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 12px;
}
.ship-to__icon { color: var(--color-fg-muted); }
.ship-to__label { color: var(--color-fg-muted); }
.ship-to__value { font-weight: 600; }
.ship-to__cta {
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.stock-pill {
  font-size: 12px;
  color: var(--color-success);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.stock-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.qty-row__label { font-size: 13px; color: var(--color-fg-muted); }

.buy-box__actions { display: flex; flex-direction: column; gap: 8px; }
.buy-box__sub-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  font-size: 12px;
}
.buy-box__sub-link {
  border: 0;
  background: transparent;
  color: var(--color-fg-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  padding: 4px;
}
.buy-box__sub-link:hover { color: var(--color-primary); }

/* Tabs */
.tabs {
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 4px;
  margin-top: 56px;
}
.tab {
  border: 0;
  background: transparent;
  padding: 14px 18px;
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--color-fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  transition: color var(--transition), border-color var(--transition);
}
.tab.is-active {
  color: var(--color-fg);
  font-weight: 600;
  border-bottom-color: var(--color-primary);
}
.tab-panel { margin-top: 32px; max-width: 900px; }
.tab-panel:not(.is-active) { display: none; }

.specs-table {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.specs-table__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  padding: 14px 20px;
  font-size: var(--fs-base);
}
.specs-table__row:nth-child(even) { background: var(--color-surface); }
.specs-table__row:nth-child(odd)  { background: var(--color-surface-2); }
.specs-table__key { color: var(--color-fg-muted); }
.specs-table__val { font-weight: 500; }

/* Reviews */
.reviews { display: grid; grid-template-columns: 300px 1fr; gap: 40px; }
.reviews__score {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reviews__stars {
  color: var(--color-rating);
  display: inline-flex;
  gap: 2px;
  margin-top: 10px;
}
.reviews__count {
  font-size: 13px;
  color: var(--color-fg-muted);
  margin-top: 8px;
}
.reviews__bars { margin-top: 20px; display: flex; flex-direction: column; gap: 6px; }

.review { padding-bottom: 20px; border-bottom: 1px solid var(--color-border); }
.review__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.review__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary-tint);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.review__name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.review__date { font-size: 11px; color: var(--color-fg-muted); }
.review__stars { color: var(--color-rating); display: inline-flex; gap: 2px; }
.review__title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.review__body  { font-size: 14px; color: var(--color-fg); line-height: 1.55; text-wrap: pretty; }
.review__helpful { margin-top: 12px; font-size: 12px; color: var(--color-fg-muted); }


/* ---------- 20. CART / CHECKOUT ---------- */
.page-title {
  font-size: var(--fs-5xl);
  font-weight: 600;
  letter-spacing: -.025em;
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: var(--fs-base);
  color: var(--color-fg-muted);
  margin-bottom: 28px;
}

.cart { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: flex-start; }
.cart__items { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.cart-item__media { border-radius: var(--radius-md); overflow: hidden; }
.cart-item__body { display: flex; flex-direction: column; gap: 6px; }
.cart-item__title { font-size: 14px; line-height: 1.35; cursor: pointer; text-wrap: pretty; }
.cart-item__seller { font-size: 12px; color: var(--color-fg-muted); }
.cart-item__shipping {
  font-size: 12px;
  color: var(--color-success);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.cart-item__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
}
.cart-item__price-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cart-item__unit-price {
  font-size: 11px;
  color: var(--color-fg-muted);
  font-variant-numeric: tabular-nums;
}

.summary {
  position: sticky;
  top: 140px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--color-surface);
}
.summary__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 20px;
}
.summary__rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--fs-base);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.summary-row__label { color: var(--color-fg-muted); }
.summary-row__value { font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-row__value--success { color: var(--color-success); }

.summary__discount { display: flex; gap: 8px; margin-top: 4px; }
.summary__discount .input { height: 38px; }

.summary__total {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.summary__total-label { font-size: 14px; font-weight: 600; }
.summary__total-amount {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.summary__total-msi {
  font-size: 11px;
  color: var(--color-success);
  text-align: right;
  font-weight: 600;
}
.summary__safe {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
  font-size: 11px;
  color: var(--color-fg-muted);
}

/* Checkout stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 36px;
}
.stepper__step { display: flex; align-items: center; gap: 10px; }
.stepper__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-surface-2);
  color: var(--color-fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stepper__step.is-current .stepper__dot,
.stepper__step.is-done .stepper__dot {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
}
.stepper__label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-fg-muted);
}
.stepper__step.is-current .stepper__label,
.stepper__step.is-done .stepper__label { color: var(--color-fg); font-weight: 600; }
.stepper__line {
  flex: 1;
  height: 1px;
  background: var(--color-border);
  margin: 0 14px;
}
.stepper__line.is-done { background: var(--color-primary); }

/* Pay method radios */
.pay-method {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--color-bg);
  transition: border-color var(--transition), background var(--transition);
}
.pay-method.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
}
.pay-method__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pay-method__label { font-size: 14px; font-weight: 600; }
.pay-method__sub   { font-size: 12px; color: var(--color-fg-muted); margin-top: 2px; }

.notice {
  padding: 16px 20px;
  background: var(--color-primary-tint);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.notice__icon { margin-top: 1px; flex-shrink: 0; }
.notice--surface {
  padding: 14px;
  background: var(--color-surface-2);
  color: var(--color-fg);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 12px;
  font-size: 13px;
}


/* ---------- 21. EMPTY / SUCCESS STATES ---------- */
.empty-state {
  max-width: 600px;
  margin: 80px auto;
  text-align: center;
  padding: 40px;
}
.empty-state__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-fg-muted);
}
.empty-state__title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}
.empty-state__body {
  font-size: 15px;
  color: var(--color-fg-muted);
  margin-bottom: 28px;
}

.success-state .empty-state__icon {
  background: var(--color-success);
  color: #fff;
}
.success-state__title {
  font-size: var(--fs-5xl);
  font-weight: 600;
  letter-spacing: -.025em;
  margin-bottom: 12px;
}
.success-state__body {
  font-size: 15px;
  color: var(--color-fg-muted);
  margin-bottom: 8px;
  line-height: 1.6;
}


/* ---------- 22. UTILITIES ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.overflow-hidden { overflow: hidden; }
.full-bleed { width: 100%; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.bg-surface   { background: var(--color-surface); }
.bg-surface-2 { background: var(--color-surface-2); }
.bg-primary   { background: var(--color-primary); color: var(--color-primary-contrast); }
.divider {
  height: 1px;
  background: var(--color-border);
  border: 0;
}

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }
.mt-8 { margin-top: var(--space-8); }
.mt-9 { margin-top: var(--space-9); }
.mt-10 { margin-top: var(--space-10); }
.mt-11 { margin-top: var(--space-11); }
.mt-12 { margin-top: var(--space-12); }

.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-7 { margin-bottom: var(--space-7); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.pt-7 { padding-top: var(--space-7); }
.pb-7 { padding-bottom: var(--space-7); }

.hidden { display: none !important; }
.block  { display: block; }


/* ---------- 23. PHP RUNTIME EXTRAS ---------- */

/* Overlay (shared between drawers) */
.c-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.c-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Nav drawer (mobile) */
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  background: var(--color-surface);
  z-index: var(--z-drawer);
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.nav-drawer.is-open { transform: translateX(0); }
.nav-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.nav-drawer__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-fg);
}
.nav-drawer__body { padding: 16px 0; flex: 1; }
.nav-drawer__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--color-fg);
  text-decoration: none;
  transition: background var(--transition);
}
.nav-drawer__link:hover { background: var(--color-surface-2); }
.nav-drawer__divider {
  height: 1px;
  background: var(--color-border);
  margin: 8px 0;
}

/* Cart side drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: var(--color-surface);
  z-index: var(--z-drawer);
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}
.cart-drawer.is-open { transform: translateX(0); }
.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.cart-drawer__title { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.cart-drawer__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-fg);
}
.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--color-fg-muted);
  font-size: 14px;
  text-align: center;
  padding: 40px;
}
.cart-drawer__footer {
  padding: 20px 24px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: 600;
}
.cart-drawer__total-amount { font-size: 22px; font-variant-numeric: tabular-nums; }

/* Drawer cart item */
.drawer-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}
.drawer-item__media { border-radius: var(--radius-sm); overflow: hidden; }
.drawer-item__body { display: flex; flex-direction: column; gap: 4px; }
.drawer-item__title { font-size: 13px; line-height: 1.3; }
.drawer-item__price { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.drawer-item__remove {
  border: 0;
  background: transparent;
  color: var(--color-fg-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-align: left;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.drawer-item__remove:hover { color: var(--color-error); }

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--color-fg);
  color: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 13.5px;
  min-width: 260px;
  max-width: 380px;
  pointer-events: auto;
  animation: toast-in .2s ease;
  position: relative;
  overflow: hidden;
}
.toast--success { background: var(--color-success); color: #fff; }
.toast--error   { background: var(--color-error); color: #fff; }
.toast--warning { background: var(--color-warning); color: #fff; }
.toast--info    { background: var(--color-info); color: #fff; }
.toast__icon { flex-shrink: 0; margin-top: 1px; }
.toast__msg  { flex: 1; line-height: 1.4; }
.toast__close {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: .7;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.toast__close:hover { opacity: 1; }
.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, .4);
  animation: toast-progress linear forwards;
}
.toast.is-leaving {
  animation: toast-out .2s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(.97); }
}
@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0; }
}

/* Filter bottom sheet (mobile) */
.filter-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  z-index: var(--z-drawer);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(100%);
  transition: transform .25s ease;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.filter-sheet.is-open { transform: translateY(0); }
.filter-sheet__handle {
  width: 36px;
  height: 4px;
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  margin: 12px auto 0;
  flex-shrink: 0;
}
.filter-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.filter-sheet__title { font-size: 16px; font-weight: 600; }
.filter-sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.filter-sheet__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Account dropdown (header) */
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 8px;
  min-width: 200px;
  z-index: var(--z-dropdown);
  display: none;
}
.account-dropdown.is-open { display: block; }
.account-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-fg);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition);
}
.account-dropdown__item:hover { background: var(--color-surface-2); }
.account-dropdown__divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

/* OTP input group */
.otp-group {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.otp-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-fg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  caret-color: var(--color-primary);
}
.otp-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-tint);
}
.otp-input.is-filled { border-color: var(--color-primary); background: var(--color-primary-tint); }

/* Password input wrapper */
.input-password-wrap {
  position: relative;
}
.input-password-wrap .input { padding-right: 44px; }
.input-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--color-fg-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.input-password-toggle:hover { color: var(--color-fg); }

/* Auth card */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hero-bg);
  padding: 24px;
}
.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}
.auth-card__title {
  font-size: var(--fs-3xl);
  font-weight: 600;
  letter-spacing: -.025em;
  margin-bottom: 6px;
}
.auth-card__sub {
  font-size: var(--fs-base);
  color: var(--color-fg-muted);
  margin-bottom: 28px;
}

/* Account type selector cards */
.type-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.type-card.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
}
.type-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.type-card__title { font-size: 14px; font-weight: 600; }
.type-card__sub   { font-size: 12px; color: var(--color-fg-muted); margin-top: 2px; }

/* Progress bar (multi-step forms) */
.progress-bar {
  height: 4px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 32px;
}
.progress-bar__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width .3s ease;
}

/* Lazy load images */
img[data-src] { opacity: 0; transition: opacity .3s ease; }
img.is-loaded { opacity: 1; }


/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .product-detail { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-10 { grid-template-columns: repeat(5, 1fr); }
  .reviews { grid-template-columns: 1fr; }
  .cart, .product-row { grid-template-columns: 1fr; }
  .header-action__labels { display: none; }
}

@media (max-width: 768px) {
  :root { --container-pad: 16px; }
  .header__hamburger { display: inline-flex; }
  .header__nav { display: none; }
  .header__main { flex-wrap: wrap; gap: 12px; }
  .header__search-wrap { order: 3; flex-basis: 100%; max-width: 100%; }
  .hero { padding: 32px 24px; min-height: 280px; }
  .hero__title { font-size: 34px; }
  .hero__art { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-10 { grid-template-columns: repeat(3, 1fr); }
  .trust-strip { grid-template-columns: 1fr 1fr; padding: 24px; }
  .footer__cols { grid-template-columns: 1fr; gap: 0; }
  .footer__col-toggle { display: flex; }
  .footer__col-body { display: none; }
  .footer__col-body.is-open { display: flex; }
  .footer__col-title { margin-bottom: 0; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .cart-item { grid-template-columns: 80px 1fr; }
  .cart-item__price-col { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .cart-drawer { width: 100%; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}

@media (max-width: 480px) {
  .otp-group { gap: 6px; }
  .otp-input { width: 44px; height: 52px; font-size: 20px; }
  .auth-card { padding: 28px 20px; }
  .grid-10 { grid-template-columns: repeat(2, 1fr); }
}
