/* ==========================================================================
   لوازم خیاطی پورنیاکان — استایل داشبوردی مدرن و مینیمال
   طراحی الهام‌گرفته از الگوی مرجع (سایدبار چپ، بخش محصولات مرکز، سبد خرید راست)
   ========================================================================== */

:root {
  /* تم پیش‌فرض: روشن، تمیز با رنگ تاکیدی آبی نفتی / نیلی مدرن */
  --bg-outer: #e9eef4;
  --bg-surface: #ffffff;
  --bg-subtle: #f7f8fa;
  --bg-card-thumb: #f3f4f6;
  --bg-input: #f8fafc;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  --border-light: #eef0f4;
  --border-medium: #e2e8f0;

  /* Accent: Navy Blue (آبی نفتی مدرن) */
  --accent-primary: #1e40af;
  --accent-bright: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff4ff;
  --accent-soft-border: #dbeafe;

  --danger: #e11d48;
  --danger-soft: #ffe4e6;
  --success: #059669;

  --radius-xl: 18px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;

  --shadow-window: 0 20px 50px rgba(15, 23, 42, 0.1), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.03);
  --shadow-card-hover: 0 10px 24px rgba(15, 23, 42, 0.07);

  --font-fa: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-en: 'Inter', sans-serif;
}

/* تم جایگزین: سبز زیتونی (Olive Green) */
body[data-theme="olive"] {
  --accent-primary: #3f6212;
  --accent-bright: #4d7c0f;
  --accent-hover: #365314;
  --accent-soft: #f4fce3;
  --accent-soft-border: #d9f99d;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: var(--font-fa);
  background: radial-gradient(circle at 15% 15%, #f1f5f9 0%, #dde5ef 100%);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

body {
  padding: 14px 18px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ==========================================================================
   Outer App Frame (قالب پنجره اپلیکیشن شبیه تصویر مرجع)
   ========================================================================== */
.app-frame {
  width: 100%;
  max-width: 1480px;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-window);
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: calc(100vh - 28px);
}

/* نوار مرورگر بالای پنجره (مطابق تصویر مرجع) */
.browser-chrome {
  height: 44px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  direction: ltr;
  flex-shrink: 0;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red {
  background: #ff5f57;
}
.dot-yellow {
  background: #febc2e;
}
.dot-green {
  background: #28c840;
}

.window-nav-arrows {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}

.chrome-icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.chrome-icon-btn:hover {
  background: var(--border-light);
  color: var(--text-secondary);
}

.address-bar {
  background: #eef2f6;
  height: 28px;
  width: 340px;
  max-width: 42vw;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--text-secondary);
  position: relative;
}

.lock-icon {
  font-size: 10px;
  color: var(--text-muted);
}

.domain-text {
  font-weight: 500;
  letter-spacing: 0.2px;
}

.refresh-btn {
  position: absolute;
  right: 8px;
  color: var(--text-muted);
  font-size: 11px;
  transition: color 0.2s, transform 0.2s;
}

.refresh-btn:hover {
  color: var(--accent-primary);
  transform: rotate(90deg);
}

.chrome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: rtl;
}

.accent-switcher {
  display: inline-flex;
  background: #eef2f6;
  padding: 3px;
  border-radius: 8px;
  gap: 4px;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.theme-pill.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.navy-dot {
  background: #2563eb;
}
.olive-dot {
  background: #4d7c0f;
}

/* ==========================================================================
   Main 3-Column Dashboard Grid
   Left: Sidebar (220px) | Center: Products (1fr) | Right: Cart (330px)
   ========================================================================== */
.dashboard-workspace {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 336px;
  flex: 1;
  background: var(--bg-surface);
  min-height: 0;
}

/* ==========================================================================
   1. LEFT SIDEBAR (نوار کناری سمت چپ)
   ========================================================================== */
.sidebar-left {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  padding: 20px 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 20px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  color: var(--accent-bright);
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.22));
}

.brand-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 24px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.18s ease;
  position: relative;
}

.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: #94a3b8;
  transition: color 0.18s ease;
}

.nav-text {
  flex: 1;
}

.nav-en {
  font-family: var(--font-en);
  font-size: 10px;
  color: #cbd5e1;
  font-weight: 500;
}

/* حالت فعال منوی محصولات (Highlight مطابق تصویر مرجع) */
.nav-link.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.04) 0%, var(--accent-soft) 100%);
  color: var(--accent-bright);
  font-weight: 700;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 6px;
  bottom: 6px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-bright);
}

.nav-link.active .nav-icon {
  color: var(--accent-bright);
}

.nav-link.active .nav-en {
  color: var(--accent-bright);
  opacity: 0.75;
}

.nav-badge {
  background: var(--danger);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.secondary-nav {
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.signout-link:hover {
  color: var(--danger);
  background: #fff1f2;
}

.signout-link:hover .nav-icon {
  color: var(--danger);
}

/* ==========================================================================
   2. CENTER SECTION (بخش مرکزی — سفارشات و لیست محصولات)
   ========================================================================== */
.center-products {
  background: #fbfcfd;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ردیف بالای بخش مرکزی: سفارشات (Orders) و آیکون‌های ابزار */
.center-topbar {
  height: 54px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.orders-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.orders-icon {
  color: var(--text-secondary);
  font-size: 15px;
}

.orders-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.orders-en {
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.topbar-utilities {
  display: flex;
  align-items: center;
  gap: 8px;
}

.utility-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s ease;
}

.utility-btn:hover {
  background: var(--bg-subtle);
  color: var(--accent-bright);
  border-color: var(--border-medium);
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}

/* نوار مسیر (MENU > ORDERS) */
.breadcrumb-strip {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  padding: 7px 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
}

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

.bc-sep {
  font-size: 9px;
  color: var(--text-muted);
}

.bc-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  font-size: 10.5px;
}

/* ردیف عنوان لیست محصولات، اسکن بارکد و جستجو */
.products-toolbar {
  background: var(--bg-surface);
  padding: 14px 22px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.section-title small {
  font-family: var(--font-en);
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scan-barcode-btn {
  height: 35px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s ease;
}

.scan-barcode-btn:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  background: var(--accent-soft);
}

.en-inline {
  font-family: var(--font-en);
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.search-box {
  position: relative;
  width: 225px;
}

.search-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 35px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0 32px 0 10px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.18s ease;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  background: var(--bg-surface);
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* نوار فیلتر دسته‌بندی‌ها و مرتب‌سازی */
.categories-bar {
  background: var(--bg-surface);
  padding: 6px 22px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.category-pills {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  flex-wrap: wrap;
}

.cat-pill {
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.cat-pill:hover {
  color: var(--text-primary);
}

.cat-pill.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.sort-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sort-icon {
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  pointer-events: none;
}

.sort-select {
  height: 34px;
  padding: 0 28px 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.sort-select:focus {
  border-color: var(--accent-bright);
}

/* ==========================================================================
   شبکه محصولات ۳ ستونی (3-Column Product Grid)
   ========================================================================== */
.products-grid {
  padding: 18px 22px 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 11px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-medium);
}

.product-thumb-box {
  height: 148px;
  background: var(--bg-card-thumb);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.product-cat-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.product-unit-tag {
  position: absolute;
  bottom: 7px;
  left: 7px;
  background: rgba(17, 24, 39, 0.72);
  color: #ffffff;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}

.product-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 9px;
}

/* انتخابگر سایز / ضخامت (Size / Thickness Selector) */
.product-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  gap: 6px;
}

.option-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 44px;
}

.size-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.size-chip {
  min-width: 26px;
  height: 22px;
  padding: 0 5px;
  border-radius: 5px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.size-chip:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.size-chip.selected {
  background: var(--bg-surface);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12);
}

/* انتخابگر رنگ (Color Swatches) */
.color-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-swatch {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.12);
}

.color-swatch.selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--accent-bright);
  transform: scale(1.1);
}

/* فوتر کارت محصول: قیمت و دکمه افزودن به سبد */
.product-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price-block {
  display: flex;
  flex-direction: column;
}

.price-amount {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.price-currency {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.add-to-cart-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.add-to-cart-btn:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.22);
}

.add-to-cart-btn.added {
  background: var(--accent-soft);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}

.empty-search-state {
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-search-state i {
  font-size: 28px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ==========================================================================
   3. RIGHT SIDEBAR (نوار کناری سمت راست — سبد خرید Cart)
   ========================================================================== */
.sidebar-right-cart {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-top-header {
  height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
}

.cart-main-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.cart-main-title small {
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.cart-sub-banner {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  padding: 7px 18px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.cart-selection-bar {
  padding: 11px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.selected-count-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.clear-cart-btn {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--danger);
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.clear-cart-btn:hover {
  background: var(--danger-soft);
}

/* لیست آیتم‌های سبد خرید */
.cart-items-container {
  padding: 4px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}

.cart-item-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.cart-item-card:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.cart-item-thumb {
  width: 62px;
  height: 68px;
  border-radius: var(--radius-md);
  background: var(--bg-card-thumb);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

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

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

.cart-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.cart-item-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-cat {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cart-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.meta-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--text-primary);
}

.meta-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

.cart-item-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.qty-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}

.qty-number {
  font-size: 12px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

.empty-cart-box {
  text-align: center;
  padding: 28px 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.empty-cart-box i {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

/* ==========================================================================
   بخش جزئیات پرداخت (Payment Details)
   ========================================================================== */
.payment-details-section {
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.payment-header-strip {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  padding: 7px 18px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.payment-summary-rows {
  padding: 12px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.summary-label {
  color: var(--text-secondary);
}

.summary-label small {
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--text-muted);
}

.summary-val {
  font-weight: 700;
  color: var(--text-primary);
}

.discount-val {
  color: var(--success);
}

.summary-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

.total-row {
  padding-top: 2px;
}

.total-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.total-label small {
  font-family: var(--font-en);
  font-size: 10.5px;
  color: var(--text-muted);
}

.total-val {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-primary);
}

/* کد تخفیف (Promo Code) */
.promo-code-form {
  padding: 6px 18px 4px;
  display: flex;
  gap: 8px;
}

.promo-input {
  flex: 1;
  height: 34px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0 11px;
  font-size: 11.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.promo-input:focus {
  background: var(--bg-surface);
  border-color: var(--accent-bright);
}

.promo-apply-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.promo-apply-btn:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  background: var(--accent-soft);
}

.promo-feedback {
  padding: 0 18px;
  font-size: 11px;
  min-height: 16px;
  color: var(--success);
}

.promo-feedback.error {
  color: var(--danger);
}

/* منوی کشویی روش پرداخت */
.payment-method-box {
  padding: 4px 18px 12px;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.payment-method-icon {
  position: absolute;
  right: 11px;
  font-size: 13px;
  color: var(--accent-bright);
  pointer-events: none;
}

.payment-method-select {
  width: 100%;
  height: 36px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0 34px 0 28px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  appearance: none;
  outline: none;
  cursor: pointer;
}

.payment-method-select:focus {
  border-color: var(--accent-bright);
  background: var(--bg-surface);
}

.select-chevron {
  position: absolute;
  left: 11px;
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

/* دکمه بزرگ و تمام‌عرض آبی در پایین سبد خرید */
.checkout-submit-btn {
  margin: 0 18px 16px;
  width: calc(100% - 36px);
  height: 42px;
  border-radius: var(--radius-md);
  background: #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.26);
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.checkout-submit-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.34);
}

.checkout-submit-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   Modals & Toast Notifications
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  background: var(--bg-surface);
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
}

.modal-body {
  padding: 18px;
}

.scanner-viewfinder {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}

.laser-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 35%;
  height: 2px;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: scanLaser 2s infinite alternate ease-in-out;
}

@keyframes scanLaser {
  from { top: 22%; }
  to { top: 75%; }
}

.barcode-graphic {
  font-size: 46px;
  opacity: 0.85;
  margin-bottom: 8px;
}

.scanner-hint {
  font-size: 11.5px;
  color: #cbd5e1;
}

.quick-barcode-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.barcode-Sim-btn {
  padding: 8px 10px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--bg-subtle);
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.barcode-Sim-btn:hover {
  border-color: var(--accent-bright);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.success-modal {
  padding: 24px 20px 8px;
  text-align: center;
}

.success-icon-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #d1fae5;
  color: var(--success);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.success-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.success-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.receipt-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: right;
  font-size: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
}

.toast-container {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-msg {
  background: #1e293b;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-msg i {
  color: #38bdf8;
}

/* ==========================================================================
   Responsive Design (واکنش‌گرایی برای تبلت و موبایل)
   ========================================================================== */
@media (max-width: 1180px) {
  .dashboard-workspace {
    grid-template-columns: 195px minmax(0, 1fr) 300px;
  }
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    padding: 0;
  }
  .app-frame {
    border-radius: 0;
    min-height: 100vh;
  }
  .dashboard-workspace {
    grid-template-columns: 1fr;
  }
  .sidebar-left {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 16px;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 12px;
  }
  .nav-list {
    flex-direction: row;
  }
  .secondary-nav {
    border-top: none;
    padding-top: 0;
  }
  .nav-en {
    display: none;
  }
  .sidebar-right-cart {
    border-left: none;
    border-top: 1px solid var(--border-light);
  }
}

@media (max-width: 580px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  .address-bar {
    display: none;
  }
  .search-box {
    width: 100%;
  }
  .toolbar-controls {
    width: 100%;
    flex-wrap: wrap;
  }
}
