/* ============================================================
   WOW.ZNAHIDKA — BASE DESIGN SYSTEM
   Premium Dark Sneaker Marketplace
   ============================================================ */

:root {
  /* ── Backgrounds (Luxury Light — Farfetch / Apple Store) ── */
  --bg:        #ffffff;
  --bg2:       #f5f5f7;
  --bg3:       #ebebed;
  --bg4:       #e0e0e2;
  --bg5:       #d5d5d7;
  --bg-glass:  rgba(255,255,255,0.92);
  --bg-card:   #ffffff;

  /* ── Text (Apple Ink) ── */
  --text:        #1d1d1f;
  --text-dim:    rgba(29,29,31,0.60);
  --text-muted:  rgba(29,29,31,0.35);

  /* ── Accents ── */
  --accent:      #1d1d1f;
  --accent-inv:  #ffffff;
  --red:         #C9A84C;
  --red-dim:     rgba(201,168,76,0.08);
  --red-glow:    rgba(201,168,76,0.20);
  --orange:      #ff4500;
  --orange-dim:  rgba(255,69,0,0.08);
  --green:       #00a86b;
  --green-dim:   rgba(0,168,107,0.08);
  --blue:        #0071e3;
  --blue-dim:    rgba(0,113,227,0.08);
  --gold:        #f5a623;

  /* ── Borders ── */
  --border:        rgba(0,0,0,0.07);
  --border-hover:  rgba(0,0,0,0.14);
  --border-accent: rgba(0,0,0,0.22);

  /* ── Shadows ── */
  --shadow-sm:  0 1px 4px  rgba(0,0,0,0.08);
  --shadow:     0 2px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.16);
  --shadow-red: 0 6px 24px rgba(201,168,76,0.22);
  --shadow-glow:0 0 0 1px rgba(0,0,0,0.05);

  /* ── Radius ── */
  --r-xs:   6px;
  --r-sm:   10px;
  --r:      14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 100px;

  /* ── Layout ── */
  --nav-h:       64px;
  --header-h:    58px;
  --gender-h:    44px;
  --max-w:       480px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* ── Transitions ── */
  --ease:      cubic-bezier(.16,1,.3,1);
  --ease-out:  cubic-bezier(.4,0,.6,1);
  --t-fast:    .14s;
  --t-base:    .24s;
  --t-slow:    .4s;

  /* ── Typography Scale ── */
  --fs-xs:   10px;
  --fs-sm:   12px;
  --fs-base: 14px;
  --fs-md:   16px;
  --fs-lg:   20px;
  --fs-xl:   24px;
  --fs-2xl:  30px;
  --fs-3xl:  38px;

  /* ── Font Weights ── */
  --fw-regular:   400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --fw-extrabold: 800;
  --fw-black:     900;

  /* ── Letter Spacing ── */
  --ls-tight:     -0.02em;
  --ls-normal:     0em;
  --ls-wide:       0.04em;
  --ls-wider:      0.08em;
  --ls-ultrawide:  0.14em;

  /* ── Z-Index Scale ── */
  --z-header:  200;
  --z-gender:  201;
  --z-overlay: 300;
  --z-sheet:   301;
  --z-pwa:     400;
  --z-success: 600;
  --z-toast:   9000;
  --z-splash:  9999;

  /* ── Blur ── */
  --blur-sm:  8px;
  --blur-md:  16px;
  --blur-lg:  24px;
  --blur-xl:  40px;

  /* ── Card Shadows (cards float on --bg2 grey canvas) ── */
  --shadow-card:       0 1px 3px rgba(0,0,0,0.05), 0 4px 14px rgba(0,0,0,0.07);
  --shadow-card-hover: 0 6px 28px rgba(0,0,0,0.11), 0 2px 8px rgba(0,0,0,0.05);
  --shadow-card-lift:  0 16px 48px rgba(0,0,0,0.16), 0 4px 12px rgba(0,0,0,0.07);
}

/* ── DESKTOP: widen app to 600px ───────────────── */
@media (min-width: 640px) {
  :root { --max-w: 600px; }
}

/* ── RESET ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
               'Segoe UI', Roboto, Helvetica, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img    { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea { font-family: inherit; -webkit-appearance: none; appearance: none; color: inherit; }
a     { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ── UTILITIES ─────────────────────────────────── */
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── ICON ARROWS (CSS chevrons, inherit currentColor) ── */
.i-arr, .i-arr-lg, .i-arr-back {
  display: inline-block; flex-shrink: 0;
  border-radius: 1.5px; vertical-align: middle;
}
.i-arr {
  width: 6px; height: 6px;
  border-right: 1.8px solid currentColor;
  border-top:   1.8px solid currentColor;
  transform: rotate(45deg) translate(-1px, 1px);
}
.i-arr-lg {
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-top:   2px solid currentColor;
  transform: rotate(45deg) translate(-1px, 1px);
}
.i-arr-back {
  width: 6px; height: 6px;
  border-left: 1.8px solid currentColor;
  border-top:  1.8px solid currentColor;
  transform: rotate(-45deg) translate(1px, 1px);
}

/* ── LOADING SPINNER ───────────────────────────── */
.loading-wrap { display: flex; align-items: center; justify-content: center; padding: 48px; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid rgba(0,0,0,0.08);
  border-top-color: rgba(0,0,0,0.55);
  animation: spin .7s linear infinite;
}

/* ── SKELETON ──────────────────────────────────── */
.skel {
  background: var(--bg3);
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
}
.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg, transparent 0%, rgba(255,255,255,0.52) 50%, transparent 100%
  );
  transform: translateX(-100%);
  animation: skelShimmer 1.6s ease-in-out infinite;
}
.skel-card {
  min-width: 148px; width: 148px;
  background: var(--bg-card); border-radius: var(--r); overflow: hidden; flex-shrink: 0;
  box-shadow: var(--shadow-card);
}
.skel-card.sk-grid { min-width: 0; width: 100%; }
.skel-card-img   { width: 100%; aspect-ratio: 1/1; }
.skel-card-line  { height: 9px;  margin: 11px 11px 5px; }
.skel-card-line2 { height: 12px; margin: 0 11px; }
.skel-card-price { height: 15px; margin: 7px 11px 13px; width: 55%; }

/* ── BADGE ─────────────────────────────────────── */
.badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 17px; height: 17px;
  background: var(--red); color: #fff;
  border-radius: var(--r-full);
  font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}

/* ── TOAST ─────────────────────────────────────── */
#toasts {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 10px);
  left: 50%; transform: translateX(-50%);
  z-index: 9000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  width: 90%; max-width: 360px;
}
.toast {
  background: rgba(29,29,31,0.96);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r);
  padding: 12px 16px;
  font-size: 13px; font-weight: 600; color: #f5f5f7;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
  backdrop-filter: blur(var(--blur-md)); -webkit-backdrop-filter: blur(var(--blur-md));
  animation: toastIn .3s var(--ease), toastOut .3s ease 2.7s forwards;
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  line-height: 1.4;
}
.toast a { color: #ffffff; font-weight: 800; text-decoration: underline; }

/* ── BAGS NICHE STYLES ── */
.niche-fam-section {
  padding: 12px 16px 4px;
  background: var(--bg);
}
.niche-fam-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(255,255,255,0.4));
  margin-bottom: 10px;
}
.niche-fam-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.niche-fam-scroll::-webkit-scrollbar { display: none; }
.niche-fam-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid rgba(201,168,76,0.35);
  background: rgba(201,168,76,0.08);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.niche-fam-chip.active,
.niche-fam-chip:active {
  background: #C9A84C;
  border-color: #C9A84C;
  color: #000;
}
.niche-conc-tag {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
