/* =====================================================================
   MyStore — design system
   Tokens → base → layout → components → utilities
   Light and dark are both first-class; dark is driven by
   [data-theme="dark"] on <html>, seeded from prefers-color-scheme.
   ===================================================================== */

/* ---------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------- */
:root {
  /* Brand */
  --brand-50:  #eef0ff;
  --brand-100: #e0e3ff;
  --brand-200: #c7ccfe;
  --brand-300: #a5aafc;
  --brand-400: #8b83f8;
  --brand-500: #6d5efc;
  --brand-600: #5b45e8;
  --brand-700: #4c37c4;
  --brand-800: #3f2f9e;
  --brand-900: #362b7d;

  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;

  /* Semantic */
  --success-500: #10b981;
  --success-600: #059669;
  --danger-500:  #ef4444;
  --danger-600:  #dc2626;
  --warning-500: #f59e0b;
  --info-500:    #0ea5e9;

  /* Surfaces — light */
  --bg:          #f7f7fb;
  --bg-alt:      #ffffff;
  --surface:     #ffffff;
  --surface-2:   #f3f4f8;
  --surface-3:   #eceef4;
  --overlay:     rgba(17, 18, 32, .45);

  /* Text */
  --text:        #14162b;
  --text-muted:  #5c6079;
  --text-subtle: #868ba3;
  --text-invert: #ffffff;

  /* Lines */
  --border:      #e4e6ef;
  --border-strong: #d2d5e3;
  --ring:        rgba(109, 94, 252, .35);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(20, 22, 43, .05);
  --shadow-sm: 0 1px 3px rgba(20, 22, 43, .07), 0 1px 2px rgba(20, 22, 43, .04);
  --shadow-md: 0 4px 12px rgba(20, 22, 43, .08), 0 2px 4px rgba(20, 22, 43, .04);
  --shadow-lg: 0 12px 32px rgba(20, 22, 43, .12), 0 4px 8px rgba(20, 22, 43, .05);
  --shadow-xl: 0 24px 56px rgba(20, 22, 43, .16);
  --shadow-brand: 0 8px 24px rgba(109, 94, 252, .28);

  /* Geometry */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Rhythm */
  --header-h: 72px;
  --container: 1240px;

  /* Motion */
  --t-fast: 120ms cubic-bezier(.4, 0, .2, 1);
  --t: 200ms cubic-bezier(.4, 0, .2, 1);
  --t-slow: 400ms cubic-bezier(.16, 1, .3, 1);

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:        #0b0c16;
  --bg-alt:    #111324;
  --surface:   #151830;
  --surface-2: #1c2040;
  --surface-3: #252a4f;
  --overlay:   rgba(0, 0, 0, .65);

  --text:        #eef0fa;
  --text-muted:  #a3a8c4;
  --text-subtle: #7b81a3;

  --border:        #262b4d;
  --border-strong: #363c66;
  --ring: rgba(139, 131, 248, .45);

  --brand-500: #8b83f8;
  --brand-600: #7a6ff5;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, .55);
  --shadow-xl: 0 28px 64px rgba(0, 0, 0, .6);
  --shadow-brand: 0 8px 28px rgba(109, 94, 252, .4);

  color-scheme: dark;
}

/* ---------------------------------------------------------------
   2. Base
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t), color var(--t);
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4, h5 {
  margin: 0 0 .5em;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--text);
}
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.1rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-600); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-500); }

img { max-width: 100%; height: auto; display: block; }
svg { flex-shrink: 0; }

hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

small { font-size: .82rem; }

code, kbd {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--surface-2);
  padding: .15em .45em;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--brand-200); color: var(--brand-900); }
[data-theme="dark"] ::selection { background: var(--brand-700); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 3px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

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

/* ---------------------------------------------------------------
   3. Layout
   --------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
.container-narrow { max-width: 780px; }
.container-tight  { max-width: 520px; }

.section { padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.section-sm { padding: 2rem 0; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.page-head h1, .page-head h2 { margin: 0; }
.page-head .sub { color: var(--text-muted); margin: .35rem 0 0; }

.section-head { text-align: center; max-width: 620px; margin: 0 auto 2.5rem; }
.section-head h2 { margin-bottom: .5rem; }
.section-head p { color: var(--text-muted); font-size: 1.02rem; }

.grid { display: grid; gap: 1.25rem; }
.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-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid-auto-lg { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------------
   4. Header / navigation
   --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--bg-alt) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--t), background-color var(--t);
}
.site-header.is-stuck { box-shadow: var(--shadow-md); }

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -.03em;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow-brand);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin: 0 auto 0 1rem;
  padding: 0;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: .5rem .8rem;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-weight: 550;
  font-size: .93rem;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a.active { color: var(--brand-600); background: var(--brand-50); }
[data-theme="dark"] .nav-links a.active { background: rgba(139, 131, 248, .14); color: var(--brand-400); }

.nav-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
.icon-btn:hover {
  color: var(--brand-600);
  border-color: var(--brand-300);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.icon-btn .count {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  display: grid; place-items: center;
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  background: var(--danger-500);
  border-radius: var(--r-full);
  border: 2px solid var(--bg-alt);
  line-height: 1;
}
.icon-btn .count:empty, .icon-btn .count[data-count="0"] { display: none; }

.nav-toggle { display: none; }

@media (max-width: 980px) {
  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    margin: 0;
    padding: 1rem 20px 1.5rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-130%);
    transition: transform var(--t-slow);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: .8rem 1rem; font-size: 1rem; }
  .nav-toggle { display: grid; }
}

/* Dropdown (account menu, filters) */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 228px;
  padding: .4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: all var(--t);
  z-index: 300;
}
.dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.dropdown-menu a, .dropdown-menu button {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .6rem .7rem;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: .92rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); color: var(--text); }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: .35rem .3rem; }
.dropdown-head {
  padding: .7rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .35rem;
}
.dropdown-head strong { display: block; font-size: .93rem; }
.dropdown-head span { font-size: .8rem; color: var(--text-muted); }

/* ---------------------------------------------------------------
   5. Buttons
   --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .68rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: all var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover:not(:disabled) {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(109, 94, 252, .38);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--brand-300); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-dark { background: var(--text); color: var(--bg-alt); }
.btn-dark:hover:not(:disabled) { opacity: .88; color: var(--bg-alt); }

.btn-success { background: var(--success-600); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--success-500); color: #fff; }

.btn-danger { background: var(--danger-600); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-500); color: #fff; }

.btn-outline-danger { background: transparent; color: var(--danger-500); border-color: currentColor; }
.btn-outline-danger:hover:not(:disabled) { background: var(--danger-500); color: #fff; }

.btn-sm { padding: .45rem .85rem; font-size: .84rem; border-radius: var(--r-xs); }
.btn-lg { padding: .9rem 1.7rem; font-size: 1rem; border-radius: var(--r-md); }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: .55rem; width: 36px; height: 36px; }

.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after {
  border-color: var(--border-strong);
  border-top-color: var(--brand-500);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------
   6. Cards & surfaces
   --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.card-body { padding: 1.35rem; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
}
.card-head h3, .card-head h4 { margin: 0; font-size: 1rem; }
.card-foot {
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------
   7. Badges, pills, chips
   --------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .6rem;
  border-radius: var(--r-full);
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .01em;
  line-height: 1.35;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-plain::before { display: none; }
.badge-brand   { background: var(--brand-50);            color: var(--brand-700); }
.badge-success { background: rgba(16, 185, 129, .12);    color: var(--success-600); }
.badge-danger  { background: rgba(239, 68, 68, .12);     color: var(--danger-600); }
.badge-warning { background: rgba(245, 158, 11, .14);    color: var(--accent-600); }
.badge-info    { background: rgba(14, 165, 233, .12);    color: #0369a1; }
.badge-muted   { background: var(--surface-3);           color: var(--text-muted); }

[data-theme="dark"] .badge-brand   { background: rgba(139, 131, 248, .16); color: var(--brand-300); }
[data-theme="dark"] .badge-success { background: rgba(16, 185, 129, .16);  color: #34d399; }
[data-theme="dark"] .badge-danger  { background: rgba(239, 68, 68, .16);   color: #f87171; }
[data-theme="dark"] .badge-warning { background: rgba(245, 158, 11, .16);  color: #fbbf24; }
[data-theme="dark"] .badge-info    { background: rgba(14, 165, 233, .16);  color: #38bdf8; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .86rem;
  font-weight: 550;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.chip:hover { border-color: var(--brand-300); color: var(--brand-600); }
.chip.active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.chip-row {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .35rem;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

/* ---------------------------------------------------------------
   8. Forms
   --------------------------------------------------------------- */
.field { margin-bottom: 1.05rem; }
.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  margin-bottom: .4rem;
  font-size: .86rem;
  font-weight: 600;
  color: var(--text);
}
.label .req { color: var(--danger-500); }
.hint { display: block; margin-top: .35rem; font-size: .8rem; color: var(--text-subtle); }
.error-text { display: block; margin-top: .35rem; font-size: .8rem; color: var(--danger-500); font-weight: 550; }

.input, .select, .textarea {
  width: 100%;
  padding: .68rem .85rem;
  font: inherit;
  font-size: .93rem;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-300); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3.5px var(--ring);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--surface-2);
  color: var(--text-subtle);
  cursor: not-allowed;
}
.input.has-error, .select.has-error, .textarea.has-error { border-color: var(--danger-500); }
.input.has-error:focus { box-shadow: 0 0 0 3.5px rgba(239, 68, 68, .25); }

.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6079' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  padding-right: 2.4rem;
  cursor: pointer;
}
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3a8c4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 2.6rem; }
.input-group .input-icon {
  position: absolute;
  left: .85rem;
  color: var(--text-subtle);
  pointer-events: none;
  display: grid;
  place-items: center;
}
.input-group .input-suffix {
  position: absolute;
  right: .5rem;
  background: none;
  border: 0;
  color: var(--text-subtle);
  cursor: pointer;
  padding: .35rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
}
.input-group .input-suffix:hover { color: var(--brand-500); background: var(--surface-2); }
.input-group:has(.input-suffix) .input { padding-right: 2.75rem; }

.input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-alt);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-prefix:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 3.5px var(--ring); }
.input-prefix span {
  padding: .68rem .8rem;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}
.input-prefix .input { border: 0; border-radius: 0; background: transparent; }
.input-prefix .input:focus { box-shadow: none; }

/* Checkbox & radio */
.check {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  cursor: pointer;
  font-size: .92rem;
  user-select: none;
}
.check input[type="checkbox"], .check input[type="radio"] {
  width: 18px; height: 18px;
  margin: 1px 0 0;
  accent-color: var(--brand-500);
  cursor: pointer;
  flex-shrink: 0;
}

/* Card-style radio group (fulfilment, payment method, location type) */
.option-group { display: grid; gap: .7rem; }
.option-group.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .option-group.cols-2 { grid-template-columns: 1fr; } }

.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .95rem 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-alt);
  cursor: pointer;
  transition: all var(--t-fast);
}
.option:hover { border-color: var(--brand-300); background: var(--surface-2); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .option-dot {
  width: 20px; height: 20px;
  margin-top: 1px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: all var(--t-fast);
}
.option .option-dot::after {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform var(--t-fast);
}
.option input:checked ~ .option-dot { border-color: var(--brand-500); background: var(--brand-500); }
.option input:checked ~ .option-dot::after { transform: scale(1); }
.option:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px var(--ring);
}
[data-theme="dark"] .option:has(input:checked) { background: rgba(139, 131, 248, .1); }
.option input:focus-visible ~ .option-dot { box-shadow: 0 0 0 3px var(--ring); }
.option-text { flex: 1; min-width: 0; }
.option-text strong { display: block; font-size: .94rem; font-weight: 650; }
.option-text span { display: block; font-size: .82rem; color: var(--text-muted); margin-top: .1rem; }
.option-price { font-weight: 700; font-size: .92rem; white-space: nowrap; }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 46px; height: 26px;
  padding: 3px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  transition: background var(--t);
  flex-shrink: 0;
}
.switch-thumb {
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t);
}
.switch input:checked + .switch-track { background: var(--brand-500); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--ring); }

/* Quantity stepper */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-alt);
}
.qty button {
  width: 36px; height: 38px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--t-fast);
}
.qty button:hover:not(:disabled) { background: var(--brand-500); color: #fff; }
.qty button:disabled { opacity: .4; cursor: not-allowed; }
.qty input {
  width: 48px;
  height: 38px;
  border: 0;
  text-align: center;
  font: inherit;
  font-weight: 650;
  background: transparent;
  color: var(--text);
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.qty input:focus { outline: none; }

/* Password strength */
.strength { display: flex; gap: 4px; margin-top: .5rem; }
.strength span {
  height: 4px;
  flex: 1;
  background: var(--surface-3);
  border-radius: var(--r-full);
  transition: background var(--t);
}
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--danger-500); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--warning-500); }
.strength[data-level="3"] span:nth-child(-n+3) { background: var(--info-500); }
.strength[data-level="4"] span { background: var(--success-500); }

/* ---------------------------------------------------------------
   9. Alerts & toasts
   --------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1.1rem;
  border-radius: var(--r-sm);
  border: 1px solid;
  font-size: .92rem;
  margin-bottom: 1rem;
}
.alert svg { margin-top: 2px; }
.alert-success { background: rgba(16, 185, 129, .09); border-color: rgba(16, 185, 129, .3);  color: var(--success-600); }
.alert-error   { background: rgba(239, 68, 68, .09);  border-color: rgba(239, 68, 68, .3);   color: var(--danger-600); }
.alert-warning { background: rgba(245, 158, 11, .1);  border-color: rgba(245, 158, 11, .32); color: var(--accent-600); }
.alert-info    { background: rgba(14, 165, 233, .09); border-color: rgba(14, 165, 233, .3);  color: #0369a1; }
[data-theme="dark"] .alert-success { color: #34d399; }
[data-theme="dark"] .alert-error   { color: #f87171; }
[data-theme="dark"] .alert-warning { color: #fbbf24; }
[data-theme="dark"] .alert-info    { color: #38bdf8; }

.toast-stack {
  position: fixed;
  top: calc(var(--header-h) + 14px);
  right: 18px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  max-width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  pointer-events: auto;
  animation: toastIn var(--t-slow);
}
.toast.leaving { animation: toastOut var(--t) forwards; }
.toast-success { border-left-color: var(--success-500); }
.toast-error   { border-left-color: var(--danger-500); }
.toast-warning { border-left-color: var(--warning-500); }
.toast-info    { border-left-color: var(--info-500); }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--success-500); }
.toast-error   .toast-icon { color: var(--danger-500); }
.toast-warning .toast-icon { color: var(--warning-500); }
.toast-info    .toast-icon { color: var(--info-500); }
.toast-close {
  background: none; border: 0; color: var(--text-subtle);
  cursor: pointer; padding: 0; margin-left: auto; line-height: 1;
}
.toast-close:hover { color: var(--text); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(110%); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(110%); height: 0; margin: 0; padding-block: 0; } }

/* ---------------------------------------------------------------
   10. Tables
   --------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  padding: .8rem 1rem;
  text-align: left;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-subtle);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: .35rem; justify-content: flex-end; }
.table-compact td, .table-compact th { padding: .6rem .8rem; }

/* Responsive stacked table */
@media (max-width: 720px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr {
    border-bottom: 1px solid var(--border);
    padding: .5rem 0;
  }
  .table-stack td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: 0;
    padding: .45rem 1rem;
    text-align: right;
  }
  .table-stack td::before {
    content: attr(data-label);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-subtle);
    text-align: left;
  }
  .table-stack .actions { justify-content: flex-end; }
}

/* ---------------------------------------------------------------
   11. Product card & grid
   --------------------------------------------------------------- */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }
[data-theme="dark"] .product-card:hover { border-color: var(--brand-700); }

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-2);
  display: block;
}
.product-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.product-card:hover .product-media img { transform: scale(1.07); }

.product-tags {
  position: absolute;
  top: .65rem; left: .65rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  z-index: 2;
}
.tag {
  padding: .22rem .55rem;
  border-radius: var(--r-xs);
  font-size: .68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
  backdrop-filter: blur(4px);
}
.tag-sale { background: var(--danger-500); }
.tag-new  { background: var(--brand-500); }
.tag-hot  { background: var(--accent-500); }
.tag-out  { background: #64748b; }

.product-quick {
  position: absolute;
  top: .65rem; right: .65rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  opacity: 0;
  transform: translateX(8px);
  transition: all var(--t);
  z-index: 2;
}
.product-card:hover .product-quick, .product-quick:focus-within { opacity: 1; transform: none; }
@media (hover: none) { .product-quick { opacity: 1; transform: none; } }
.product-quick button, .product-quick a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  color: #14162b;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast);
}
.product-quick button:hover, .product-quick a:hover { background: var(--brand-500); color: #fff; transform: scale(1.08); }
.product-quick button.active { background: var(--danger-500); color: #fff; }

.product-info { padding: .95rem 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; gap: .35rem; }
.product-cat { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-600); }
.product-name {
  font-size: .96rem;
  font-weight: 650;
  line-height: 1.35;
  margin: 0;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-name a { color: inherit; }
.product-name a:hover { color: var(--brand-600); }
.product-rating { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--text-subtle); }
.stars { display: inline-flex; gap: 1px; color: var(--accent-500); }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .5rem; }
.price { font-size: 1.06rem; font-weight: 750; color: var(--text); letter-spacing: -.02em; }
.price-old { font-size: .84rem; color: var(--text-subtle); text-decoration: line-through; margin-left: .35rem; font-weight: 500; }
.product-stock { font-size: .76rem; color: var(--text-subtle); }
.product-stock.low { color: var(--warning-500); font-weight: 600; }
.product-stock.out { color: var(--danger-500); font-weight: 600; }

.add-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand-500);
  color: #fff;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.add-btn:hover:not(:disabled) { background: var(--brand-600); transform: scale(1.07); }
.add-btn:disabled { background: var(--surface-3); color: var(--text-subtle); cursor: not-allowed; }

/* ---------------------------------------------------------------
   12. Hero
   --------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: "";
  position: absolute;
  top: -30%; right: -10%;
  width: 60vw; height: 60vw;
  max-width: 780px; max-height: 780px;
  background: radial-gradient(circle, rgba(109, 94, 252, .22), transparent 62%);
  pointer-events: none;
  animation: float 14s ease-in-out infinite;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -35%; left: -12%;
  width: 48vw; height: 48vw;
  max-width: 620px; max-height: 620px;
  background: radial-gradient(circle, rgba(245, 158, 11, .16), transparent 62%);
  pointer-events: none;
  animation: float 18s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-24px, 24px) scale(1.06); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 6vw, 5.5rem) 0;
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-bottom: 3rem; }
  .hero-cta, .hero-stats, .hero-eyebrow { justify-content: center; }
  .hero-visual { order: -1; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem .4rem .5rem;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--r-full);
  font-size: .82rem;
  font-weight: 600;
  color: var(--brand-700);
  margin-bottom: 1.25rem;
}
[data-theme="dark"] .hero-eyebrow {
  background: rgba(139, 131, 248, .12);
  border-color: rgba(139, 131, 248, .3);
  color: var(--brand-300);
}
.hero-eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .22);
  animation: pulse 2.2s infinite;
}
.hero-eyebrow .dot.closed { background: var(--danger-500); box-shadow: 0 0 0 3px rgba(239, 68, 68, .22); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}

.hero h1 { margin-bottom: 1rem; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand-500), var(--accent-500) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lead {
  font-size: clamp(1rem, .95rem + .3vw, 1.13rem);
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 1.9rem;
}
@media (max-width: 900px) { .hero-lead { margin-inline: auto; } }

.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2.4rem; }

.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(1.25rem, 3vw, 2.75rem); }
.hero-stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.hero-stat span { font-size: .82rem; color: var(--text-muted); }

.hero-visual { position: relative; }
.hero-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1rem;
}
.hero-collage figure {
  margin: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface-2);
}
.hero-collage figure img { width: 100%; height: 100%; object-fit: cover; }
.hero-collage .tall { grid-row: span 2; aspect-ratio: 3 / 4.6; }
.hero-collage .wide { aspect-ratio: 4 / 3; }
.hero-collage figure:nth-child(1) { animation: rise .7s var(--t-slow) both; }
.hero-collage figure:nth-child(2) { animation: rise .7s .1s var(--t-slow) both; }
.hero-collage figure:nth-child(3) { animation: rise .7s .2s var(--t-slow) both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.hero-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem .95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xl);
  font-size: .85rem;
  animation: bob 5s ease-in-out infinite;
}
.hero-float-1 { bottom: 8%; left: -6%; }
.hero-float-2 { top: 6%; right: -4%; animation-delay: 1.4s; }
.hero-float .ico {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-50);
  color: var(--brand-600);
  flex-shrink: 0;
}
[data-theme="dark"] .hero-float .ico { background: rgba(139, 131, 248, .14); color: var(--brand-300); }
.hero-float strong { display: block; font-size: .88rem; line-height: 1.2; }
.hero-float span { font-size: .76rem; color: var(--text-muted); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (max-width: 1100px) { .hero-float { display: none; } }

/* Trust strip */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--border);
  border-block: 1px solid var(--border);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1.35rem 1.5rem;
  background: var(--bg-alt);
}
.trust-item .ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-50);
  color: var(--brand-600);
  flex-shrink: 0;
}
[data-theme="dark"] .trust-item .ico { background: rgba(139, 131, 248, .12); color: var(--brand-300); }
.trust-item strong { display: block; font-size: .93rem; }
.trust-item span { font-size: .8rem; color: var(--text-muted); }

/* Category tile */
.cat-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow); }
.cat-tile:hover img { transform: scale(1.08); }
.cat-tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  background: linear-gradient(to top, rgba(10, 11, 22, .86) 0%, rgba(10, 11, 22, .25) 50%, transparent 78%);
  color: #fff;
}
.cat-tile-overlay strong { font-size: 1rem; font-weight: 700; }
.cat-tile-overlay span { font-size: .78rem; opacity: .82; }

/* Promo banner */
.promo {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: clamp(2rem, 4vw, 3.25rem);
  background: linear-gradient(120deg, var(--brand-700), var(--brand-500) 55%, #8b5cf6);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.promo::before {
  content: "";
  position: absolute;
  top: -55%; right: -8%;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.promo::after {
  content: "";
  position: absolute;
  bottom: -65%; right: 16%;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.promo > * { position: relative; z-index: 1; }
.promo h2 { color: #fff; }
.promo p { color: rgba(255, 255, 255, .88); max-width: 48ch; }
.promo .btn-secondary { background: #fff; color: var(--brand-700); border-color: #fff; }
.promo .btn-secondary:hover { background: rgba(255, 255, 255, .9); color: var(--brand-800); }

/* ---------------------------------------------------------------
   13. Empty states, skeletons, misc
   --------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
  color: var(--text-muted);
}
.empty .empty-ico {
  width: 76px; height: 76px;
  margin: 0 auto 1.15rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-subtle);
}
.empty h3 { margin-bottom: .4rem; }
.empty p { max-width: 42ch; margin-inline: auto; margin-bottom: 1.5rem; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.divider-text {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.4rem 0;
  color: var(--text-subtle);
  font-size: .84rem;
}
.divider-text::before, .divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-sm { width: 30px; height: 30px; font-size: .7rem; }

.thumb {
  width: 46px; height: 46px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.thumb-lg { width: 64px; height: 64px; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin-top: 2.25rem; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px;
  padding: 0 .6rem;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 600;
  transition: all var(--t-fast);
}
.pagination a:hover { border-color: var(--brand-400); color: var(--brand-600); background: var(--surface-2); }
.pagination .current { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.pagination .disabled { opacity: .45; pointer-events: none; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  font-size: .84rem;
  color: var(--text-subtle);
  margin-bottom: 1.25rem;
  padding: 0;
  list-style: none;
}
.breadcrumb li { display: flex; align-items: center; gap: .4rem; }
.breadcrumb li + li::before { content: "/"; color: var(--border-strong); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb .current { color: var(--text); font-weight: 550; }

/* Stat tile */
.stat {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t), box-shadow var(--t);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-ico {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-50);
  color: var(--brand-600);
  flex-shrink: 0;
}
[data-theme="dark"] .stat-ico { background: rgba(139, 131, 248, .13); color: var(--brand-300); }
.stat-ico.green  { background: rgba(16, 185, 129, .12);  color: var(--success-600); }
.stat-ico.amber  { background: rgba(245, 158, 11, .13);  color: var(--accent-600); }
.stat-ico.red    { background: rgba(239, 68, 68, .12);   color: var(--danger-600); }
.stat-ico.blue   { background: rgba(14, 165, 233, .12);  color: #0369a1; }
[data-theme="dark"] .stat-ico.green { color: #34d399; }
[data-theme="dark"] .stat-ico.amber { color: #fbbf24; }
[data-theme="dark"] .stat-ico.red   { color: #f87171; }
[data-theme="dark"] .stat-ico.blue  { color: #38bdf8; }
.stat-body { min-width: 0; flex: 1; }
.stat-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); }
.stat-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-top: .1rem; }
.stat-meta { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }
.trend { display: inline-flex; align-items: center; gap: .2rem; font-weight: 650; }
.trend.up   { color: var(--success-600); }
.trend.down { color: var(--danger-500); }

/* Timeline */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 1.2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.6rem; top: 5px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border-strong);
}
.timeline-item.done::before { border-color: var(--success-500); background: var(--success-500); }
.timeline-item.active::before { border-color: var(--brand-500); background: var(--brand-500); box-shadow: 0 0 0 4px var(--ring); }
.timeline-item strong { display: block; font-size: .92rem; }
.timeline-item span { font-size: .8rem; color: var(--text-muted); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  transform: translateY(18px) scale(.97);
  transition: transform var(--t-slow);
}
.modal-backdrop.open .modal { transform: none; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 1.08rem; }
.modal-body { padding: 1.5rem; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-lg { max-width: 780px; }

/* Off-canvas cart drawer */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  z-index: 850;
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform var(--t-slow);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
}
.drawer-head h3 { margin: 0; font-size: 1.05rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.35rem; }
.drawer-foot { padding: 1.25rem 1.35rem; border-top: 1px solid var(--border); background: var(--surface); }

/* Cart line */
.cart-line { display: flex; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: 0; }
.cart-line-body { flex: 1; min-width: 0; }
.cart-line-name { font-size: .9rem; font-weight: 600; line-height: 1.35; margin-bottom: .2rem; }
.cart-line-meta { font-size: .8rem; color: var(--text-muted); }

/* Summary rows */
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem 0;
  font-size: .92rem;
  color: var(--text-muted);
}
.summary-row span:last-child { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-row.total {
  padding-top: .85rem;
  margin-top: .5rem;
  border-top: 1px solid var(--border);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
}
.summary-row.total span:last-child { font-size: 1.25rem; font-weight: 800; color: var(--brand-600); letter-spacing: -.02em; }
.summary-row.free span:last-child { color: var(--success-600); }

/* Sticky checkout / order summary */
.sticky-side { position: sticky; top: calc(var(--header-h) + 20px); }

/* ---------------------------------------------------------------
   14. Footer
   --------------------------------------------------------------- */
.site-footer {
  margin-top: 4rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2.5rem;
  padding: 3.25rem 0 2.5rem;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text); margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: var(--brand-600); }
.footer-about p { max-width: 38ch; margin: 1rem 0; }
.footer-social { display: flex; gap: .5rem; }
.footer-social a {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.footer-social a:hover { background: var(--brand-500); border-color: var(--brand-500); color: #fff; transform: translateY(-2px); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--border);
  font-size: .84rem;
}
.pay-methods { display: flex; align-items: center; gap: .5rem; }
.pay-methods span {
  padding: .3rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  font-size: .72rem;
  font-weight: 650;
  background: var(--surface);
}

/* Newsletter */
.newsletter-form { display: flex; gap: .5rem; max-width: 440px; }
.newsletter-form .input { flex: 1; }
@media (max-width: 480px) { .newsletter-form { flex-direction: column; } }

/* ---------------------------------------------------------------
   15. Utilities
   --------------------------------------------------------------- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-danger { color: var(--danger-500); }
.text-success{ color: var(--success-600); }
.text-brand  { color: var(--brand-600); }
.text-sm     { font-size: .85rem; }
.text-xs     { font-size: .76rem; }
.text-lg     { font-size: 1.08rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.mt-0 { margin-top: 0; }    .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; }  .mb-1 { margin-bottom: .5rem; }
.mt-2 { margin-top: 1rem; }   .mb-2 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mb-3 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 2rem; }   .mb-4 { margin-bottom: 2rem; }
.mt-auto { margin-top: auto; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.w-100 { width: 100%; }
.d-none { display: none; }
.d-flex { display: flex; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }

.hide-sm { }
@media (max-width: 720px) { .hide-sm { display: none !important; } }
@media (max-width: 980px) { .hide-md { display: none !important; } }
@media (min-width: 981px) { .show-md { display: none !important; } }

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

.fade-in { animation: fadeIn var(--t-slow) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

@media print {
  .site-header, .site-footer, .no-print, .toast-stack, .drawer, .modal-backdrop { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .panel, .table-wrap { box-shadow: none; border-color: #ccc; }
}
