/* ═══════════════════════════════════════════════════════════════
   KAPGIR PREMIUM — STYLE.CSS
   Mobile-First Premium PWA Marketplace
   Inspired by: Instagram Story, Uzum, Wildberries, Pinterest,
                TikTok Shop, Telegram Mini App, Material You
═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   1. CSS VARIABLES & DESIGN TOKENS
───────────────────────────────────────────── */
:root {
  /* Color Palette - Dark Premium */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-card: #161620;
  --bg-elevated: #1e1e2c;
  --bg-glass: rgba(30, 30, 44, 0.65);
  --bg-glass-strong: rgba(20, 20, 30, 0.85);

  /* Accent — Material You inspired warm tone */
  --accent: #ff6b35;
  --accent-light: #ff8a5b;
  --accent-dark: #e85a28;
  --accent-glow: rgba(255, 107, 53, 0.35);

  /* Secondary accent */
  --accent-2: #6c5ce7;
  --accent-3: #00d4aa;

  /* Status colors */
  --success: #00d4aa;
  --danger: #ff4757;
  --warning: #ffa502;
  --info: #3498db;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #b8b8c8;
  --text-tertiary: #7a7a8c;
  --text-muted: #4a4a5c;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Shadows — Premium depth */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 8px 32px var(--accent-glow);

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-full: 999px;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 16px;
  --gap-xl: 24px;
  --gap-2xl: 32px;

  /* Layout */
  --header-h: 60px;
  --bottom-nav-h: 70px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Transitions */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Gradients */
  --grad-accent: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  --grad-story: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --grad-card: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);
  --grad-bg: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 70%);
}

/* ─────────────────────────────────────────────
   2. RESET & BASE
───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--grad-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
}

img,
video {
  max-width: 100%;
  display: block;
}

button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

input,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

/* ─────────────────────────────────────────────
   3. SCROLLBAR
───────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ─────────────────────────────────────────────
   4. SPLASH SCREEN
───────────────────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  background: var(--grad-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.splash.fade-out {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.1);
}

.splash-content {
  text-align: center;
  animation: splashIn 0.8s var(--t-spring);
}

.splash-logo {
  width: 110px;
  height: 110px;
  margin: 0 auto 24px;
  background: var(--grad-accent);
  border-radius: var(--r-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  animation: pulse 2s ease-in-out infinite;
}

.splash-logo-icon {
  font-size: 60px;
}

.splash-title {
  font-family: 'Manrope', sans-serif;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-subtitle {
  font-size: 11px;
  letter-spacing: 8px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-weight: 600;
}

.splash-loader {
  width: 140px;
  height: 3px;
  background: var(--bg-tertiary);
  margin: 32px auto 0;
  border-radius: var(--r-full);
  overflow: hidden;
}

.splash-loader-bar {
  height: 100%;
  width: 40%;
  background: var(--grad-accent);
  border-radius: var(--r-full);
  animation: loaderSlide 1.2s ease-in-out infinite;
}

@keyframes splashIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 20px transparent; }
}

@keyframes loaderSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ─────────────────────────────────────────────
   5. MODAL OVERLAYS & REGISTRATION
───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap-lg);
  animation: fadeIn 0.3s ease;
}

.register-modal {
  width: 100%;
  max-width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--r-2xl);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s var(--t-spring);
}

.register-header {
  text-align: center;
  margin-bottom: 28px;
}

.register-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.register-header h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
}

.register-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text-primary);
  transition: all var(--t-base);
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-elevated);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--grad-accent);
  color: white;
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--r-md);
  transition: all var(--t-base);
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: scale(0.97); }

.btn-large {
  padding: 18px;
  font-size: 16px;
}

.btn-primary svg {
  width: 20px;
  height: 20px;
}

/* ─────────────────────────────────────────────
   6. APP LAYOUT
───────────────────────────────────────────── */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--header-h) + var(--safe-top));
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
  position: relative;
}

/* ─────────────────────────────────────────────
   7. HEADER
───────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  transition: transform var(--t-base);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  max-width: 600px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--grad-accent);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-sm);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-name {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.logo-tag {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 6px;
}

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--t-base);
  color: var(--text-primary);
}

.header-btn:active {
  transform: scale(0.92);
  background: var(--bg-elevated);
}

.header-btn svg {
  width: 20px;
  height: 20px;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-tertiary);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: var(--accent);
  color: white;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg-primary);
  transition: transform var(--t-spring);
}

.cart-badge.bump {
  animation: cartBump 0.5s var(--t-spring);
}

@keyframes cartBump {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

/* ─────────────────────────────────────────────
   8. PAGES & MAIN
───────────────────────────────────────────── */
.app-main {
  flex: 1;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.page {
  display: none;
  animation: pageIn 0.35s ease;
  padding-bottom: 24px;
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  padding: 16px 16px 8px;
}

.page-title {
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

/* ─────────────────────────────────────────────
   9. STORIES SECTION
───────────────────────────────────────────── */
.stories-wrap {
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.stories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.story-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: 72px;
  scroll-snap-align: start;
}

.story-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 2.5px;
  background: var(--grad-story);
  position: relative;
  transition: transform var(--t-spring);
}

.story-ring.viewed {
  background: var(--bg-tertiary);
}

.story-item:active .story-ring {
  transform: scale(0.9);
}

.story-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-primary);
  padding: 2.5px;
  overflow: hidden;
}

.story-ring-inner img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.story-title {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-skeleton-wrap {
  display: flex;
  gap: 12px;
}

.story-skeleton {
  flex-shrink: 0;
  width: 68px;
  height: 88px;
  background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-elevated) 50%, var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  border-radius: var(--r-lg);
  animation: shimmer 1.5s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─────────────────────────────────────────────
   10. STORY VIEWER
───────────────────────────────────────────── */
.story-viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.story-progress-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 12px;
  padding-top: calc(12px + var(--safe-top));
  z-index: 5;
}

.story-progress {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--r-full);
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  width: 0;
  background: white;
  border-radius: var(--r-full);
  transition: width linear;
}

.story-progress-fill.active {
  animation: storyProgress 5s linear forwards;
}

.story-progress-fill.done {
  width: 100%;
}

@keyframes storyProgress {
  from { width: 0; }
  to { width: 100%; }
}

.story-close {
  position: absolute;
  top: calc(20px + var(--safe-top));
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  color: white;
}

.story-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.story-content img,
.story-content video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-title-bar {
  position: absolute;
  top: calc(36px + var(--safe-top));
  left: 16px;
  z-index: 5;
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.story-nav-left,
.story-nav-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  z-index: 4;
}

.story-nav-left { left: 0; }
.story-nav-right { right: 0; }

/* ─────────────────────────────────────────────
   11. DYNAMIC SECTIONS
───────────────────────────────────────────── */
.dynamic-sections {
  padding: 0;
}

.section {
  margin: 24px 0;
  animation: pageIn 0.4s ease;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 14px;
}

.section-title {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.section-action {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* HERO SECTION */
.section-hero {
  padding: 0 16px;
}

.hero-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.hero-card:active img { transform: scale(1.05); }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.hero-title {
  color: white;
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-meta {
  display: flex;
  gap: 8px;
}

.hero-badge {
  background: var(--grad-accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-full);
}

/* CAROUSEL */
.carousel-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.carousel-scroll .product-card {
  flex-shrink: 0;
  width: 160px;
  scroll-snap-align: start;
}

/* GRID */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

/* LIST */
.list-vertical {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.list-card {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--t-base);
}

.list-card:active { transform: scale(0.98); }

.list-card-img {
  width: 110px;
  height: 110px;
  background: var(--bg-tertiary);
  position: relative;
  flex-shrink: 0;
}

.list-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-card-info {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.list-card-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.list-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─────────────────────────────────────────────
   12. PRODUCT CARD
───────────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  background-image: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
  backdrop-filter: blur(10px);
}

.product-card:active {
  transform: scale(0.97);
}

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

.product-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
  opacity: 0;
}

.product-img.loaded {
  opacity: 1;
}

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

.product-img-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-elevated) 50%, var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

.product-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--r-full);
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  letter-spacing: 0.3px;
}

.badge-material {
  background: var(--grad-accent);
}

.badge-video {
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 3px;
}

.badge-video svg {
  width: 10px;
  height: 10px;
}

.product-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.product-action-btn {
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--t-base);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.product-action-btn:active {
  transform: scale(0.85);
}

.product-action-btn svg {
  width: 16px;
  height: 16px;
}

.product-action-btn.liked {
  background: var(--accent);
  animation: heartPop 0.5s var(--t-spring);
}

.product-action-btn.liked svg {
  fill: white;
}

@keyframes heartPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.product-info {
  padding: 10px 12px 12px;
}

.product-model {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-meta {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.product-meta-item {
  font-size: 10px;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  font-weight: 500;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-size {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-add-cart {
  width: 32px;
  height: 32px;
  background: var(--grad-accent);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--t-base);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-add-cart:active {
  transform: scale(0.85);
}

.btn-add-cart svg {
  width: 16px;
  height: 16px;
}

/* ─────────────────────────────────────────────
   13. SKELETON LOADING
───────────────────────────────────────────── */
.section-skeleton {
  padding: 16px;
}

.skeleton-title {
  height: 24px;
  width: 50%;
  background: var(--bg-tertiary);
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-elevated) 50%, var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.skeleton-card {
  aspect-ratio: 0.75;
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-elevated) 50%, var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

.skeleton-card.large {
  aspect-ratio: 16/10;
}

/* ─────────────────────────────────────────────
   14. BOTTOM NAVIGATION
───────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  max-width: 600px;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
}

.nav-item {
  flex: 1;
  height: var(--bottom-nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-tertiary);
  position: relative;
  transition: color var(--t-base);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform var(--t-spring);
}

.nav-item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

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

.nav-item.active svg {
  transform: translateY(-2px) scale(1.1);
}

.nav-item:active svg {
  transform: scale(0.85);
}

.nav-center {
  position: relative;
}

.nav-center-btn {
  width: 52px;
  height: 52px;
  background: var(--grad-accent);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
  margin-top: -16px;
  transition: all var(--t-spring);
}

.nav-center-btn svg {
  width: 24px;
  height: 24px;
}

.nav-item.nav-center:active .nav-center-btn {
  transform: scale(0.88) rotate(-15deg);
}

/* ─────────────────────────────────────────────
   15. SEARCH PAGE
───────────────────────────────────────────── */
.search-page-header {
  padding: 16px;
  position: sticky;
  top: 0;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  z-index: 50;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 0 14px;
  height: 48px;
  gap: 10px;
  transition: all var(--t-base);
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.search-icon {
  color: var(--text-tertiary);
  width: 20px;
  height: 20px;
}

.search-input-wrap input {
  flex: 1;
  font-size: 15px;
  color: var(--text-primary);
}

.search-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity var(--t-base);
}

.search-clear.visible {
  opacity: 1;
}

.search-clear svg {
  width: 14px;
  height: 14px;
}

.search-results {
  padding: 16px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 24px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ─────────────────────────────────────────────
   16. COLLECTIONS PAGE
───────────────────────────────────────────── */
.collections-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.collection-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--t-base);
}

.collection-card:active {
  transform: scale(0.98);
}

.collection-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.collection-card:hover img {
  transform: scale(1.05);
}

.collection-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.collection-title {
  font-family: 'Manrope', sans-serif;
  color: white;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.collection-desc {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collection-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--r-full);
  width: fit-content;
}

/* ─────────────────────────────────────────────
   17. FAVORITES & PROFILE
───────────────────────────────────────────── */
.profile-header {
  text-align: center;
  padding: 32px 16px 24px;
  position: relative;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  background: var(--grad-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: white;
  box-shadow: var(--shadow-glow);
  border: 3px solid var(--bg-card);
}

.profile-name {
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-phone {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 14px;
}

.btn-edit-profile {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-full);
  color: var(--text-primary);
  transition: all var(--t-base);
}

.btn-edit-profile:active {
  transform: scale(0.95);
  background: var(--bg-elevated);
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 16px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  font-size: 28px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-menu {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-base);
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
}

.profile-menu-item:active {
  transform: scale(0.98);
  background: var(--bg-elevated);
}

.profile-menu-item.danger {
  color: var(--danger);
}

.menu-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.menu-icon svg {
  width: 20px;
  height: 20px;
}

.tg-icon { background: linear-gradient(135deg, #0088cc, #006699); }
.ig-icon { background: linear-gradient(135deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888); }
.yt-icon { background: linear-gradient(135deg, #ff0000, #cc0000); }
.share-icon { background: linear-gradient(135deg, var(--accent-2), #4d3eb5); }
.clear-icon { background: linear-gradient(135deg, var(--danger), #c0392b); }

.profile-menu-item span {
  flex: 1;
}

.menu-arrow {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
}

.profile-footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.profile-footer .version {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.6;
}

/* ─────────────────────────────────────────────
   18. BOTTOM SHEET
───────────────────────────────────────────── */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.25s ease;
}

.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sheet-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  max-height: 88vh;
  overflow-y: auto;
  border-top: 1px solid var(--border-default);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.6);
  animation: sheetUp 0.4s var(--t-spring);
  padding-bottom: var(--safe-bottom);
}

.sheet-content.tall {
  max-height: 92vh;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  margin: 12px auto 8px;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  z-index: 5;
}

.sheet-header {
  padding: 8px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-header h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 800;
}

/* PRODUCT DETAIL */
.product-detail-image {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-info {
  padding: 20px 24px 24px;
}

.product-detail-title {
  font-family: 'Manrope', sans-serif;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.product-detail-material {
  display: inline-block;
  background: var(--grad-accent);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--r-full);
  margin-bottom: 16px;
}

.product-spec-list {
  background: var(--bg-tertiary);
  border-radius: var(--r-lg);
  padding: 4px 16px;
  margin-bottom: 20px;
}

.product-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.product-spec-row:last-child {
  border-bottom: none;
}

.product-spec-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.product-spec-value {
  font-size: 14px;
  font-weight: 600;
}

.product-detail-actions {
  display: flex;
  gap: 10px;
  padding: 0 24px 24px;
}

.btn-secondary {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all var(--t-base);
}

.btn-secondary:active { transform: scale(0.9); }
.btn-secondary.liked { color: var(--accent); border-color: var(--accent); }
.btn-secondary.liked svg { fill: var(--accent); }

.btn-add-to-cart-full {
  flex: 1;
  height: 52px;
  background: var(--grad-accent);
  color: white;
  font-weight: 700;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-glow);
}

/* Eski markaziy video tugmasi olib tashlangan — endi thumbnail orqali ochiladi */
.btn-video-play { display: none !important; }
.video-play-circle { display: none !important; }

/* Video uchun thumbnail tugma (boshqa rasmlar yonida) */
.gallery-thumb-video {
  position: relative;
}
.gallery-thumb-video img {
  filter: brightness(0.55);
}
.thumb-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.thumb-video-play svg {
  width: 22px;
  height: 22px;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}

/* ─────────────────────────────────────────────
   19. CART
───────────────────────────────────────────── */
.cart-body {
  padding: 0 16px;
  min-height: 200px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.cart-item-img {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  transition: all var(--t-base);
}

.qty-btn:active { transform: scale(0.85); background: var(--accent); }

.qty-value {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

.cart-remove {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  flex-shrink: 0;
}

.cart-remove svg {
  width: 16px;
  height: 16px;
}

.cart-footer {
  padding: 16px 24px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  position: sticky;
  bottom: 0;
}

.cart-empty {
  text-align: center;
  padding: 48px 24px;
}

.cart-empty .empty-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

/* ─────────────────────────────────────────────
   20. NEWS / NOTIFICATIONS
───────────────────────────────────────────── */
.news-body {
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-base);
}

.news-card:active {
  transform: scale(0.99);
}

.news-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-body {
  padding: 14px 16px;
}

.news-card-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}

.news-card-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   21. FLOATING TELEGRAM BUTTON
───────────────────────────────────────────── */
.floating-tg {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0088cc, #006699);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 136, 204, 0.45);
  z-index: 90;
  transition: all var(--t-spring);
  animation: floatBob 3s ease-in-out infinite;
}

.floating-tg svg {
  width: 24px;
  height: 24px;
}

.floating-tg:active {
  transform: scale(0.9);
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ─────────────────────────────────────────────
   22. IMAGE / VIDEO VIEWERS
───────────────────────────────────────────── */
.image-viewer,
.video-player {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.image-viewer img {
  max-width: 95%;
  max-height: 90%;
  object-fit: contain;
}

.video-player video {
  max-width: 100%;
  max-height: 100%;
}

.viewer-close {
  position: absolute;
  top: calc(20px + var(--safe-top));
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 5;
}

/* ─────────────────────────────────────────────
   23. PWA INSTALL PROMPT
───────────────────────────────────────────── */
.install-prompt {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
  left: 16px;
  right: 16px;
  max-width: 568px;
  margin: 0 auto;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 95;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s var(--t-spring);
}

.install-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.install-text {
  flex: 1;
  min-width: 0;
}

.install-text h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.install-text p {
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-install {
  background: var(--grad-accent);
  color: white;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.install-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.install-close svg {
  width: 14px;
  height: 14px;
}

/* ─────────────────────────────────────────────
   24. TOAST
───────────────────────────────────────────── */
.toast {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  z-index: 9700;
  opacity: 0;
  transition: all var(--t-spring);
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────────
   25. PULL TO REFRESH
───────────────────────────────────────────── */
.pull-refresh {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 95;
  transition: transform var(--t-base);
  opacity: 0;
}

.pull-refresh.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(10px);
}

.pull-refresh.refreshing {
  opacity: 1;
  transform: translateX(-50%) translateY(10px);
}

.pull-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─────────────────────────────────────────────
   26. RIPPLE EFFECT
───────────────────────────────────────────── */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ─────────────────────────────────────────────
   27. RESPONSIVE
───────────────────────────────────────────── */
@media (min-width: 600px) {
  .products-grid,
  .grid-2 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .products-grid,
  .grid-2 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ═══════════════════════════════════════════════════════════════
   28. v2 ADDITIONS — Search filters, Gallery, Simple Video, Qty
═══════════════════════════════════════════════════════════════ */

/* ───── Search Filters ───── */
.search-filters {
  padding: 0 16px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  align-items: center;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
  margin-right: 2px;
}
.filter-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--r-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  transition: all var(--t-base);
  white-space: nowrap;
}
.filter-chip.small {
  padding: 5px 10px;
  font-size: 12px;
}
.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-chip:active { transform: scale(0.95); }

/* ───── Product Card Qty Control (replaces + button) ───── */
.product-cart-wrap {
  display: inline-flex;
  align-items: center;
}
.card-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--r-full);
  padding: 3px;
  border: 1px solid var(--border-subtle);
}
.card-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-base);
}
.card-qty-btn svg {
  width: 14px;
  height: 14px;
}
.card-qty-btn:active { transform: scale(0.85); }
.card-qty-value {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  padding: 0 2px;
}

/* ───── Product Detail Gallery ───── */
.product-detail-gallery {
  position: relative;
  background: var(--bg-tertiary);
}
.gallery-main {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--bg-tertiary);
}
.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.gallery-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}
/* Thumbnails + dots qatori (rasm OSTIDA) */
.gallery-thumbs-row {
  background: var(--bg-secondary);
  padding: 8px 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.gallery-dots {
  position: relative;
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 4px 0 2px;
}
.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: all var(--t-base);
  border: none;
  padding: 0;
  cursor: pointer;
}
.gallery-dot.active {
  background: #fff;
  width: 22px;
  border-radius: var(--r-full);
}
.gallery-thumbs {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  overflow-x: auto;
  width: 100%;
  justify-content: flex-start;
  background: transparent;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color var(--t-base);
  background: var(--bg-tertiary);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-thumb.active {
  border-color: var(--accent);
}

/* ───── Detail Qty Control ───── */
.detail-qty-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--accent);
  border-radius: var(--r-lg);
  padding: 8px 12px;
  width: 100%;
  min-height: 48px;
}
.detail-qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-base);
}
.detail-qty-btn svg { width: 18px; height: 18px; }
.detail-qty-btn:active { transform: scale(0.88); }
.detail-qty-value {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex: 1;
  text-align: center;
}

/* ───── Simple Video Player ───── */
.video-player.simple {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.97);
}
.video-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-player video {
  max-width: 100%;
  max-height: 100vh;
  background: #000;
  cursor: pointer;
}
.video-play-pause {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, transform var(--t-base);
  z-index: 4;
  opacity: 0;
  pointer-events: auto;
}
.video-wrap:hover .video-play-pause,
.video-wrap:active .video-play-pause,
.video-player.simple video[paused] ~ .video-play-pause {
  opacity: 1;
}
.video-play-pause svg { width: 34px; height: 34px; }
.video-play-pause:active { transform: translate(-50%, -50%) scale(0.92); }
/* Always show on touch devices when paused */
@media (hover: none) {
  .video-play-pause { opacity: 1; }
}

/* ───── Story CTA Button ───── */
.story-cta {
  position: absolute;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--bg-primary);
  border-radius: var(--r-full);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  z-index: 6;
  transition: transform var(--t-base);
}
.story-cta:active { transform: translateX(-50%) scale(0.95); }

/* ───── Stories wrap hidden state ───── */
.stories-wrap.hidden { display: none; }

/* ───── Detail cart wrap stretches ───── */
.detail-cart-wrap {
  display: flex;
  align-items: stretch;
}
.detail-cart-wrap > * {
  width: 100%;
}

/* ───── Product modal must appear ABOVE collection modal ───── */
#productModal { z-index: 8500; }
#cartModal { z-index: 8200; }
#newsModal { z-index: 8200; }
#collectionModal { z-index: 8000; }
