/* ── DESIGN TOKENS ── */
:root {
  --primary: #E31F24;
  --primary-dark: #B91C1C;
  --primary-light: #FEE2E2;
  --flash: #FF6B00;
  --flash-light: #FFF7ED;

  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --text-primary: #1A1A1A;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;

  --success: #16A34A;
  --warning: #D97706;
  --info: #2563EB;
  --danger: #DC2626;

  --font: 'Vazirmatn', sans-serif;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 16px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.07);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.18);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-slow: 400ms;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  direction: rtl;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── LOADER ── */
#loader { transition: opacity 0.4s, visibility 0.4s; }
#loader.hidden { opacity: 0; visibility: hidden; }

/* ── NAVBAR ── */
#navbar { transition: box-shadow var(--dur); }
#navbar.scrolled { box-shadow: var(--shadow); }

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--dur-fast), color var(--dur-fast);
  position: relative;
}
.nav-icon-btn:hover {
  background: #F3F4F6;
  color: var(--text-primary);
}

.badge {
  position: absolute;
  top: -2px;
  left: -2px;
  min-width: 18px;
  height: 18px;
  background: var(--primary);
  color: white;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

/* ── MEGA MENU ── */
.mega-menu-cat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mega-menu-cat h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.mega-menu-cat h3:hover { background: #F3F4F6; }
.mega-menu-cat a {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 8px 4px 28px;
  border-radius: 6px;
  display: block;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.mega-menu-cat a:hover { color: var(--primary); background: var(--primary-light); }

/* ── PRODUCT CARD ── */
.product-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  position: relative;
  cursor: pointer;
  border: 1.5px solid #F0F0F0;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,.10);
  border-color: #E5E7EB;
}
.product-card:hover .card-actions { opacity: 1; transform: translateY(0); }
.product-card:hover .card-img { transform: scale(1.06); }

.card-img-wrap {
  position: relative;
  background: linear-gradient(135deg, #FAFAFA 0%, #F3F4F6 100%);
  overflow: hidden;
}
.card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 14px;
  transition: transform 0.4s var(--ease-out);
}

.card-actions {
  position: absolute;
  bottom: 0; right: 0; left: 0;
  background: linear-gradient(to top, rgba(255,255,255,1) 60%, rgba(255,255,255,0));
  padding: 28px 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.card-body { padding: 14px 14px 12px; flex: 1; display: flex; flex-direction: column; }
.card-brand {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  margin-bottom: 7px;
  width: fit-content;
  letter-spacing: .3px;
}
.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
  flex: 1;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 6px;
}
.stars { color: #FBBF24; font-size: 11px; }
.rating-count { font-size: 11px; color: var(--text-muted); }

.card-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #F3F4F6;
  flex-wrap: wrap;
}
.card-price-original {
  font-size: 11px;
  color: #C4C4C4;
  text-decoration: line-through;
}
.card-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}
.card-price .unit { font-size: 11px; font-weight: 400; color: var(--text-secondary); }

/* Badge column — stacks badges vertically, no overlap possible */
.badge-col {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 3;
  pointer-events: none;
}

.discount-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.flash-badge {
  background: var(--flash);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
  width: fit-content;
}

.new-badge {
  background: var(--success);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

/* Wishlist button — top-RIGHT corner (no conflict with left-positioned badges) */
.wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-fast);
  color: var(--text-muted);
  z-index: 2;
}
.wishlist-btn:hover, .wishlist-btn.active { color: var(--primary); background: var(--primary-light); }
.wishlist-btn.active svg { fill: var(--primary); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  transition: all var(--dur-fast);
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(227,31,36,0.3); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: #F3F4F6; color: var(--text-primary); }
.btn-ghost:hover { background: #E5E7EB; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }

/* ── ADD TO CART BUTTON STATES ── */
.btn-cart { background: var(--primary); color: white; position: relative; overflow: hidden; }
.btn-cart.loading { pointer-events: none; }
.btn-cart.success { background: var(--success); }

/* ── SECTION TITLES ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
  display: block;
}
.section-more {
  font-size: 13px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--dur-fast);
}
.section-more:hover { gap: 8px; }

/* ── HERO CAROUSEL ── */
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  /* 64px horizontal padding keeps content clear of 48px-wide arrow buttons */
  padding: 32px 64px 52px 64px;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  transform: translateX(30px);
}
@media (max-width: 640px) {
  .hero-slide { padding: 24px 52px 48px 52px; }
}
.hero-slide.active {
  opacity: 1;
  transform: translateX(0);
  z-index: 1;
}
.hero-slide.prev {
  opacity: 0;
  transform: translateX(-30px);
  z-index: 0;
}
/* Arrows above slide content, dots above arrows */
#hero-wrap button { z-index: 20; }
#hero-dots { z-index: 15; }

/* ── FLASH SALE ── */
.flash-section { background: linear-gradient(135deg, #FF6B00 0%, #FF3D00 100%); }

.countdown-unit {
  background: rgba(0,0,0,.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-align: center;
  min-width: 48px;
}
.countdown-unit .count {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: white;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown-unit .label { font-size: 10px; color: rgba(255,255,255,.7); }
.countdown-sep { font-size: 20px; font-weight: 800; color: white; margin: 0 2px; line-height: 1; }

.flash-products-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.flash-products-strip::-webkit-scrollbar { display: none; }

.flash-product-card {
  flex-shrink: 0;
  width: 160px;
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: transform var(--dur) var(--ease-out);
}
.flash-product-card:hover { transform: translateY(-4px); }

/* ── BRANDS MARQUEE ── */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
}
.marquee-track {
  display: inline-flex;
  gap: 32px;
  animation: marquee 30s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--dur-fast);
}
.brand-chip:hover { border-color: var(--primary); color: var(--primary); }

/* ── CATEGORY CHIPS ── */
.cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform var(--dur) var(--ease-spring);
}
.cat-chip:hover { transform: translateY(-4px); }
.cat-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: box-shadow var(--dur);
}
.cat-chip:hover .cat-icon { box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.cat-label { font-size: 12px; font-weight: 600; color: var(--text-primary); text-align: center; }

/* ── HOME CATEGORY BAR ── */
.home-cat-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.home-cat-bar::-webkit-scrollbar { display: none; }

.home-cat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 40px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--dur), background var(--dur), transform var(--dur-fast);
  font-family: var(--font);
}
.home-cat-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.home-cat-chip-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.home-cat-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.home-cat-chip-count {
  font-size: 11px;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 1px 7px;
  border-radius: 20px;
}

/* ── HOME PRODUCT STRIP (horizontal scroll per category) ── */
.home-products-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  padding-top: 4px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.home-products-strip::-webkit-scrollbar { display: none; }

.home-product-card {
  flex-shrink: 0;
  width: 206px;
  background: var(--surface);
  border-radius: 16px;
  border: 1.5px solid #F0F0F0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.2s;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.home-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 36px rgba(0,0,0,.09);
  border-color: #E31F2422;
}
.home-product-card:hover .hpc-img { transform: scale(1.06); }
.home-product-card:hover .hpc-add-btn { opacity: 1; transform: translateY(0); }

.hpc-img-wrap {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg,#FAFAFA,#F3F4F6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}
.hpc-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s var(--ease-out);
}
.hpc-add-btn {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 12px 10px;
  background: linear-gradient(to top, rgba(255,255,255,1) 55%, rgba(255,255,255,0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.hpc-add-btn button {
  width: 100%;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.hpc-add-btn button:hover { background: var(--primary-dark); }

.hpc-body {
  padding: 12px 13px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hpc-brand {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.hpc-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 38px;
}
.hpc-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.hpc-rating-count { font-size: 10px; color: var(--text-muted); }
.hpc-price-area {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #F3F4F6;
}
.hpc-orig {
  font-size: 10px;
  color: #C4C4C4;
  text-decoration: line-through;
  display: block;
  margin-bottom: 1px;
}
.hpc-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}

/* ── PRODUCT GRID ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
/* responsive grid overrides handled by js/responsive.js */

/* ── QUANTITY STEPPER ── */
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: #F9FAFB;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
  font-size: 16px;
  font-weight: 700;
}
.qty-btn:hover { background: var(--primary); color: white; }
.qty-val {
  width: 36px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-right: 1.5px solid var(--border);
  border-left: 1.5px solid var(--border);
}

/* ── RATING STARS ── */
.star-filled { color: #FBBF24; }
.star-empty  { color: #E5E7EB; }

/* ── PAGE TRANSITION ── */
#app { transition: opacity 0.25s ease, transform 0.25s ease; }
#app.page-exit { opacity: 0; transform: translateY(-12px); }
#app.page-enter { animation: pageEnter 0.35s var(--ease-out) forwards; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SCROLL REVEAL ANIMATIONS (GSAP controls via inline styles) ── */
#app [data-reveal]:not(.revealed) { opacity: 0; }
[data-reveal].revealed { opacity: 1; }

/* ── FOOTER ITEMS: CSS entrance animation (always readable, no opacity hide) ── */
.footer-item {
  transform: translateY(20px);
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1), opacity 0.6s ease;
  transition-delay: var(--fi-delay, 0s);
  /* opacity stays 1 always — only position animates */
}
#footer.footer-visible .footer-item {
  transform: translateY(0);
  opacity: 1;
}

/* ── ADMIN LAYOUT ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #F0F2F5;
}

.admin-sidebar {
  width: 240px;
  background: #1A1A2E;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform var(--dur-slow) var(--ease-out);
}
.admin-sidebar.collapsed { transform: translateX(240px); }

.admin-sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin: 2px 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  transition: all var(--dur-fast);
  cursor: pointer;
}
.admin-nav-item:hover { color: white; background: rgba(255,255,255,.08); }
.admin-nav-item.active { color: white; background: var(--primary); }
.admin-nav-item .nav-icon { width: 16px; height: 16px; }

.admin-content {
  margin-right: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(240px); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { margin-right: 0; }
}

.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-page { padding: 24px; flex: 1; }

/* ── KPI CARDS ── */
.kpi-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text-primary); }
.kpi-label { font-size: 12px; color: var(--text-secondary); }
.kpi-change { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* ── DATA TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: right;
  padding: 10px 14px;
  background: #F9FAFB;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F3F4F6;
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFAFA; }

/* ── STATUS BADGES ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pending   { background: #FEF3C7; color: #92400E; }
.status-processing { background: #DBEAFE; color: #1E40AF; }
.status-shipped   { background: #EDE9FE; color: #5B21B6; }
.status-delivered { background: #D1FAE5; color: #065F46; }
.status-cancelled { background: #FEE2E2; color: #991B1B; }
.status-active    { background: #D1FAE5; color: #065F46; }
.status-inactive  { background: #F3F4F6; color: #6B7280; }

/* ── FORM ELEMENTS ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.form-input {
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  background: white;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  direction: rtl;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(227,31,36,.12); }
.form-input.error { border-color: var(--danger); }
.form-textarea {
  padding: 10px 12px;
  height: auto;
  resize: vertical;
  min-height: 80px;
}
.form-select {
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: white;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--dur-fast);
}
.form-select:focus { outline: none; border-color: var(--primary); }
.form-error { font-size: 12px; color: var(--danger); }

/* ── MODAL ── */
#modal-overlay { display: none; }
#modal-overlay.show { display: flex; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 700;
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

/* ── TOAST ── */
.toast {
  background: #1A1A2E;
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s var(--ease-out);
  max-width: 320px;
  border-right: 3px solid var(--primary);
}
.toast.success { border-right-color: var(--success); }
.toast.error   { border-right-color: var(--danger); }
.toast.warning { border-right-color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.94) translateY(-6px); } }

/* ── SKELETON LOADER ── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); transition: color var(--dur-fast); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border); }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

/* ── TABS ── */
.tab-bar { display: flex; border-bottom: 2px solid var(--border); gap: 0; }
.tab-item {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; gap: 6px; }
.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--dur-fast);
  cursor: pointer;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ── CHECKOUT STEPS ── */
.checkout-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--dur);
}
.checkout-step.active .step-num { border-color: var(--primary); background: var(--primary); color: white; }
.checkout-step.done .step-num { border-color: var(--success); background: var(--success); color: white; }
.step-line { flex: 1; height: 2px; background: var(--border); }
.checkout-step.done ~ .step-line { background: var(--success); }
.step-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.checkout-step.active .step-label { color: var(--primary); }

/* ── SEARCH SUGGESTION ── */
.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--dur-fast);
  font-size: 13px;
}
.search-suggest-item:hover { background: #F9FAFB; }

/* ── FOOTER SOCIAL ── */
.footer-social {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.6);
  transition: all var(--dur-fast);
}
.footer-social:hover { background: var(--primary); color: white; }

/* ══════════════════════════════════════════
   STORY VIEWER — Digikala / Instagram style
══════════════════════════════════════════ */

.sv-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.88);
  opacity: 0;
  transition: opacity .25s ease;
}
.sv-overlay.sv-visible { opacity: 1; }
.sv-overlay.sv-hiding  { opacity: 0; pointer-events: none; }

.sv-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: pointer;
}

/* ── Phone card ── */
.sv-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  height: 100dvh;
  max-height: 900px;
  background: #0a0a0a;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  box-shadow: 0 32px 80px rgba(0,0,0,.8);
}
@media (min-width: 480px) {
  .sv-card {
    border-radius: 20px;
    height: 92vh;
  }
}

/* ── Media background ── */
.sv-media {
  position: absolute;
  inset: 0;
  bottom: 0;
}
.sv-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .3s ease;
}
.sv-media-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(30px) brightness(.6);
  transform: scale(1.1);
  /* Used as blurred background fallback */
}
.sv-gradient-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 160px;
  background: linear-gradient(to bottom, rgba(0,0,0,.65) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}
.sv-gradient-bot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 340px;
  background: linear-gradient(to top, rgba(0,0,0,.95) 0%, rgba(0,0,0,.4) 60%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

/* ── Progress bars ── */
.sv-bars {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 20;
  pointer-events: none;
}
.sv-bar {
  flex: 1;
  height: 2.5px;
  background: rgba(255,255,255,.3);
  border-radius: 2px;
  overflow: visible;
  display: flex;
  gap: 2px;
}
.sv-bar-fill {
  flex: 1;
  height: 100%;
  background: rgba(255,255,255,.35);
  border-radius: 2px;
  transition: none;
}
.sv-bar-fill.sv-bar-done { background: white !important; width: 100% !important; flex: 1 !important; }
/* Active fill animates via JS width */

/* ── Header ── */
.sv-header {
  position: absolute;
  top: 28px;
  left: 0; right: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}
.sv-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sv-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.sv-store-name {
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.sv-store-sub {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  margin-top: 1px;
}
.sv-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sv-follow-btn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.75);
  color: white;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.sv-follow-btn:hover { background: rgba(255,255,255,.18); }
.sv-close-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  backdrop-filter: blur(6px);
  flex-shrink: 0;
  transition: background .15s;
}
.sv-close-btn:hover { background: rgba(0,0,0,.6); }

/* ── Tap areas ── */
.sv-tap {
  position: absolute;
  top: 70px;
  bottom: 300px;
  width: 38%;
  z-index: 15;
  cursor: pointer;
}
.sv-tap-right { right: 0; }
.sv-tap-left  { left: 0;  }

/* ── Bottom panel ── */
.sv-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px 16px 24px;
  z-index: 20;
}
.sv-info { margin-bottom: 12px; }
.sv-caption {
  font-size: 17px;
  font-weight: 800;
  color: white;
  margin-bottom: 5px;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.sv-subcap {
  font-size: 12px;
  color: rgba(255,255,255,.65);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Reactions ── */
.sv-reactions {
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
  align-items: center;
}
.sv-react-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  background: none;
  transition: transform .15s;
}
.sv-react-btn:active { transform: scale(.9); }
.sv-react-btn.sv-liked svg { fill: #E31F24; stroke: #E31F24; }

/* ── Product strip ── */
.sv-products-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sv-products-strip::-webkit-scrollbar { display: none; }

.sv-prod {
  flex-shrink: 0;
  width: 106px;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  transition: border-color .15s, transform .15s;
}
.sv-prod:hover {
  border-color: rgba(255,255,255,.3);
  transform: translateY(-2px);
}
.sv-prod img {
  width: 100%;
  height: 72px;
  object-fit: contain;
  background: rgba(255,255,255,.05);
  padding: 6px;
  display: block;
}
.sv-prod-name {
  font-size: 10px;
  color: rgba(255,255,255,.8);
  padding: 4px 7px 2px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 28px;
}
.sv-prod-price {
  font-size: 11px;
  color: #FF8080;
  font-weight: 800;
  padding: 2px 7px 4px;
}
.sv-prod-cta {
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: var(--primary);
  text-align: center;
  padding: 5px 0;
}
.sv-no-prod {
  color: rgba(255,255,255,.4);
  font-size: 12px;
  text-align: center;
  width: 100%;
  padding: 8px 0;
}

/* ── No image fallback ── */
.sv-no-img-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  gap: 12px;
}
.sv-no-img-center span {
  font-size: 16px;
  font-weight: 700;
  color: white;
}

/* ── PRICE RANGE SLIDER ── */
.range-slider { appearance: none; width: 100%; height: 4px; border-radius: 2px; background: var(--border); cursor: pointer; }
.range-slider::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); cursor: pointer; }

/* ══════════════════════════════════════════
   STORIES SECTION
══════════════════════════════════════════ */

.stories-wrap {
  background: white;
  border-bottom: 1px solid #F0F0F0;
  padding: 14px 0 4px;
  position: relative;
  width: 100%;
  overflow: hidden;
}

.stories-strip {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 16px 12px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.stories-strip::-webkit-scrollbar { display: none; }

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  flex-shrink: 0;
  width: 72px;
  scroll-snap-align: start;
  transition: transform 0.2s var(--ease-out);
}
.story-item:hover { transform: translateY(-3px); }
.story-item:hover .story-ring { filter: brightness(1.05); }

.story-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  padding: 2.5px;
  transition: transform 0.2s var(--ease-spring), filter 0.2s;
  box-shadow: 0 3px 12px rgba(0,0,0,.12);
  position: relative;
}
.story-ring:active { transform: scale(0.94); }

.story-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: white;
  padding: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-ring-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.story-emoji {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.story-label {
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  text-align: center;
  line-height: 1.35;
  width: 72px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Seen state */
.story-ring.seen {
  background: #D1D5DB !important;
  box-shadow: none;
}

/* Story seen mark on label */
.story-item.seen .story-label { color: var(--text-muted); }

/* Animated gradient border shimmer */
@keyframes story-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.story-ring-animated {
  background-size: 200% 200%;
  animation: story-shimmer 3s ease infinite;
}

@media (max-width: 639px) {
  .story-ring { width: 62px; height: 62px; }
  .story-item { width: 62px; gap: 5px; }
  .story-label { width: 62px; font-size: 10px; }
  .story-emoji { font-size: 22px; }
  .stories-strip { gap: 10px; }
}

/* ══════════════════════════════════════════
   DIGIKALA-STYLE HOME PAGE COMPONENTS
══════════════════════════════════════════ */

/* ── Section Headers (dg-style) ── */
.dg-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.dg-section-bar {
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}
.dg-section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}
.dg-section-more {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  transition: gap var(--dur-fast);
}
.dg-section-more:hover { gap: 8px; }
.dg-cat-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.dg-hot-badge {
  font-size: 11px;
  font-weight: 700;
  background: #FFF7ED;
  color: #C2410C;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #FED7AA;
}
.dg-new-badge {
  font-size: 11px;
  font-weight: 700;
  background: #F0FDF4;
  color: #166534;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #BBF7D0;
}

/* ── Flash Sale Section ── */
.dg-flash-section {
  background: linear-gradient(135deg, #C81D25 0%, #E31F24 50%, #FF4136 100%);
  padding: 20px 0;
  margin: 16px 0 8px;
  position: relative;
  overflow: hidden;
}
.dg-flash-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='white' opacity='0.03'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.dg-flash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dg-flash-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  backdrop-filter: blur(4px);
}
.dg-flash-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,.25);
  margin: 0 4px;
}
.dg-cd-unit {
  background: rgba(0,0,0,.25);
  border-radius: 8px;
  padding: 4px 10px;
  text-align: center;
  min-width: 46px;
  backdrop-filter: blur(4px);
}
.dg-cd-num {
  display: block;
  font-size: 20px;
  font-weight: 900;
  color: white;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.dg-cd-lbl { font-size: 9px; color: rgba(255,255,255,.7); }
.dg-cd-sep { font-size: 18px; font-weight: 900; color: rgba(255,255,255,.7); margin: 0 2px; }
.dg-flash-more {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.12);
  padding: 7px 14px;
  border-radius: 20px;
  transition: background var(--dur-fast), gap var(--dur-fast);
  white-space: nowrap;
}
.dg-flash-more:hover { background: rgba(255,255,255,.22); gap: 8px; }

/* Flash product cards */
.dg-flash-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.dg-flash-strip::-webkit-scrollbar { display: none; }
.dg-flash-card {
  flex-shrink: 0;
  width: 150px;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur);
}
.dg-flash-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.15); }
.dg-flash-card-img {
  height: 130px;
  background: linear-gradient(135deg,#FAFAFA,#F3F4F6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
  overflow: hidden;
}
.dg-flash-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s var(--ease-out);
}
.dg-flash-card:hover .dg-flash-card-img img { transform: scale(1.08); }
.dg-flash-disc {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
}
.dg-flash-card-body { padding: 10px 11px 12px; }
.dg-flash-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 33px;
  margin-bottom: 8px;
}
.dg-flash-prices { margin-bottom: 6px; }
.dg-flash-orig {
  font-size: 10px;
  color: #C4C4C4;
  text-decoration: line-through;
  display: block;
}
.dg-flash-price {
  font-size: 13px;
  font-weight: 900;
  color: var(--primary);
}
.dg-flash-bar-wrap {
  height: 3px;
  background: #F3F4F6;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}
.dg-flash-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--flash), var(--primary));
  border-radius: 2px;
  transition: width 1s ease;
}
.dg-flash-stock { font-size: 9px; color: #EF4444; font-weight: 600; }

/* ── Promo Banner Grid (3 tiles) ── */
.dg-promo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.dg-promo-tile {
  position: relative;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur);
}
.dg-promo-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.dg-promo-tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  transition: transform 0.5s var(--ease-out), opacity 0.3s;
}
.dg-promo-tile:hover .dg-promo-tile-img { transform: scale(1.06); opacity: 0.45; }
.dg-promo-tile-body {
  position: relative;
  padding: 20px 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.dg-promo-label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dg-promo-title {
  font-size: 20px;
  font-weight: 900;
  color: white;
  line-height: 1.3;
  margin-bottom: 14px;
}
.dg-promo-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
  transition: transform var(--dur-fast);
}
.dg-promo-tile:hover .dg-promo-btn { transform: translateX(-3px); }

/* ── Wide Mid Banner ── */
.dg-wide-banner {
  position: relative;
  height: 170px;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%);
}
.dg-wide-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  transition: transform 0.5s var(--ease-out);
}
.dg-wide-banner:hover .dg-wide-banner-img { transform: scale(1.04); opacity: 0.35; }
.dg-wide-banner-body {
  position: relative;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
}
.dg-wide-banner-tag {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dg-wide-banner-title {
  font-size: 28px;
  font-weight: 900;
  color: white;
  margin-bottom: 4px;
}
.dg-wide-banner-sub {
  font-size: 13px;
  color: rgba(255,255,255,.65);
}

/* ── Trust Badges ── */
.dg-trust-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.dg-trust-item {
  background: white;
  border-radius: 14px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #F0F0F0;
  transition: box-shadow var(--dur), transform var(--dur-fast);
}
.dg-trust-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.dg-trust-icon { font-size: 28px; flex-shrink: 0; }
.dg-trust-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.dg-trust-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }

@media (max-width: 1023px) {
  .dg-trust-grid { grid-template-columns: repeat(3, 1fr); }
  .dg-promo-grid { grid-template-columns: repeat(2, 1fr); }
  .dg-promo-grid .dg-promo-tile:last-child { display: none; }
}
@media (max-width: 767px) {
  .dg-trust-grid { grid-template-columns: repeat(2, 1fr); }
  .dg-promo-grid { grid-template-columns: repeat(2, 1fr); }
  .dg-flash-section { margin: 12px 0 6px; }
  .dg-flash-card { width: 134px; }
  .dg-flash-card-img { height: 110px; }
  .dg-promo-tile { height: 150px; }
  .dg-promo-title { font-size: 16px; }
  .dg-wide-banner { height: 140px; }
  .dg-wide-banner-title { font-size: 22px; }
  .dg-wide-banner-body { padding: 20px 24px; }
}
@media (max-width: 639px) {
  .dg-trust-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dg-promo-grid { grid-template-columns: 1fr; }
  .dg-promo-grid .dg-promo-tile:not(:first-child) { display: none; }
  .dg-promo-tile { height: 130px; }
  .dg-flash-header { flex-wrap: wrap; gap: 10px; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — mobile-first overrides
   Breakpoints: 1024 | 768 | 640 | 480
══════════════════════════════════════════ */

/* ── < 1024px  (tablet + mobile) ── */
@media (max-width: 1023px) {

  /* Sidebar filter — hidden by default, shown when JS adds .mobile-open */
  #filter-sidebar { display: none !important; }
  #filter-sidebar.mobile-open {
    display: block !important;
    position: fixed;
    top: 56px; right: 0; bottom: 0;
    width: min(300px, 88vw);
    z-index: 200;
    overflow-y: auto;
    background: white;
    box-shadow: -4px 0 24px rgba(0,0,0,.2);
    border-left: 1px solid var(--border);
  }

  /* Dark overlay behind filter sidebar */
  .mobile-filter-overlay {
    position: fixed !important;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 199;
  }

  /* Product detail gallery: remove sticky on non-desktop */
  .product-sticky-gallery { position: static !important; }

  /* Product grid: 3 cols on tablet */
  .products-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ── < 768px  (mobile & small tablet) ── */
@media (max-width: 767px) {

  /* Footer top info bar: 2-col */
  #footer .grid { grid-template-columns: 1fr 1fr !important; }

  /* Profile layout: stack */
  .profile-layout { grid-template-columns: 1fr !important; }
  .profile-sidebar { position: static !important; }

  /* Hero: keep content clear of arrow buttons (buttons = right/left-3 + w-9 = 48px from edge) */
  .hero-slide { padding: 18px 56px 40px 56px !important; }
  #hero-wrap { height: 290px !important; }

  /* Hero side-banners already hidden (hidden lg:flex) */

  /* Admin sidebar: hidden by default on mobile */
  .admin-sidebar { transform: translateX(240px); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { margin-right: 0 !important; }
}

/* ── < 640px  (small mobile) ── */
@media (max-width: 639px) {

  /* Containers */
  .container { padding: 0 12px; }
  .section { padding: 20px 0; }

  /* Products grid: 2 cols on small mobile */
  .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }

  /* Hero: smaller */
  .hero-slide { padding: 14px 52px 38px 52px !important; }
  #hero-wrap { height: 265px !important; }

  /* Hero text sizes */
  .hero-container h1 { font-size: 1.1rem !important; line-height: 1.35 !important; }
  .hero-container p   { font-size: 0.72rem !important; }
  .hero-container .btn { font-size: 0.75rem !important; padding: 8px 14px !important; }

  /* Flash sale */
  .flash-section { padding: 14px 0 !important; }
  .countdown-unit { padding: 3px 6px; min-width: 36px; }
  .countdown-unit .count { font-size: 17px; }
  .countdown-sep { font-size: 16px; }
  .flash-product-card { width: 140px; }

  /* Category chips */
  .cat-icon { width: 52px !important; height: 52px !important; font-size: 21px; }
  .cat-label { font-size: 11px; }

  /* Product cards */
  .card-body { padding: 10px; }
  .card-title { font-size: 12px; min-height: 36px; }
  .card-brand { font-size: 10px; }
  .card-price { font-size: 13px; }
  .card-price-original { font-size: 10px; }
  .home-product-card { width: 180px; }
  .hpc-img-wrap { height: 145px; }

  /* Mid banner: smaller */
  .mid-banner { height: 130px !important; }

  /* Sort dropdown */
  .products-filter-bar select { min-width: 100px !important; font-size: 12px; padding-left: 24px; }
}

/* ── < 480px  (very small phones) ── */
@media (max-width: 479px) {

  /* Container tighter */
  .container { padding: 0 8px; }

  /* Footer: single col */
  #footer .grid { grid-template-columns: 1fr !important; }

  /* Hero even smaller */
  .hero-slide { padding: 12px 50px 36px 50px !important; }
  #hero-wrap { height: 250px !important; }

  /* Product card even more compact */
  .card-body { padding: 6px; }

  /* Countdown smallest */
  .countdown-unit { padding: 2px 5px; min-width: 32px; }
  .countdown-unit .count { font-size: 15px; }

  /* Category chips smallest */
  .cat-icon { width: 46px !important; height: 46px !important; font-size: 18px; }

  /* Product detail image smaller */
  .product-main-img-wrap { height: 240px !important; }

  /* Navbar logo smaller */
  #navbar .text-2xl { font-size: 1.2rem !important; }
}

/* ── < 360px  (Galaxy Z Fold outer + very narrow phones) ── */
@media (max-width: 359px) {

  /* Tightest container */
  .container { padding: 0 6px; }

  /* Navbar: very compact */
  #navbar .max-w-screen-xl { gap: 6px !important; padding-right: 8px !important; padding-left: 8px !important; }
  #navbar a span { font-size: 1rem !important; }

  /* Hero: fit narrow screen — hide arrows, use smaller padding */
  #hero-wrap { height: 230px !important; }
  .hero-slide { padding: 12px 14px 36px 14px !important; }
  #hero-prev, #hero-next { display: none !important; }

  /* Category chips: 3 columns on very narrow */
  .container.section[data-reveal="stagger-up"] { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .cat-icon { width: 44px !important; height: 44px !important; font-size: 18px !important; }
  .cat-label { font-size: 10px; }

  /* Flash countdown: inline tight */
  .countdown-unit { padding: 2px 4px; min-width: 28px; }
  .countdown-unit .count { font-size: 13px; }
  .countdown-sep { font-size: 13px; margin: 0; }

  /* Products grid: 2 small cols */
  .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; }

  /* Product cards: compact on tiny screens */
  .card-img { padding: 8px; }
  .card-body { padding: 8px 8px 6px; }
  .card-title { font-size: 11px; min-height: 32px; }
  .card-price { font-size: 12px; }
  .card-brand { font-size: 9px; padding: 1px 5px; }
  .card-rating { margin: 4px 0 3px; }

  /* Home strip cards: narrower */
  .home-product-card { width: 158px; }
  .hpc-img-wrap { height: 130px; }
  .hpc-title { font-size: 11px; height: 33px; }
  .hpc-price { font-size: 12px; }

  /* Flash strip cards */
  .flash-product-card { width: 120px; }

  /* Mid banner: smaller */
  .mid-banner { height: 110px !important; }
  .mid-banner .text-2xl { font-size: 1.2rem !important; }
  .mid-banner .btn { font-size: 11px !important; padding: 6px 10px !important; }

  /* Section headers */
  .section-title { font-size: 15px; }
  .section { padding: 14px 0; }
}

/* ── AUTH MODAL ── */
#auth-modal { transition: opacity 0.25s var(--ease-out); }
#auth-modal.show { display: block !important; }
#auth-box {
  animation: authBoxIn 0.35s var(--ease-spring) forwards;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes authBoxIn {
  from { opacity: 0; transform: translate(50%, -50%) scale(0.9); }
  to   { opacity: 1; transform: translate(50%, -50%) scale(1); }
}

.auth-tab-btn {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: all var(--dur-fast);
  text-align: center;
}
.auth-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-light); }
.auth-tab-btn:hover:not(.active) { color: var(--text-primary); background: #F9FAFB; }

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  background: white;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  direction: rtl;
}
.auth-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(227,31,36,.1); }
.auth-input.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }

.auth-input-wrap { position: relative; }
.auth-input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px; height: 18px;
}
.auth-input-action {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--dur-fast);
}
.auth-input-action:hover { color: var(--text-primary); }

.auth-error-msg {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-login-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
  cursor: pointer;
  flex: 1;
  justify-content: center;
}
.quick-login-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ── PROFILE LAYOUT ── */
.profile-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) { .profile-layout { grid-template-columns: 1fr; } }

.profile-sidebar {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 120px;
}

.profile-sidebar-user {
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-align: center;
}

.profile-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 800;
  margin: 0 auto 10px;
  border: 3px solid rgba(255,255,255,.3);
}

.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast);
  border-right: 3px solid transparent;
}
.profile-nav-item:hover { background: #F9FAFB; color: var(--text-primary); }
.profile-nav-item.active { background: var(--primary-light); color: var(--primary); border-right-color: var(--primary); }
.profile-nav-item.danger:hover { background: #FEF2F2; color: var(--danger); }

.profile-main {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.profile-main-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-main-body { padding: 24px; }

/* ── PROFILE STATS CARDS ── */
.profile-stat-card {
  background: linear-gradient(135deg, #F9FAFB 0%, white 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

/* ── ADDRESS CARD ── */
.address-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.address-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(227,31,36,.08); }
.address-card.default-addr { border-color: var(--primary); background: var(--primary-light); }
.address-card .addr-actions { display: none; gap: 6px; }
.address-card:hover .addr-actions { display: flex; }

/* ── ADMIN CONTENT TAB ── */
.admin-content-tab {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
  cursor: pointer;
}
.admin-content-tab.active { background: var(--primary); color: white; }
.admin-content-tab:hover:not(.active) { background: #F3F4F6; color: var(--text-primary); }

/* ── SLIDE PREVIEW (hero editor) ── */
.slide-preview-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--dur-fast);
}
.slide-preview-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }

/* ── COUPON TABLE ── */
.coupon-row-active { background: #F0FDF4; }
.coupon-row-inactive { opacity: 0.6; }

/* ── UTILITY ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.section { padding: 32px 0; }
.divider { height: 1px; background: var(--border); margin: 0; }
.text-price { font-variant-numeric: tabular-nums; }
.bg-surface { background: var(--surface); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
