/* =====================================================
   NEXORA – استایل‌های اصلی فروشگاه (Update 1)
   فهرست:
   ۱. فونت و متغیرها        ۲. پایه و ابزارها
   ۳. دکمه‌ها               ۴. هدر و منو
   ۵. بخش معرفی             ۶. عنوان بخش‌ها
   ۷. دسته‌بندی‌ها          ۸. کارت محصول
   ۹. پیشنهاد ویژه          ۱۰. درباره ما
   ۱۱. نظرات                ۱۲. فوتر و Toast
   ۱۳. انیمیشن‌ها           ۱۴. واکنش‌گرا
   ===================================================== */

/* ---------- ۱. فونت و متغیرها ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* رنگ‌ها */
  --bg: #0b0b14;
  --bg-alt: #0f0f1a;
  --card: #14141f;
  --card-2: #1a1a28;
  --border: #26263a;
  --purple: #8b5cf6;
  --purple-neon: #a78bfa;
  --purple-deep: #6d28d9;
  --text: #ffffff;
  --muted: #a1a1b5;
  --success: #22c55e;
  --warning: #fbbf24;
  --danger: #f87171;

  /* شکل و سایه */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --glow: 0 0 0 1px rgba(139, 92, 246, .45), 0 10px 40px rgba(139, 92, 246, .22);

  --header-h: 72px;
  --ease: cubic-bezier(.22, .8, .3, 1);
}

/* ---------- ۲. پایه و ابزارها ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }

.icon {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.text-gradient {
  background: linear-gradient(90deg, #c4b5fd, #8b5cf6 60%, #a78bfa);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.skip-link {
  position: absolute; top: -60px; right: 16px; z-index: 200;
  background: var(--purple); color: #fff; padding: 8px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--purple-neon); outline-offset: 3px; border-radius: 6px; }

.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid #181826; }

/* ---------- ۳. دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s, color .25s;
}
.btn .icon { width: 19px; height: 19px; }
.btn:active { transform: translateY(1px) scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff;
  box-shadow: 0 6px 20px rgba(109, 40, 217, .35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(139, 92, 246, .5); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--purple); color: var(--purple-neon); background: rgba(139, 92, 246, .08); }

.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; box-shadow: none; transform: none;
  background: var(--card-2); color: var(--muted); border-color: var(--border);
}

/* ---------- ۴. هدر و منو ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(11, 11, 20, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled {
  background: rgba(11, 11, 20, .92);
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 28px; }

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-text { font-size: 22px; font-weight: 800; letter-spacing: 2px; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 8px; }
.nav-link {
  position: relative; padding: 8px 14px; border-radius: 10px;
  color: var(--muted); font-size: 15px; font-weight: 500;
  transition: color .25s, background .25s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav-link.is-active { color: var(--purple-neon); background: rgba(139, 92, 246, .12); }

.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }

.cart-btn, .menu-toggle {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
.cart-btn:hover, .menu-toggle:hover { border-color: var(--purple); box-shadow: 0 0 20px rgba(139, 92, 246, .25); }
.cart-btn.bump { animation: bump .35s var(--ease); }

.cart-count {
  position: absolute; top: -6px; inset-inline-start: -6px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--purple); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 12px rgba(139, 92, 246, .7);
}

.menu-toggle { display: none; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- ۵. بخش معرفی ---------- */
.hero { position: relative; padding: 64px 0 40px; overflow: hidden; }
.hero-glow {
  position: absolute; inset: -20% -10% auto auto; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .22), transparent 65%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: rgba(139, 92, 246, .12); color: var(--purple-neon);
  border: 1px solid rgba(139, 92, 246, .3);
}
.chip .icon { width: 17px; height: 17px; }

.hero h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.5; font-weight: 800; margin: 18px 0 16px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 520px; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-visual img { width: 100%; max-width: 560px; margin-inline: auto; animation: float 7s ease-in-out infinite; }

/* نوار مزایا */
.trust-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 28px;
}
.trust-item {
  display: flex; align-items: center; gap: 14px; padding: 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .3s, transform .3s var(--ease);
}
.trust-item:hover { border-color: rgba(139, 92, 246, .5); transform: translateY(-3px); }
.trust-item .icon { width: 34px; height: 34px; color: var(--purple-neon); padding: 6px; background: rgba(139, 92, 246, .12); border-radius: 10px; box-sizing: content-box; }
.trust-item strong { display: block; font-size: 15px; font-weight: 700; }
.trust-item span { color: var(--muted); font-size: 13px; }

/* ---------- ۶. عنوان بخش‌ها ---------- */
.section-head { margin-bottom: 34px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; position: relative; padding-inline-start: 18px; }
.section-head h2::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 10%; bottom: 10%; width: 5px; border-radius: 4px;
  background: linear-gradient(var(--purple-neon), var(--purple-deep));
  box-shadow: 0 0 14px rgba(139, 92, 246, .6);
}
.section-head p { color: var(--muted); margin-top: 6px; padding-inline-start: 18px; }

/* ---------- ۷. دسته‌بندی‌ها ---------- */
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.category-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 26px 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.category-card:hover { transform: translateY(-6px); border-color: rgba(139, 92, 246, .6); box-shadow: var(--glow); }
.category-icon {
  width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px;
  background: linear-gradient(145deg, rgba(139, 92, 246, .22), rgba(109, 40, 217, .08));
  color: var(--purple-neon); border: 1px solid rgba(139, 92, 246, .25);
  transition: transform .3s var(--ease), background .3s;
}
.category-icon .icon { width: 30px; height: 30px; }
.category-card:hover .category-icon { transform: scale(1.08) rotate(-4deg); background: linear-gradient(145deg, var(--purple), var(--purple-deep)); color: #fff; }
.category-card h3 { font-size: 15px; font-weight: 700; line-height: 1.6; }
.category-card span { font-size: 13px; color: var(--muted); }

/* ---------- ۸. کارت محصول ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
}
.product-card:hover { transform: translateY(-6px); border-color: rgba(139, 92, 246, .55); box-shadow: var(--glow); }

.product-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #12121c; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.product-card:hover .product-media img { transform: scale(1.06); }

.badge {
  position: absolute; top: 12px; z-index: 2; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.7;
}
.badge-discount { inset-inline-start: 12px; background: linear-gradient(135deg, var(--purple), var(--purple-deep)); color: #fff; box-shadow: 0 0 16px rgba(139, 92, 246, .55); }
.badge-rank { inset-inline-end: 12px; min-width: 34px; text-align: center; background: rgba(11, 11, 20, .8); color: var(--purple-neon); border: 1px solid rgba(139, 92, 246, .45); font-size: 14px; }

.product-body { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.product-cat { font-size: 12px; color: var(--purple-neon); font-weight: 500; }
.product-name {
  font-size: 15px; font-weight: 700; line-height: 1.8;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 3.6em;
}
.product-rating { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.product-rating .icon { width: 16px; height: 16px; fill: var(--warning); stroke: var(--warning); }

.price-box { margin-top: auto; padding-top: 4px; min-height: 62px; display: flex; flex-direction: column; justify-content: flex-end; }
.price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.price { font-size: 18px; font-weight: 800; }
.price small { font-size: 12px; font-weight: 500; color: var(--muted); margin-inline-start: 4px; }

.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.stock-in { color: var(--success); }
.stock-low { color: var(--warning); }
.stock-out { color: var(--danger); }

.card-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
.card-actions .btn { padding: 9px 12px; font-size: 14px; }
.product-card.is-out .product-media img { filter: grayscale(.8) brightness(.7); }

/* ---------- ۹. پیشنهادهای ویژه ---------- */
.offer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.offer-grid .product-card {
  border-color: rgba(139, 92, 246, .35);
  background: linear-gradient(180deg, #181826, var(--card));
}
.offer-grid .product-card .price { font-size: 20px; color: var(--purple-neon); }

/* ---------- ۱۰. درباره ما ---------- */
.about-inner { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 56px; }
.about-visual img {
  width: 100%; border-radius: 24px; border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(109, 40, 217, .22);
}
.about-content h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; margin-bottom: 14px; }
.about-content > p { color: var(--muted); }
.check-list { margin-top: 22px; display: grid; gap: 12px; }
.check-list li { display: flex; align-items: flex-start; gap: 12px; color: #e6e6f2; }
.check-list .icon {
  width: 26px; height: 26px; padding: 4px; margin-top: 2px; border-radius: 50%;
  background: rgba(34, 197, 94, .15); color: var(--success); stroke-width: 2.4; box-sizing: border-box;
}

/* ---------- ۱۱. نظرات ---------- */
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.testimonial-card {
  display: flex; flex-direction: column; gap: 16px; padding: 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .3s var(--ease), border-color .3s;
}
.testimonial-card:hover { transform: translateY(-4px); border-color: rgba(139, 92, 246, .5); }
.stars { display: flex; gap: 3px; }
.stars .icon { width: 18px; height: 18px; fill: var(--warning); stroke: var(--warning); }
.stars .icon.off { fill: none; stroke: #4b4b63; }
.testimonial-card blockquote { margin: 0; color: #dcdce9; font-size: 15px; line-height: 2; flex: 1; }
.testimonial-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--purple), var(--purple-deep)); font-weight: 700;
}
.testimonial-user strong { display: block; font-size: 15px; }
.testimonial-user span { font-size: 13px; color: var(--muted); }

/* ---------- ۱۲. فوتر و Toast ---------- */
.site-footer { background: #08080f; border-top: 1px solid var(--border); margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 36px; padding: 60px 0 40px; }
.footer-brand p { margin-top: 14px; font-size: 14px; }
.footer-brand p:nth-of-type(1) { color: var(--purple-neon); font-weight: 600; }
.footer-col h4 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.footer-col li { margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.footer-col li a { transition: color .25s, padding .25s; }
.footer-col li a:hover { color: var(--purple-neon); }
.footer-col:not(.footer-brand) li a:hover { padding-inline-start: 4px; }
.contact-list li { display: flex; align-items: flex-start; gap: 10px; }
.contact-list .icon { width: 19px; height: 19px; color: var(--purple-neon); margin-top: 4px; }

.footer-bottom { border-top: 1px solid #181826; padding: 18px 0; font-size: 13px; }
.footer-bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 300;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 22px; border-radius: 14px;
  background: var(--card-2); color: var(--text); font-size: 14px;
  border: 1px solid rgba(139, 92, 246, .5); box-shadow: var(--glow);
  transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- ۱۳. انیمیشن‌ها ---------- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ظاهر شدن نرم هنگام اسکرول (فقط وقتی JS فعال است) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- ۱۴. واکنش‌گرا ---------- */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .trust-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .section { padding: 60px 0; }

  /* منوی موبایل */
  .menu-toggle { display: grid; }
  .main-nav {
    position: fixed; top: var(--header-h); inset-inline: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 14px 20px 20px;
    background: rgba(11, 11, 20, .97); border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity .3s, transform .3s var(--ease), visibility .3s;
  }
  .main-nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav-link { padding: 12px 14px; font-size: 16px; }

  .hero { padding-top: 36px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-inline: auto; }
  .hero-buttons { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-visual img { max-width: 380px; }

  .offer-grid, .testimonial-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 28px); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .offer-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .testimonial-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 44px; }
  .trust-strip { gap: 10px; }
  .trust-item { padding: 12px; gap: 10px; flex-direction: column; text-align: center; }

  .product-body { padding: 12px; gap: 6px; }
  .product-name { font-size: 13.5px; }
  .price { font-size: 15px; }
  .offer-grid .product-card .price { font-size: 16px; }
  .card-actions .btn { font-size: 13px; padding: 8px 6px; }
  .btn-lg { padding: 12px 20px; font-size: 15px; }
  .logo-text { font-size: 20px; }
}

@media (max-width: 340px) {
  .product-grid, .offer-grid { grid-template-columns: 1fr; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-item { flex-direction: row; text-align: start; }
}

/* =====================================================
   Update 2 – جست‌وجو، فیلتر، جزئیات محصول و سبد خرید
   ===================================================== */

body.no-scroll { overflow: hidden; }
.badge[hidden] { display: none; }

/* ---------- نوار ابزار: جست‌وجو و مرتب‌سازی ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }

.search-box { position: relative; flex: 1 1 280px; display: flex; align-items: center; }
.search-box .icon { position: absolute; inset-inline-start: 14px; color: var(--muted); pointer-events: none; }
.search-box input,
.select-box select {
  width: 100%; height: 48px; font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .25s, box-shadow .25s;
}
.search-box input { padding: 0 46px 0 16px; padding-inline: 46px 16px; }
.search-box input::placeholder { color: #6e6e86; }
.search-box input:focus,
.select-box select:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, .2); }

.select-box { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.select-box label { font-size: 14px; color: var(--muted); white-space: nowrap; }
.select-box select {
  width: 200px; padding: 0 14px 0 36px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1b5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; background-size: 18px;
}
.select-box option { background: var(--card-2); color: var(--text); }

/* ---------- دکمه‌های دسته‌بندی ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  background: var(--card); color: var(--muted); border: 1px solid var(--border);
  transition: color .25s, border-color .25s, background .25s, box-shadow .25s;
}
.chip-btn small { font-size: 12px; opacity: .75; }
.chip-btn:hover { color: var(--text); border-color: rgba(139, 92, 246, .6); }
.chip-btn[aria-pressed="true"] {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  box-shadow: 0 4px 18px rgba(109, 40, 217, .4);
}

.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 4px 6px; font-family: inherit; font-size: 14px; color: var(--purple-neon); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn[hidden] { display: none; }

.empty-state {
  grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 60px 20px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted);
}
.empty-state .icon { width: 44px; height: 44px; color: var(--purple-neon); }
.empty-state strong { color: var(--text); font-size: 17px; }

/* نشان «در سبد» روی کارت محصول */
.badge-cart {
  top: auto; bottom: 12px; inset-inline-start: 12px;
  background: rgba(34, 197, 94, .15); color: var(--success); border: 1px solid rgba(34, 197, 94, .45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* ---------- لایه تیره و دکمه آیکونی ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 150; background: rgba(5, 5, 10, .72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.overlay.show { opacity: 1; visibility: visible; }

.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; cursor: pointer;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--border); border-radius: 10px;
  transition: color .25s, border-color .25s, background .25s;
}
.icon-btn:hover { color: var(--text); border-color: var(--purple); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: rgba(248, 113, 113, .08); }

/* ---------- کشوی سبد خرید ---------- */
.cart-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 160; width: min(440px, 100%);
  display: flex; flex-direction: column; background: var(--bg-alt);
  border-right: 1px solid var(--border); box-shadow: 20px 0 60px rgba(0, 0, 0, .5);
  transform: translateX(-102%); visibility: hidden;
  transition: transform .4s var(--ease), visibility .4s;
}
.cart-drawer.open { transform: none; visibility: visible; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 19px; font-weight: 800; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; overscroll-behavior: contain; }
.drawer-foot { padding: 16px 20px 20px; border-top: 1px solid var(--border); background: var(--card); }

.cart-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; color: var(--muted); padding: 20px; }
.cart-empty .icon { width: 54px; height: 54px; color: var(--purple-neon); opacity: .8; }
.cart-empty strong { color: var(--text); font-size: 17px; }

.cart-list { display: grid; gap: 14px; }
.cart-item {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: start;
  padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
}
.cart-item img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; background: #12121c; }
.cart-item-name { font-size: 14px; font-weight: 700; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item-unit { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cart-item-unit s { margin-inline-start: 6px; opacity: .8; }
.cart-item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.cart-item-total { font-size: 14px; font-weight: 800; white-space: nowrap; }
.cart-item-total small { font-size: 11px; font-weight: 500; color: var(--muted); margin-inline-start: 3px; }

.qty { display: inline-flex; align-items: center; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty button {
  width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer;
  background: none; border: 0; color: var(--text); transition: background .2s, color .2s;
}
.qty button .icon { width: 16px; height: 16px; }
.qty button:hover:not(:disabled) { background: rgba(139, 92, 246, .2); color: var(--purple-neon); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty span { min-width: 30px; text-align: center; font-size: 14px; font-weight: 700; }

.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); padding: 4px 0; }
.summary-row.saving { color: var(--success); }
.summary-row.total { margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--text); font-size: 16px; font-weight: 800; }
.summary-row.total .amount { font-size: 20px; color: var(--purple-neon); }
.summary-row small { font-size: 12px; font-weight: 500; color: var(--muted); margin-inline-start: 4px; }
.summary-actions { display: grid; gap: 8px; margin-top: 14px; }
.summary-actions .btn { width: 100%; }

/* ---------- پنجره جزئیات محصول ---------- */
.modal {
  position: fixed; top: 50%; left: 50%; z-index: 170; width: min(900px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  overflow-y: auto; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(139, 92, 246, .2);
  transform: translate(-50%, -46%) scale(.97); opacity: 0; visibility: hidden;
  transition: transform .35s var(--ease), opacity .3s, visibility .3s;
}
.modal.open { transform: translate(-50%, -50%); opacity: 1; visibility: visible; }
.modal-close { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 3; }

.modal-body { display: grid; grid-template-columns: 1fr 1.1fr; }
.modal-media { position: relative; background: #12121c; border-radius: 22px 0 0 22px; overflow: hidden; min-height: 320px; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-info { display: flex; flex-direction: column; gap: 10px; padding: 32px 28px 28px; }
.modal-info h2 { font-size: 21px; font-weight: 800; line-height: 1.7; }
.modal-desc { color: #cfcfe0; font-size: 14.5px; line-height: 2; }

.spec-list { margin-top: 4px; }
.spec-list li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.spec-list li span { color: var(--muted); }
.spec-list li strong { font-weight: 600; text-align: end; }

.modal-buy { margin-top: auto; padding-top: 14px; display: grid; gap: 10px; }
.modal-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.modal-price .price { font-size: 24px; color: var(--purple-neon); }
.modal-incart { font-size: 13px; color: var(--success); }
.modal-buy .btn { width: 100%; }

/* ---------- واکنش‌گرای Update 2 ---------- */
@media (max-width: 760px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-media { border-radius: 22px 22px 0 0; min-height: 0; aspect-ratio: 16 / 11; }
  .modal-info { padding: 22px 20px 22px; }
  .modal { top: auto; bottom: 0; left: 0; width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; transform: translateY(40px); }
  .modal.open { transform: none; }
}

@media (max-width: 640px) {
  .toolbar { gap: 10px; }
  .select-box { flex: 1 1 100%; }
  .select-box select { flex: 1; width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -14px; padding: 2px 14px 8px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip-btn { flex: none; }
}

@media (max-width: 480px) {
  .cart-drawer { border-right: 0; }
  .cart-item { grid-template-columns: 64px 1fr auto; gap: 10px; padding: 10px; }
  .cart-item img { width: 64px; height: 64px; }
}
