/* ============================================
   فروشگاه اول آخر
   تم: آبی کمرنگ / سفید / سرمه‌ای
   نسخه کامل — هماهنگ با index.html و app.js
   ============================================ */

/* ============================================
   ۱. متغیرها و تنظیمات پایه
   ============================================ */
:root {
  --navy: #14304f;
  --primary: #1d3a5f;
  --primary-dark: #12283f;
  --blue: #3f7cb8;
  --sky: #cfe3f5;
  --sky-light: #eaf3fb;
  --bg: #f4f8fc;
  --card: #ffffff;
  --text: #1c2b3a;
  --text-light: #64748b;
  --border: #dde8f2;
  --success: #2f9e77;
  --warning: #d99a2b;
  --danger: #d64550;
  --gold: #f0b429;
  --shadow: 0 2px 10px rgba(20, 48, 79, 0.06);
  --shadow-lg: 0 10px 30px rgba(20, 48, 79, 0.14);
  --radius: 14px;
  --radius-lg: 20px;
  --nav-height: 72px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: 75px;
  padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px));
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

h1, h2, h3, h4 {
  line-height: 1.6;
}

::selection {
  background: var(--sky);
  color: var(--navy);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ============================================
   ۲. کلاس‌های ابزار عمومی
   ============================================ */
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.between {
  justify-content: space-between;
}

.muted {
  color: var(--text-light);
}

.sm {
  font-size: 12px;
}

.mt {
  margin-top: 12px;
}

.card-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

/* ============================================
   ۳. دکمه‌ها
   ============================================ */
.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: var(--card);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--sky-light);
}

.btn-danger {
  background: #fdeef0;
  color: var(--danger);
  border: 1px solid #f5cdd2;
}

.btn-danger:hover {
  background: #fbdde1;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

/* ============================================
   ۴. فرم‌ها
   ============================================ */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--blue);
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.9;
}

/* ============================================
   ۵. Toast (اعلان)
   ============================================ */
.toast {
  position: fixed;
  top: 85px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--navy);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 13px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  text-align: center;
  pointer-events: none;
}

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

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
  color: #ffffff;
}

/* ============================================
   ۶. نوار جستجوی شناور
   ============================================ */
.floating-search {
  position: fixed;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 999;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  background: var(--card);
  border: 1.5px solid var(--sky);
  border-radius: 35px;
  box-shadow: 0 4px 16px rgba(20, 48, 79, 0.08);
  max-width: 1080px;
  margin: 0 auto;
}

.floating-search .search-icon {
  width: 40px;
  color: var(--primary);
  font-size: 26px;
  text-align: center;
  border-left: 1px solid var(--border);
  padding-left: 8px;
  flex-shrink: 0;
}

.search-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  font-size: 15px;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.search-brand strong {
  color: var(--primary);
}

.floating-search input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  text-align: right;
  color: var(--text);
  padding: 0 12px;
  min-width: 0;
}

.floating-search input::placeholder {
  color: transparent;
}

.floating-search:focus-within .search-brand,
.floating-search input:not(:placeholder-shown) ~ .search-brand {
  opacity: 0;
}

.floating-search:focus-within input::placeholder {
  color: var(--text-light);
}

/* نتایج جستجو */
.home-search-results {
  display: none;
  position: fixed;
  top: 70px;
  left: 12px;
  right: 12px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 998;
  max-width: 1080px;
  margin: 0 auto;
}

.home-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s ease;
}

.home-search-item:last-child {
  border-bottom: none;
}

.home-search-item:hover {
  background: var(--sky-light);
}

.home-search-item img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--sky-light);
  flex-shrink: 0;
}

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

.home-search-item .search-name {
  font-size: 13px;
  margin-bottom: 4px;
}

.home-search-item .search-price {
  font-size: 12px;
  color: var(--primary);
  font-weight: bold;
}

/* ============================================
   ۷. صفحه خانه — هیرو و بنرها
   ============================================ */
.page-section {
  padding: 15px;
  min-height: 70vh;
  max-width: 1080px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.home-hero {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-radius: var(--radius-lg);
  padding: 30px 22px;
  color: #ffffff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  margin-bottom: 12px;
}

.home-hero h1 {
  font-size: 22px;
  margin-bottom: 12px;
}

.brand-highlight {
  color: var(--sky);
}

.home-hero p {
  font-size: 13px;
  line-height: 2;
  color: var(--sky-light);
  margin-bottom: 15px;
}

.hero-btn {
  border: none;
  background: #ffffff;
  color: var(--navy);
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.hero-btn:active {
  transform: scale(0.97);
}

/* بنرهای تبلیغاتی */
.home-banners {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 25px;
}

.banner-card {
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-sky {
  background: var(--sky-light);
  color: var(--navy);
  border: 1px solid var(--sky);
}

.banner-navy {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #ffffff;
}

.banner-icon {
  font-size: 30px;
}

.banner-card h3 {
  font-size: 14px;
  margin-bottom: 2px;
}

.banner-card p {
  font-size: 11px;
  opacity: 0.85;
}

/* ============================================
   ۸. دسته‌بندی‌های صفحه خانه
   ============================================ */
.home-categories {
  margin-bottom: 25px;
}

.home-categories h2 {
  font-size: 17px;
  margin-bottom: 15px;
}

#homeCategoriesList {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.home-category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  min-height: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--navy);
  font-size: 12px;
  font-weight: bold;
  box-shadow: var(--shadow);
  width: 100%;
  transition: transform 0.2s ease, background 0.2s ease;
}

.home-category-card:active {
  transform: scale(0.96);
  background: var(--sky-light);
}

.home-category-icon {
  font-size: 30px;
}

.home-all-categories {
  background: var(--sky-light);
  color: var(--primary);
  border: 1px dashed var(--blue) !important;
}

/* ============================================
   ۹. بخش‌های محصولات (خانه)
   ============================================ */
.home-products-section {
  margin-bottom: 32px;
}

.home-cat-section {
  margin-bottom: 36px;
}

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

.section-title {
  font-size: 17px;
  font-weight: bold;
}

.see-all-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 12px;
  font-weight: bold;
}

.see-all-btn:hover {
  color: var(--primary);
}

.products-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}

.products-scroll::-webkit-scrollbar {
  display: none;
}

.products-scroll .product {
  flex: 0 0 270px;
  min-width: 270px;
}

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

/* ============================================
   ۱۰. کارت محصول
   (مینیمال — عکس راست، قیمت چپ پایین)
   ============================================ */
.product {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "img name"
    "img price";
  gap: 6px 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product:hover {
  box-shadow: var(--shadow-lg);
}

.product:active {
  transform: scale(0.98);
}

.product-img {
  grid-area: img;
  width: 100%;
  height: 120px;
  background: var(--sky-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-name {
  grid-area: name;
  align-self: start;
}

.product-name h3 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text);
}

.product-brand {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.price-wrap {
  grid-area: price;
  align-self: end;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: left;
}

.old-price {
  font-size: 11px;
  color: var(--text-light);
  text-decoration: line-through;
}

.final-price {
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
}

.off-chip {
  background: var(--sky);
  color: var(--navy);
  font-size: 10px;
  font-weight: bold;
  border-radius: 20px;
  padding: 1px 8px;
  margin-bottom: 2px;
}

.sold-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--sky-light);
  color: var(--navy);
  font-size: 10px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--sky);
  z-index: 2;
}

/* ============================================
   ۱۱. صفحه فروشگاه و فیلترها
   ============================================ */
.container {
  padding: 15px;
  max-width: 1080px;
  margin: 0 auto;
}

.store-filters {
  background: var(--card);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.filter-section {
  margin-bottom: 12px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section h3 {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.filter-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 4px 0;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chips button {
  padding: 8px 16px;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  transition: all 0.2s ease;
}

.filter-chips button:hover {
  border-color: var(--blue);
}

.filter-chips button.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.store-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.products-count {
  font-size: 12px;
  color: var(--text-light);
}

/* ============================================
   ۱۲. صفحه دسته‌بندی
   ============================================ */
.category-layout {
  display: flex;
  min-height: calc(100vh - 180px);
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.category-sidebar {
  width: 118px;
  flex-shrink: 0;
  background: var(--sky-light);
  border-left: 1px solid var(--border);
  padding: 15px 8px;
}

.category-sidebar h3 {
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--navy);
}

#categoryPageList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#categoryPageList button {
  width: 100%;
  min-height: 50px;
  padding: 8px 5px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  line-height: 1.6;
  transition: background 0.2s ease;
}

#categoryPageList button:hover {
  background: var(--sky);
}

#categoryPageList button.active {
  background: var(--primary);
  color: #ffffff;
}

.category-content {
  flex: 1;
  min-width: 0;
  padding: 15px 12px;
}

.category-content h2 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--navy);
}

.cat-search {
  margin-bottom: 10px;
}

#categorySubChips {
  margin-bottom: 12px;
}

#categoryStoreBtn {
  margin-bottom: 12px;
}

#categoryProductsGrid {
  margin-top: 10px;
}

/* ============================================
   ۱۳. سبد خرید
   ============================================ */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cart-header h2 {
  font-size: 20px;
}

.cart-count-badge {
  background: var(--primary);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}

.cart-product-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  object-fit: contain;
  background: var(--sky-light);
  border-radius: 10px;
}

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

.cart-product-name {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
  line-height: 1.6;
}

.cart-product-old-price {
  font-size: 11px;
  color: var(--text-light);
  text-decoration: line-through;
}

.cart-product-discount {
  color: var(--blue);
  font-size: 11px;
  margin-bottom: 4px;
}

.cart-product-price {
  color: var(--primary);
  font-weight: bold;
  font-size: 13px;
}

.cart-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sky-light);
  padding: 4px;
  border-radius: 8px;
}

.cart-controls button {
  border: 0;
  background: var(--card);
  color: var(--primary);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: var(--shadow);
}

.cart-controls .qty {
  font-size: 13px;
  font-weight: bold;
  min-width: 20px;
  text-align: center;
}

.cart-remove {
  border: none;
  background: none;
  color: var(--danger);
  font-size: 16px;
}

/* حالت خالی */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 60px;
  margin-bottom: 15px;
}

/* ============================================
   ۱۴. کد تخفیف (سبد خرید)
   ============================================ */
.coupon-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 15px;
  margin: 15px 0;
  border: 1px solid var(--border);
}

.coupon-section h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.coupon-input-wrap {
  display: flex;
  gap: 8px;
}

.coupon-input-wrap input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  min-width: 0;
}

.coupon-input-wrap input:focus {
  outline: none;
  border-color: var(--blue);
}

.coupon-input-wrap button {
  padding: 10px 18px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 13px;
}

.coupon-message {
  font-size: 12px;
  margin-top: 8px;
}

.coupon-message.success {
  color: var(--success);
}

.coupon-message.error {
  color: var(--danger);
}

/* ============================================
   ۱۵. خلاصه سفارش
   ============================================ */
.cart-summary {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 15px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.cart-summary h3 {
  font-size: 15px;
  margin-bottom: 15px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-light);
}

.summary-row strong {
  color: var(--text);
  font-size: 13px;
}

.discount-row strong {
  color: var(--blue);
}

.payable-row {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 12px;
  font-size: 14px;
}

.payable-row strong {
  color: var(--primary);
  font-size: 18px;
}

.checkout-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: bold;
  margin-top: 15px;
  box-shadow: 0 4px 12px rgba(20, 48, 79, 0.25);
  transition: background 0.2s ease;
}

.checkout-btn:hover {
  background: var(--primary-dark);
}

/* ============================================
   ۱۶. صفحه تکمیل سفارش (چک‌اوت)
   ============================================ */
.checkout-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.checkout-header h2 {
  font-size: 18px;
}

.checkout-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.cstep {
  font-size: 12px;
  color: var(--text-light);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.cstep.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.cstep.done {
  background: var(--sky-light);
  color: var(--navy);
  border-color: var(--sky);
}

.cstep-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* کارت آدرس */
.address-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.address-card.selected {
  border-color: var(--primary);
  background: var(--sky-light);
}

.address-card input[type="radio"] {
  margin-top: 5px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.address-title {
  font-weight: bold;
  font-size: 13px;
}

.default-badge {
  background: var(--sky);
  color: var(--navy);
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 10px;
  margin-right: 6px;
}

.address-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* روش پرداخت */
.pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.2s ease;
}

.pay-method:hover {
  border-color: var(--blue);
}

.pay-method input {
  accent-color: var(--primary);
  flex-shrink: 0;
}

.pay-method.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pay-method.disabled:hover {
  border-color: var(--border);
}

/* لیست کوچک کالاها */
.mini-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

/* صفحه موفقیت */
.success-box {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 35px 20px;
}

.success-box h3 {
  font-size: 18px;
  color: var(--navy);
}

.success-icon {
  font-size: 60px;
  margin-bottom: 10px;
}

/* ============================================
   ۱۷. صفحه جزئیات محصول
   ============================================ */
.product-detail {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2000;
  background: var(--bg);
  overflow-y: auto;
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.detail-header span {
  font-size: 15px;
  font-weight: bold;
}

.back-btn,
.fav-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--sky-light);
  color: var(--navy);
  font-size: 20px;
  transition: background 0.2s ease;
}

.back-btn:hover {
  background: var(--sky);
}

.fav-btn.active {
  color: var(--danger);
  background: #fdeef0;
}

/* مسیر صفحه (Breadcrumb) */
.breadcrumb {
  padding: 10px 15px 0;
  font-size: 11px;
  color: var(--text-light);
  max-width: 900px;
  margin: 0 auto;
}

.breadcrumb a {
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* گالری */
.detail-gallery {
  background: var(--card);
  padding: 15px;
  margin: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  max-width: 880px;
}

.detail-image {
  height: 280px;
  background: var(--sky-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.detail-thumbs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.detail-thumbs .thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--sky-light);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.detail-thumbs .thumb.active {
  border-color: var(--primary);
}

.detail-gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  color: var(--text-light);
}

.detail-gallery-controls button {
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
}

.detail-gallery-controls button:hover {
  background: var(--primary-dark);
}

/* اطلاعات محصول */
.detail-info {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 10px;
  border: 1px solid var(--border);
  max-width: 880px;
}

.detail-name {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.brand-chip {
  display: inline-block;
  background: var(--sky-light);
  color: var(--navy);
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.detail-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.stars {
  font-size: 15px;
  letter-spacing: 2px;
}

.star {
  color: #cbd5e1;
}

.star.filled {
  color: var(--gold);
}

.rating-text {
  font-size: 12px;
  color: var(--text-light);
}

.detail-price-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0;
}

.detail-old-price {
  font-size: 14px;
  color: var(--text-light);
  text-decoration: line-through;
}

.detail-price {
  font-size: 22px;
  color: var(--primary);
  font-weight: 800;
}

.detail-discount-badge {
  background: var(--sky);
  color: var(--navy);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}

.detail-stock {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 15px;
}

.detail-stock.in-stock {
  background: #e7f5ef;
  color: var(--success);
}

.detail-stock.low-stock {
  background: #fdf4e3;
  color: var(--warning);
}

.detail-stock.out-of-stock {
  background: #fdeef0;
  color: var(--danger);
}

/* نشان‌های اعتماد */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.trust-item {
  background: var(--sky-light);
  color: var(--navy);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 20px;
}

/* تب‌ها */
.detail-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  margin: 20px 0 15px;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 13px;
  font-weight: bold;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
  line-height: 2;
  color: var(--text-light);
  font-size: 13px;
}

.tab-content.active {
  display: block;
}

.full-description {
  margin-top: 12px;
  white-space: pre-line;
}

/* جدول مشخصات */
.spec-table-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.spec-table-row span {
  color: var(--text-light);
}

.spec-table-row strong {
  color: var(--text);
  text-align: left;
}

/* ============================================
   ۱۸. نظرات و امتیازدهی
   ============================================ */
.reviews-summary {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--sky-light);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 15px;
}

.rs-score {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
}

.review-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 15px;
}

.rate-stars {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  margin-top: 8px;
}

.rate-star {
  font-size: 26px;
  background: none;
  border: none;
  color: #cbd5e1;
  transition: color 0.15s ease, transform 0.15s ease;
}

.rate-star:hover {
  transform: scale(1.15);
}

.rate-star.active {
  color: var(--gold);
}

.review-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.review-item:last-child {
  border-bottom: none;
}

.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}

.review-head strong {
  font-size: 13px;
  color: var(--text);
}

/* ============================================
   ۱۹. محصولات مرتبط و نوار خرید
   ============================================ */
.related-products {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 15px;
  margin: 10px;
  border: 1px solid var(--border);
  max-width: 880px;
}

.related-products h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.detail-buy-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  padding: 12px 15px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  z-index: 10;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--sky-light);
  border-radius: 10px;
  padding: 6px 10px;
}

.qty-stepper button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: var(--card);
  color: var(--primary);
  font-size: 16px;
  font-weight: bold;
  box-shadow: var(--shadow);
}

.qty-stepper span {
  min-width: 24px;
  text-align: center;
  font-weight: bold;
}

.detail-button {
  flex: 1;
  max-width: 400px;
  padding: 14px;
  background: var(--primary);
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(20, 48, 79, 0.25);
  transition: background 0.2s ease;
}

.detail-button:hover {
  background: var(--primary-dark);
}

.detail-button:disabled {
  background: #adb5bd;
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================
   ۲۰. صفحه حساب کاربری — ورود
   ============================================ */
.account-page {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  z-index: 3000;
  background: var(--bg);
  overflow-y: auto;
  padding: 15px;
}

.account-page > * {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.account-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.account-header h2 {
  font-size: 18px;
}

.account-logo {
  text-align: center;
  padding: 30px 20px;
  background: var(--card);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.logo-icon {
  font-size: 50px;
  margin-bottom: 10px;
}

.account-logo h2 {
  color: var(--primary);
  font-size: 24px;
  margin-bottom: 5px;
}

.account-logo p {
  color: var(--text-light);
  font-size: 13px;
}

.account-card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.account-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.account-tabs button {
  flex: 1;
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: var(--sky-light);
  color: var(--text);
  font-size: 13px;
  transition: background 0.2s ease;
}

.account-tabs button.active {
  background: var(--primary);
  color: #ffffff;
}

.account-input {
  width: 100%;
  padding: 13px;
  margin: 8px 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
}

.account-input:focus {
  outline: none;
  border-color: var(--blue);
}

.account-submit {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.2s ease;
}

.account-submit:hover {
  background: var(--primary-dark);
}

.account-message {
  font-size: 12px;
  line-height: 2;
  color: var(--text-light);
  margin-top: 12px;
  text-align: center;
}

/* ============================================
   ۲۱. پنل مشتری — کیف پول و پروفایل
   ============================================ */
.wallet-top-card {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
  box-shadow: var(--shadow-lg);
}

.wallet-label {
  display: block;
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.wallet-amount {
  font-size: 20px;
  font-weight: 800;
}

.wallet-charge-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.wallet-charge-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.user-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 15px;
}

.user-avatar {
  width: 52px;
  height: 52px;
  background: var(--sky-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.user-info h3 {
  font-size: 15px;
}

.user-info p {
  font-size: 12px;
  color: var(--text-light);
  direction: ltr;
  text-align: right;
}

/* منوی پنل */
.panel-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  text-align: right;
  width: 100%;
  transition: background 0.2s ease;
}

.menu-item:hover {
  background: var(--sky-light);
}

.menu-item:active {
  transform: scale(0.99);
}

.menu-icon {
  font-size: 22px;
}

.menu-arrow {
  margin-right: auto;
  color: var(--text-light);
}

.menu-item.logout {
  color: var(--danger);
  border-color: #f5cdd2;
}

.menu-item.logout:hover {
  background: #fdeef0;
}

/* زیرصفحه‌ها */
.sub-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.sub-header h3 {
  font-size: 16px;
}

/* ============================================
   ۲۲. سفارش‌ها و وضعیت‌ها
   ============================================ */
.order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-light);
  margin: 8px 0;
}

.status-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: bold;
  white-space: nowrap;
}

.status-chip.processing {
  background: var(--sky-light);
  color: var(--navy);
}

.status-chip.shipped {
  background: #e8eefc;
  color: #3b5bdb;
}

.status-chip.delivered {
  background: #e7f5ef;
  color: var(--success);
}

.status-chip.cancelled {
  background: #fdeef0;
  color: var(--danger);
}

/* ============================================
   ۲۳. کدهای تخفیف / علاقه‌مندی / کیف پول
   ============================================ */
.coupon-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px dashed var(--blue);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.coupon-code {
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
  direction: ltr;
}

.fav-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
}

.fav-row img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: var(--sky-light);
  border-radius: 8px;
  flex-shrink: 0;
}

.wallet-tx {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.wallet-tx:last-child {
  border-bottom: none;
}

.tx-plus {
  color: var(--success);
  font-weight: bold;
  white-space: nowrap;
}

.tx-minus {
  color: var(--danger);
  font-weight: bold;
  white-space: nowrap;
}

/* ============================================
   ۲۴. پنل مدیریت
   ============================================ */
.admin-badge {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #ffffff;
  padding: 12px;
  border-radius: var(--radius);
  text-align: center;
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 15px;
}

.admin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  padding: 14px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

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

.stat-info h4 {
  font-size: 16px;
  color: var(--primary);
  font-weight: 800;
}

.stat-info p {
  font-size: 10px;
  color: var(--text-light);
}

/* تب‌های مدیریت محصولات */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.admin-tab {
  flex: 1;
  padding: 11px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 13px;
  font-weight: bold;
  color: var(--text-light);
  transition: all 0.2s ease;
}

.admin-tab.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ردیف محصول در لیست مدیریت */
.admin-product-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
}

.apr-img {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  object-fit: contain;
  background: var(--sky-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.apr-info {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}

.apr-info strong {
  font-size: 13px;
  display: block;
}

.apr-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

/* نشان موجودی */
.stock-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: bold;
  white-space: nowrap;
}

.stock-chip.ok {
  background: #e7f5ef;
  color: var(--success);
}

.stock-chip.low {
  background: #fdf4e3;
  color: var(--warning);
}

.stock-chip.out {
  background: #fdeef0;
  color: var(--danger);
}

/* ردیف مشخصات فنی (فرم محصول) */
.spec-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.spec-row input {
  flex: 1;
  min-width: 0;
}

.spec-row button {
  flex-shrink: 0;
}

/* گالری تصاویر فرم محصول */
.gallery-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.gp-item {
  width: 90px;
  text-align: center;
}

.gp-item img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  background: var(--sky-light);
  border-radius: 10px;
  border: 2px solid var(--border);
}

.gp-item.is-main img {
  border-color: var(--primary);
}

.gp-main-badge {
  display: block;
  font-size: 10px;
  color: var(--primary);
  font-weight: bold;
  margin-top: 4px;
}

.gp-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.gp-actions button {
  flex: 1;
  font-size: 10px;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: background 0.2s ease;
}

.gp-actions button:hover {
  background: var(--sky-light);
}

/* ============================================
   ۲۵. نوار ناوبری پایین
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 4px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -3px 15px rgba(20, 48, 79, 0.08);
  z-index: 1500;
  border-top: 1px solid var(--border);
}

.nav-item {
  flex: 1;
  text-decoration: none;
  color: var(--text-light);
  font-size: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  transition: color 0.2s ease;
}

.nav-item span:first-child {
  font-size: 22px;
}

.nav-item.active {
  color: var(--primary);
  font-weight: bold;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(22px);
  background: var(--primary);
  color: #ffffff;
  border-radius: 20px;
  min-width: 18px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: bold;
}

/* ============================================
   ۲۶. انیمیشن‌ها و اسکرول‌بار
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--sky);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--blue);
}

/* کاهش انیمیشن برای کاربران حساس */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   ۲۷. واکنش‌گرایی (Responsive)
   ============================================ */
@media (min-width: 700px) {
  .products {
    grid-template-columns: 1fr 1fr;
  }

  .admin-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-gallery,
  .detail-info,
  .related-products {
    margin-left: auto;
    margin-right: auto;
  }

  .home-hero h1 {
    font-size: 26px;
  }
}

@media (min-width: 1000px) {
  .products {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .category-sidebar {
    width: 160px;
  }

  #categoryPageList button {
    font-size: 12px;
  }
}
/* ============================================
   ۲۸. اصلاحات جدید — فیلترها، دسته‌بندی، علاقه‌مندی، ورود
   ============================================ */
.header-spacer {
  width: 40px;
  flex-shrink: 0;
}

/* نوار فیلتر فروشگاه (بدون عنوان) */
.store-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.filter-select {
  flex: 1 1 150px;
  min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--blue);
}

.filter-price {
  flex: 2 1 220px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.filter-price span {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
}

.filter-price input {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  background: var(--card);
  color: var(--text);
}

.filter-price input:focus {
  outline: none;
  border-color: var(--blue);
}

.filter-reset {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid #f5cdd2;
  background: #fdeef0;
  color: var(--danger);
  border-radius: 10px;
  font-size: 12px;
  font-weight: bold;
}

.active-sub-filter {
  display: flex;
  margin-bottom: 12px;
}

.sub-filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px dashed var(--blue);
  background: var(--sky-light);
  color: var(--navy);
  font-size: 12px;
  font-weight: bold;
}

/* کاشی‌های زیردسته و برند در صفحه دسته‌بندی */
.cat-block {
  margin-top: 14px;
}

.cat-block-title {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.cat-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.cat-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: var(--sky-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  color: var(--navy);
  text-align: right;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cat-tile:hover {
  background: var(--sky);
  border-color: var(--blue);
}

.cat-tile-count {
  font-size: 10px;
  font-weight: normal;
  color: var(--text-light);
  background: var(--card);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

@media (min-width: 700px) {
  .cat-tiles {
    grid-template-columns: 1fr 1fr;
  }
}

/* دکمه علاقه‌مندی زیر محصول */
.fav-btn-detail {
  display: block;
  width: 100%;
  margin: 4px 0 6px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.fav-btn-detail:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.fav-btn-detail.active {
  background: #fdeef0;
  border-color: var(--danger);
  color: var(--danger);
}

/* فیلدهای نام و نام خانوادگی در ورود */
.name-row {
  display: flex;
  gap: 8px;
}

.name-row .account-input {
  flex: 1;
  min-width: 0;
}

/* لیبل امتیاز */
.rate-label {
  margin-bottom: 10px;
}

.rate-star {
  padding: 2px 4px;
  line-height: 1;
}
/* ============================================
   ۲۹. قابلیت‌های جدید — تنوع، مقایسه، موجودی، امنیت
   ============================================ */

/* فیلترهای سریع */
.filter-toggle {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text-light);
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.filter-toggle.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* دکمه‌های زیر محصول */
.detail-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 6px;
}

.detail-actions-row .fav-btn-detail {
  margin: 0;
}

.compare-btn-detail,
.share-btn {
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.compare-btn-detail.active {
  background: var(--sky-light);
  border-color: var(--blue);
  color: var(--primary);
}

.share-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
  background: var(--sky-light);
  border-color: var(--sky);
  color: var(--navy);
  flex-shrink: 0;
}

/* تنوع محصول */
.detail-variants {
  background: var(--sky-light);
  border: 1px solid var(--sky);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}

.variant-group-label {
  font-size: 12px;
  font-weight: bold;
  color: var(--navy);
  margin-bottom: 8px;
}

.variant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-chip {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.variant-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.variant-chip.out {
  opacity: 0.55;
  text-decoration: line-through;
}

.variant-chip small {
  display: block;
  font-size: 10px;
  font-weight: normal;
  opacity: 0.8;
  margin-top: 2px;
}

/* خبرم کن */
.notify-wrap {
  margin-bottom: 12px;
}

.notify-card {
  background: #fdf4e3;
  border: 1px solid #f0d9a8;
  border-radius: var(--radius);
  padding: 12px;
}

.notify-card .sm {
  margin-bottom: 8px;
}

.notify-form {
  display: flex;
  gap: 8px;
}

.notify-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid #f0d9a8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  background: var(--card);
}

.notify-form button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--warning);
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

/* دکمه مقایسه روی کارت */
.card-compare-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-light);
  font-size: 15px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.card-compare-btn:hover,
.card-compare-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* نوار مقایسه */
.compare-bar {
  position: fixed;
  right: 12px;
  left: 12px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 8px);
  max-width: 700px;
  margin: 0 auto;
  background: var(--navy);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 10px 12px;
  z-index: 1400;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.25s ease;
}

.compare-bar-info {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: bold;
}

.compare-bar-items {
  display: flex;
  gap: 4px;
}

.compare-thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--sky-light);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.compare-bar-actions button {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: bold;
}

.compare-open-btn {
  background: #ffffff;
  color: var(--navy);
}

.compare-clear-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

body.compare-active {
  padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px));
}

/* صفحه مقایسه */
.compare-page {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: var(--bg);
  overflow-y: auto;
}

.compare-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.compare-header h2 {
  flex: 1;
  font-size: 17px;
}

.compare-content {
  padding: 15px;
  max-width: 1080px;
  margin: 0 auto;
}

.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.compare-table-wrap::-webkit-scrollbar {
  height: 8px;
}

.compare-table-wrap::-webkit-scrollbar-thumb {
  background: var(--blue);
}

.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 12px;
}

.compare-table th,
.compare-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
}

.compare-table th:last-child,
.compare-table td:last-child {
  border-left: none;
}

.compare-table thead th {
  background: var(--sky-light);
  vertical-align: top;
}

.compare-table tbody th {
  background: var(--sky-light);
  color: var(--navy);
  font-weight: bold;
  white-space: nowrap;
  width: 120px;
}

.compare-product-head {
  text-align: center;
}

.compare-product-head img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 auto 8px;
  background: var(--card);
  border-radius: 8px;
}

.compare-product-head strong {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 6px;
}

.compare-remove {
  border: none;
  background: #fdeef0;
  color: var(--danger);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: bold;
}

.compare-price {
  color: var(--primary);
  font-weight: 800;
}

.compare-best {
  background: #e7f5ef;
  color: var(--success);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: bold;
  display: inline-block;
  margin-top: 4px;
}

/* زوم عکس */
.image-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(10, 22, 38, 0.92);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-lightbox.open {
  display: flex;
}

.image-lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 20px;
}

/* درخواست‌های موجودی (پنل مدیریت) */
.notify-request-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.notify-request-card.ready {
  border-color: var(--success);
  background: #f4fbf8;
}

.notify-status {
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: bold;
}

.notify-status.waiting {
  background: var(--sky-light);
  color: var(--navy);
}

.notify-status.ready {
  background: #e7f5ef;
  color: var(--success);
}

.notify-status.done {
  background: #eef2f6;
  color: var(--text-light);
}

.notify-count-badge {
  background: var(--danger);
  color: #ffffff;
  border-radius: 20px;
  min-width: 20px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: bold;
  margin-right: auto;
}

/* ردیف تنوع در فرم محصول */
.admin-variant-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--sky-light);
  border: 1px solid var(--sky);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.admin-variant-row .form-group {
  margin-bottom: 0;
}

.admin-variant-row .av-remove {
  grid-column: 1 / -1;
}

/* پشتیبان‌گیری */
.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-note {
  font-size: 11px;
  color: var(--text-light);
  line-height: 2;
  margin-top: 8px;
}

/* فرم تغییر رمز */
.password-form-card .account-submit {
  margin-top: 8px;
}

/* واکنش‌گرایی */
@media (min-width: 700px) {
  .admin-variant-row {
    grid-template-columns: repeat(4, 1fr) auto;
    align-items: end;
  }

  .admin-variant-row .av-remove {
    grid-column: auto;
  }

  .detail-actions-row {
    max-width: 420px;
  }
}
/* ============================================
   ۳۰. وضعیت آپلود عکس
   ============================================ */
.image-upload-status {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.9;
  background: var(--sky-light);
  border: 1px solid var(--sky);
  color: var(--navy);
  white-space: pre-wrap;
  word-break: break-word;
}

.image-upload-status:empty {
  display: none;
}

.image-upload-status[data-type="loading"] {
  background: #eef4ff;
  border-color: #c7d8f5;
  color: #274c77;
}

.image-upload-status[data-type="success"] {
  background: #e7f5ef;
  border-color: #bfe6d4;
  color: var(--success);
}

.image-upload-status[data-type="warning"] {
  background: #fdf4e3;
  border-color: #f0d9a8;
  color: #8a5b12;
}

.image-upload-status[data-type="error"] {
  background: #fdeef0;
  border-color: #f5cdd2;
  color: var(--danger);
}

.gp-sub-badge {
  opacity: 0.55;
}
/* ============================================
   ۳۳. فیلترهای خطی، جمع‌وجور و اسکرولی (نهایی)
   ============================================ */
#storeToolbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

#storeToolbar::-webkit-scrollbar {
  display: none;
}

#storeToolbar .filter-select,
#storeToolbar .filter-toggle,
#storeToolbar .filter-reset {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 9px;
  white-space: nowrap;
  cursor: pointer;
}

#storeToolbar .filter-select {
  min-width: 118px;
  max-width: 150px;
}

#storeToolbar .filter-price {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
}

#storeToolbar .filter-price input {
  width: 74px;
  height: 34px;
  padding: 0 6px;
  font-size: 11px;
  border-radius: 9px;
  text-align: center;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: inherit;
}

#storeToolbar .filter-price input:focus {
  outline: none;
  border-color: var(--blue);
}

#storeToolbar .filter-price span {
  font-size: 10px;
  color: var(--text-light);
}