:root {
  --violet-50: #f5f3ff;
  --violet-100: #ede9fe;
  --violet-200: #ddd6fe;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --violet-900: #4c1d95;
  --font-vazir: 'Vazir', Tahoma, sans-serif;
  --radius: 1rem;
  --radius-sm: 0.65rem;
  --shadow: 0 10px 40px rgba(109, 40, 217, 0.12);
  --shadow-card: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-card-hover: 0 12px 32px rgba(109, 40, 217, 0.18);
  --header-h: 3.25rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-vazir);
  font-size: 15px;
  line-height: 1.65;
  color: #0f172a;
  min-height: 100vh;
  background: #f4f6fb;
  -webkit-font-smoothing: antialiased;
}

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

body.story-open { overflow: hidden; }

a { color: var(--violet-700); text-decoration: none; font-weight: 500; }
a:hover { color: var(--violet-600); }

.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

.store-shell { max-width: 480px; margin: 0 auto; padding: 0 0 5.5rem; min-height: 100vh; }

.store-shell-loading {
  opacity: 0;
  transition: opacity 0.35s ease;
}

body:not(.store-splash-pending) .store-shell-loading {
  opacity: 1;
}

.store-banner {
  width: 100vw;
  max-width: none;
  margin-inline: calc(50% - 50vw);
  display: block;
  object-fit: cover;
  object-position: center center;
  height: auto;
  max-height: none;
}
.store-banner.desktop { display: none; }
@media (min-width: 768px) {
  .store-shell { max-width: 960px; }
  .store-banner.mobile { display: none; }
  .store-banner.desktop { display: block; }
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--violet-100);
  position: sticky;
  top: 0;
  z-index: 40;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
  flex-wrap: nowrap;
}

.header-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-icon-btn {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--violet-100);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--violet-700);
  flex-shrink: 0;
  line-height: 0;
  overflow: hidden;
}

.header-icon-btn:has(.icon-badge) {
  overflow: visible;
}

.header-icon-btn .icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.header-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.header-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.header-avatar-fallback[hidden] {
  display: none !important;
}

.header-icon-btn:has(.header-avatar-img) .header-avatar-fallback {
  display: none !important;
}

.header-avatar-fallback .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.header-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 11rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  box-shadow: 0 8px 24px rgba(15,23,42,0.12);
  padding: 0.65rem;
  z-index: 60;
}

.header-dropdown-panel[hidden] { display: none; }

.dropdown-user-name {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.45;
}

.dropdown-user-title {
  font-weight: 600;
  color: #64748b;
}

.dropdown-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
}

.icon-badge, .nav-badge {
  position: absolute;
  inset-block-start: -0.3rem;
  inset-inline-end: -0.3rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  min-height: 1.125rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.nav-icon-wrap {
  position: relative;
  display: inline-flex;
}

/* ——— فیلتر تگ فروشگاه (صفحهٔ اصلی) ——— */
.store-tag-filter-bar {
  margin: 0 1rem 0.5rem;
}

.store-tag-pills-scroll {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.15rem 0;
  -webkit-overflow-scrolling: touch;
}

.store-tag-pill-all,
.store-tag-cat-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid #e8ecf4;
  background: #fff;
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  color: #475569;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.store-tag-pill-all.active,
.store-tag-cat-pill.active {
  border-color: var(--violet-500);
  background: rgba(139, 92, 246, 0.08);
  color: var(--violet-700, #6d28d9);
}

.store-tag-cat-pill.has-selection:not(.active) {
  border-color: #c4b5fd;
}

.store-tag-cat-wrap {
  flex: 0 0 auto;
}

.store-tag-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.store-tag-cat-pill-label {
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-tag-cat-badge {
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--violet-500);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}

/* منوی تگ: تمام‌صفحه روی محتوا، عرض متناسب با برچسب‌ها */
.store-tag-filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
}

.store-tag-filter-overlay:not([hidden]) {
  pointer-events: auto;
}

.store-tag-filter-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  cursor: default;
}

.store-tag-panel-float {
  position: absolute;
  z-index: 1;
  width: max-content;
  min-width: 5.5rem;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid #e8ecf4;
  border-radius: 0.65rem;
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.14);
  max-height: min(46vh, 13.5rem);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.store-tag-panel-inner {
  padding: 0.25rem 0;
  white-space: nowrap;
}

.store-tag-check-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.65rem;
  font-size: 0.8125rem;
  cursor: pointer;
  white-space: nowrap;
}

.store-tag-check-row:hover {
  background: #f8fafc;
}

.store-tag-check-row span {
  padding-left: 0.1rem;
}

.search-wrap {
  margin: 0 1rem 1.25rem;
  position: relative;
}

.search-wrap .icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  width: 1.1rem;
  height: 1.1rem;
}

.search-input {
  width: 100%;
  padding: 0.85rem 2.85rem 0.85rem 1rem;
  border: 1px solid #e8ecf4;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--violet-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.stories-row {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding: 0.5rem 1rem 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.story-item {
  flex: 0 0 auto;
  width: 4.5rem;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
}

.story-cover {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--violet-500);
  padding: 2px;
  background: #fff;
}

.story-item span {
  display: block;
  font-size: 0.7rem;
  margin-top: 0.35rem;
  line-height: 1.3;
  max-width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-grid {
  display: grid;
  gap: 1.15rem;
  padding: 0 1rem 1.5rem;
}

@media (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}
@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

.catalog-sentinel-wrap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 0 0.25rem;
}

.catalog-sentinel-label {
  font-size: 0.8125rem;
  color: var(--muted, #6b7280);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.catalog-sentinel-wrap.catalog-sentinel--loading .catalog-sentinel-label {
  opacity: 1;
}

.catalog-scroll-end {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted, #6b7280);
  padding: 0 1rem 1.25rem;
  margin: 0;
}

.catalog-scroll-end.hidden {
  display: none;
}

.product-card-wrap.hidden { display: none; }

.store-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #eef1f7;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ——— Product card (e-commerce) ——— */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: 1.15rem;
  border: 1px solid #eef1f7;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.product-card.is-out-of-stock {
  opacity: 0.92;
}

.product-card.is-out-of-stock:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

.product-media {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #fafbff 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

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

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

.product-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--violet-100);
  color: var(--violet-600);
}

.product-media-placeholder .icon {
  width: 2rem;
  height: 2rem;
}

.product-media-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.product-media-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  pointer-events: none;
}

.product-pack-label {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  margin-inline-start: auto;
}

.product-media-topbar .product-media-tag {
  position: static;
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-media-tag-warn {
  background: #fef3c7;
  color: #92400e;
}

.product-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.9rem 1rem 1rem;
  gap: 0.65rem;
}

.product-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.55;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.85em;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.product-meta-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

.product-meta-chip span {
  color: #94a3b8;
  font-weight: 500;
}

.product-meta-chip-ok {
  background: #ecfdf5;
  color: #047857;
}

.product-buy-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: auto;
}

.product-price-block.product-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  align-items: stretch;
}

.product-price-block.product-price-row-single {
  display: block;
}

.product-price-block.product-price-row-single .product-price-col-type {
  display: none;
}

.product-price-block.product-price-row-single .product-price-col-amount {
  text-align: center;
}

.product-price-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.product-price-col-type {
  text-align: right;
}

.product-price-col-type .price-select {
  margin-top: auto;
}

.product-price-col-amount {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  text-align: left;
}

.price-select-label,
.price-amount-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
}

.product-price-live {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--violet-700);
  letter-spacing: -0.02em;
  line-height: 2.5rem;
  white-space: nowrap;
  text-align: left;
  width: 100%;
  min-height: 2.5rem;
}

.price-select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.55rem;
  padding-inline-start: 0.55rem;
  padding-inline-end: 1.65rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.8rem;
  color: #334155;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 0.75rem;
  background-position: left calc(0.55rem + 3px) center;
}

.price-select:focus {
  outline: none;
  border-color: var(--violet-500);
  background-color: #fff;
}

.product-cart-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  overflow: hidden;
  flex-shrink: 0;
}

.qty-btn {
  width: 2.25rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: var(--violet-700);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.qty-btn:hover {
  background: var(--violet-50);
}

.qty-input {
  width: 2.5rem;
  border: none;
  border-inline: 1px solid #e2e8f0;
  background: #fff;
  text-align: center;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-add-cart {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--violet-600) 0%, var(--violet-500) 100%);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-add-cart:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
}

.btn-add-cart:active:not(:disabled) {
  transform: translateY(0);
}

.btn-add-cart:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-add-cart .icon {
  width: 1.1rem;
  height: 1.1rem;
  color: #fff;
}

.product-login-cta {
  display: block;
  text-align: center;
  padding: 0.65rem;
  margin-top: auto;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--violet-300, var(--violet-200));
  background: var(--violet-50);
  color: var(--violet-700);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.product-login-cta:hover {
  background: var(--violet-100);
  color: var(--violet-700);
}

/* legacy badges (other pages) */
.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.65rem; }
.badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--violet-100);
  color: var(--violet-900);
  font-weight: 600;
}
.badge.stock-low { background: #fef3c7; color: #92400e; }
.badge.stock-out { background: #fee2e2; color: #991b1b; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 0.65rem;
  font: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--violet-600); color: #fff; }
.btn-primary:hover { background: var(--violet-700); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--violet-200); color: var(--violet-700); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

.alert {
  margin: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--violet-50); color: var(--violet-900); border: 1px solid var(--violet-200); }

.store-header-row {
  position: relative;
}

.store-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--violet-100);
  padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: 480px;
  margin: 0 auto;
}

.store-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.65rem;
  color: #64748b;
  text-decoration: none;
}

.store-nav a.active { color: var(--violet-700); }
.store-nav a .icon { width: 1.35rem; height: 1.35rem; }
.store-nav .nav-label { line-height: 1.2; }

@media (min-width: 768px) {
  .store-shell { max-width: 960px; padding-bottom: 2rem; }

  .store-header-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: var(--header-h);
    align-items: center;
    column-gap: 1rem;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--violet-100);
  }

  .store-header-row .top-bar {
    grid-column: 2;
    grid-row: 1;
    position: static;
    border-bottom: none;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    flex-shrink: 0;
    margin-inline-start: 0;
    height: var(--header-h);
    display: flex;
    align-items: center;
  }

  .store-header-row .store-nav {
    grid-column: 1;
    grid-row: 1;
    position: static;
    flex: none;
    min-width: 0;
    max-width: none;
    left: auto;
    right: auto;
    transform: none;
    margin: 0;
    padding: 0;
    border-top: none;
    background: transparent;
    backdrop-filter: none;
    justify-content: flex-start;
    align-items: center;
    align-self: center;
    height: var(--header-h);
    gap: 0.1rem;
  }

  .store-header-row .store-nav a {
    flex-direction: row;
    align-items: center;
    font-size: 0.82rem;
    line-height: 1;
    padding: 0.45rem 0.7rem;
    gap: 0.35rem;
    border-radius: 0.55rem;
    white-space: nowrap;
  }

  .store-header-row .store-nav .nav-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .store-header-row .store-nav .nav-label {
    line-height: 1;
  }

  .store-header-row .store-nav a:hover,
  .store-header-row .store-nav a.active {
    background: var(--violet-50);
    color: var(--violet-700);
  }

  .store-support-fab { bottom: 1.25rem; }
}

.page-hero { padding: 1rem 1rem 0.5rem; }
.page-hero h1 { margin: 0; font-size: 1.35rem; }
.store-section-title {
  margin: 1.35rem 1rem 0.65rem;
  padding: 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
}

.store-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.store-table th, .store-table td { padding: 0.5rem; border-bottom: 1px solid #f1f5f9; text-align: right; }

.store-cart-table .store-cart-actions-col {
  width: auto;
  min-width: 12.5rem;
  white-space: nowrap;
  text-align: center;
}
.store-cart-table .store-cart-qty-cell { vertical-align: middle; }
.store-cart-table .store-cart-price-cell { white-space: nowrap; }
.store-cart-table .store-cart-actions-cell {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.cart-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
}
.cart-row-actions .btn {
  flex-shrink: 0;
}
.cart-line-qty-form { display: none; margin: 0; }
.cart-line-remove-form { display: inline; margin: 0; }

.cart-row:not(.cart-row--editing) .cart-qty-stepper {
  display: none !important;
}
.cart-row--editing .cart-qty-readonly {
  display: none;
}
.cart-qty-label {
  color: #64748b;
  font-weight: 600;
  font-size: 0.85em;
}
/* ورودی داخل .qty-stepper با همان استایل صفحهٔ محصول */

.cart-row--editing .store-cart-qty-cell {
  text-align: center;
}
.cart-row--editing .cart-qty-stepper {
  margin-inline: auto;
}

.cart-row:not(.cart-row--editing) .js-cart-row-submit,
.cart-row:not(.cart-row--editing) .js-cart-row-cancel { display: none !important; }
.cart-row--editing .js-cart-row-edit { display: none !important; }

.cart-remove-btn { color: #b91c1c; border-color: #fecaca; }
.cart-remove-btn:hover { background: #fef2f2; }

.store-cart-total {
  font-weight: 700;
  margin-top: 1rem;
  text-align: left;
}

/* سبد خرید — موبایل: ردیف ۱ نام، ردیف ۲ تعداد + مبلغ، ردیف ۳ عملیات */
@media (max-width: 767px) {
  .store-cart-table.store-table {
    border-collapse: separate;
    border-spacing: 0;
  }
  .store-cart-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .store-cart-table tbody {
    display: block;
  }
  .store-cart-table tbody tr.cart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 0.75rem;
    row-gap: 0.35rem;
    padding: 0.75rem 0;
    margin: 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
  }
  .store-cart-table tbody tr.cart-row > td {
    padding: 0;
    border-bottom: none;
    vertical-align: middle;
    min-width: 0;
  }
  .store-cart-table tbody tr.cart-row > td:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    word-break: break-word;
  }
  .store-cart-table tbody tr.cart-row > td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    text-align: start;
  }
  .store-cart-table tbody tr.cart-row > td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    text-align: end;
  }
  .store-cart-table tbody tr.cart-row > td:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;
    text-align: center;
    padding-top: 0.25rem;
    margin-top: 0.15rem;
    border-top: 1px solid #f1f5f9;
  }
  .store-cart-table .cart-row-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }
}

.ledger-summary {
  margin: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.ledger-summary.debtor { background: #fef2f2; color: #991b1b; }
.ledger-summary.creditor { background: #ecfdf5; color: #065f46; }
.ledger-summary.zero { background: #f8fafc; color: #64748b; }

.ledger-card {
  margin: 0 1rem;
}

.ledger-table-wrap {
  padding: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ledger-table th {
  white-space: nowrap;
  font-size: 0.78rem;
  color: #64748b;
}

.ledger-table .ledger-desc-cell {
  min-width: 8rem;
  max-width: 14rem;
  word-break: break-word;
  line-height: 1.5;
}

.ledger-table .ledger-amount-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ledger-balance-cell {
  white-space: nowrap;
}

.ledger-balance-inner {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rial-amount {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.rial-number {
  font-weight: 600;
  text-align: right;
}

.rial-unit {
  font-size: 0.72em;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.ledger-mobile-meta {
  display: none;
}

.ledger-side {
  display: inline-block;
  flex-shrink: 0;
  min-width: 1.75rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}
.ledger-side-debit { background: #fee2e2; color: #991b1b; }
.ledger-side-credit { background: #ecfdf5; color: #065f46; }
.ledger-side-zero { background: #f1f5f9; color: #64748b; }

.ledger-debit-cell.has-value { color: #991b1b; }
.ledger-credit-cell.has-value { color: #065f46; }

@media (max-width: 767.98px) {
  #tab-ledger.account-panel {
    padding: 0 0 1rem;
  }

  .ledger-summary {
    margin: 0.75rem 1rem;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .ledger-card {
    margin: 0 0.75rem;
    border-radius: var(--radius-sm);
  }

  .ledger-table-wrap {
    padding: 0.65rem;
    overflow-x: visible;
  }

  .ledger-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .ledger-table thead,
  .ledger-table .ledger-desktop-only {
    display: none !important;
  }

  .ledger-table tbody tr.ledger-row {
    display: block;
    margin-bottom: 0.65rem;
    padding: 0.7rem 0.75rem;
    background: #fafbfc;
    border: 1px solid #e8edf3;
    border-radius: var(--radius-sm);
  }

  .ledger-table tbody tr.ledger-row:last-child {
    margin-bottom: 0;
  }

  .ledger-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed #e8edf3;
    font-size: 0.82rem;
    white-space: normal;
  }

  .ledger-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    min-width: 3.5rem;
    font-weight: 600;
    color: #64748b;
    font-size: 0.72rem;
    text-align: right;
    line-height: 1.45;
  }

  .ledger-mobile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0;
    border-bottom: 1px dashed #e8edf3;
  }

  .ledger-mobile-meta::before {
    content: none !important;
  }

  .ledger-mobile-date {
    font-weight: 600;
    font-size: 0.82rem;
    color: #334155;
    white-space: nowrap;
  }

  .ledger-mobile-txn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    direction: ltr;
  }

  .ledger-mobile-txn-label {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.35rem;
    border-radius: 0.3rem;
    white-space: nowrap;
  }

  .ledger-mobile-txn.ledger-debit-cell.has-value .ledger-mobile-txn-label {
    background: #fee2e2;
    color: #991b1b;
  }

  .ledger-mobile-txn.ledger-credit-cell.has-value .ledger-mobile-txn-label {
    background: #ecfdf5;
    color: #065f46;
  }

  .ledger-table tbody td.ledger-desc-cell {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    line-height: 1.55;
    word-break: break-word;
  }

  .ledger-table tbody td.ledger-desc-cell::before {
    flex-shrink: 0;
    color: #475569;
    min-width: 0;
  }

  .ledger-desc-text {
    display: block;
    width: 100%;
    font-size: 0.82rem;
    color: #0f172a;
    line-height: 1.6;
    word-break: break-word;
  }

  .ledger-table tbody td.ledger-balance-cell {
    align-items: flex-start;
    padding-top: 0.6rem;
    margin-top: 0.15rem;
    border-bottom: none;
    border-top: 1px solid #dde4ec;
  }

  .ledger-table tbody td.ledger-balance-cell::before {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: #334155;
    font-weight: 600;
    padding-top: 0.15rem;
  }

  .ledger-balance-inner {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    direction: ltr;
    gap: 0.45rem;
    min-width: 0;
  }

  .ledger-balance-inner .rial-amount {
    flex-shrink: 1;
    min-width: 0;
  }

  .ledger-balance-inner .rial-number {
    font-size: 0.84rem;
    word-break: break-all;
  }

  .ledger-side {
    flex-shrink: 0;
  }

  .account-tabs {
    padding: 0 0.75rem;
  }

  .account-tab {
    font-size: 0.78rem;
    padding: 0.5rem 0.35rem;
  }
}

.account-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 1rem;
  margin-bottom: 0.75rem;
}

.account-tab {
  flex: 1;
  padding: 0.55rem;
  border: 1px solid var(--violet-100);
  border-radius: 0.5rem;
  background: #fff;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.account-tab.active { background: var(--violet-600); color: #fff; border-color: var(--violet-600); }

.account-panels-wrap {
  padding-bottom: 0.5rem;
}

.account-panel { display: none; padding: 0 1rem 1rem; }
.account-panel.active { display: block; }

@media (max-width: 767.98px) {
  .store-header-row > .store-nav {
    position: fixed;
    z-index: 50;
  }
}

.order-summary-card .order-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.35rem;
}
.order-summary-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
}
.order-summary-doc {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}
.order-summary-kind {
  color: #64748b;
  font-weight: 600;
  font-size: 0.82rem;
}
.order-summary-num { margin-inline-start: 0.15rem; }
.order-summary-sep { color: #cbd5e1; margin: 0 0.25rem; font-weight: 400; }
.order-summary-when { font-weight: 600; color: #0f172a; }
.order-summary-print { flex-shrink: 0; }

.progress-steps { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.progress-step {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}
.progress-step.done { background: #d1fae5; color: #065f46; }
.progress-step.current { background: var(--violet-600); color: #fff; }
.progress-step.pending { background: #f1f5f9; color: #64748b; }

.warranty-case-card { padding: 1rem; }
.warranty-case-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.warranty-case-title { font-weight: 700; font-size: 0.95rem; color: #0f172a; }
.warranty-case-status {
  font-size: 0.8rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
}
.warranty-case-grid { margin: 0; display: grid; gap: 0.35rem; }
.warranty-case-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 38%) 1fr;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  font-size: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.4rem;
}
.warranty-case-row:last-of-type { border-bottom: none; padding-bottom: 0; }
.warranty-case-row dt { color: #64748b; font-weight: 600; margin: 0; }
.warranty-case-row dd { margin: 0; text-align: right; color: #0f172a; }
.warranty-case-row--pair {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.warranty-case-field {
  display: grid;
  grid-template-columns: minmax(7.5rem, 38%) 1fr;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  font-size: 0.85rem;
}
.warranty-case-field dt { color: #64748b; font-weight: 600; margin: 0; }
.warranty-case-field dd { margin: 0; text-align: right; color: #0f172a; }
@media (min-width: 768px) {
  .warranty-case-row--pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.25rem;
    align-items: start;
  }
  .warranty-case-row--pair .warranty-case-field {
    grid-template-columns: minmax(5.5rem, 42%) 1fr;
    padding-bottom: 0;
    border-bottom: none;
  }
}
.warranty-case-mono { font-family: ui-monospace, monospace; font-size: 0.78rem; word-break: break-all; }
.warranty-steps-caption {
  font-size: 0.72rem;
  color: #64748b;
  margin: 0.85rem 0 0.35rem;
  font-weight: 600;
}
.warranty-process-steps { margin-top: 0.15rem; }
@media (max-width: 480px) {
  .warranty-case-row:not(.warranty-case-row--pair) { grid-template-columns: 1fr; }
  .warranty-case-row:not(.warranty-case-row--pair) dd { text-align: right; }
  .warranty-case-field { grid-template-columns: 1fr; }
  .warranty-case-field dd { text-align: right; }
}

.store-notification-card { padding: 1rem 1.1rem; }
.store-notification-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.store-notification-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
  background: #ede9fe;
  color: #5b21b6;
}
.store-notification-time {
  font-size: 0.78rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.store-notification-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
.store-notification-summary {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.5;
}
.store-notification-details {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}
.store-notification-row {
  display: grid;
  grid-template-columns: minmax(7rem, 34%) 1fr;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  font-size: 0.82rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #f1f5f9;
}
.store-notification-row:last-child { border-bottom: none; padding-bottom: 0; }
.store-notification-row dt { margin: 0; color: #64748b; font-weight: 600; }
.store-notification-row dd { margin: 0; text-align: right; color: #0f172a; word-break: break-word; }
.store-notification-steps-caption {
  font-size: 0.72rem;
  color: #64748b;
  margin: 0.75rem 0 0.35rem;
  font-weight: 600;
}
.store-notification-steps { margin-top: 0.1rem; }
@media (max-width: 480px) {
  .store-notification-row { grid-template-columns: 1fr; }
  .store-notification-row dd { text-align: right; }
}

.login-card { max-width: 400px; margin: 2rem auto; padding: 0 1rem; }
.form-group { margin-bottom: 0.85rem; }
.form-group label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; font-weight: 600; }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font: inherit;
}

#story-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#story-viewer[hidden] { display: none; }

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

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

.story-overlay-btn {
  position: absolute;
  z-index: 3;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.story-close-btn { top: 0.75rem; left: 0.75rem; }
.story-mute-btn { top: 0.75rem; right: 0.75rem; }
.story-overlay-btn .icon { width: 1.1rem; height: 1.1rem; }

.story-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.story-nav-btn .icon { width: 1rem; height: 1rem; }
.story-nav-prev { right: 0.75rem; }
.story-nav-next { left: 0.75rem; }

body.story-open .stories-row { visibility: hidden; }

#login-popup {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15,23,42,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#login-popup.hidden { display: none; }

.login-popup-card {
  background: #fff;
  border-radius: 0.5rem;
  max-width: 360px;
  width: 100%;
  padding: 1px;
  position: relative;
  text-align: center;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: none;
}

.login-popup-card img {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  display: block;
  vertical-align: top;
}

.login-popup-card p {
  margin: 0;
  padding: 0.5rem 0.65rem 0.65rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.login-popup-close {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}
.login-popup-close .icon { width: 0.9rem; height: 0.9rem; }

.store-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 120;
  background: #065f46;
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}
.store-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.store-toast.hide {
  transform: translateX(-50%) translateY(-120%);
  opacity: 0;
}

.checks-table .checks-empty {
  text-align: center;
  color: #64748b;
  padding: 1.25rem 0.5rem;
}
.check-row-overdue td { background: #fff7ed; }
.check-status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.check-status-pending { background: #f1f5f9; color: #475569; }
.check-status-clearing { background: #dbeafe; color: #1d4ed8; }
.check-status-cashed { background: #dcfce7; color: #166534; }
.check-status-returned { background: #fee2e2; color: #991b1b; }
.check-status-spent { background: #ffedd5; color: #9a3412; }

.proforma-print { padding: 1rem; background: #fff; margin: 1rem; border-radius: var(--radius); border: 1px solid #e2e8f0; }

/* ——— دیالوگ تغییر رمز (پروفایل هدر) ——— */
#store-open-change-password {
  margin-top: 0.35rem;
  margin-bottom: 0.45rem;
}

.store-password-dialog {
  position: fixed;
  inset: 0;
  z-index: 92;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.store-password-dialog[hidden] {
  display: none !important;
}

.store-password-dialog-card {
  position: relative;
  width: 100%;
  max-width: 22rem;
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
  padding: 1.1rem 1rem 1rem;
  text-align: right;
}

.store-password-dialog-close {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  background: #f8fafc;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.store-password-dialog-close .icon {
  width: 0.9rem;
  height: 0.9rem;
}

.store-password-dialog-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  padding-left: 2rem;
}

.store-password-dialog-error {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: #b91c1c;
  line-height: 1.45;
}

.store-password-dialog-form .form-group {
  margin-bottom: 0.65rem;
}

.store-password-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.85rem;
  padding-top: 0.25rem;
}

/* ——— صفحهٔ اصلی (دیجی‌کالایی) ——— */
.store-home-page { padding-bottom: 0.5rem; }

.home-hero-slider {
  /* نسبت از ارتفاع تعیینی ادمین می‌آید (عرض مرجع موبایل ۳۹۰ / دسکتاپ ۱۴۴۰) */
  --hero-aspect: var(--hero-aspect-mobile, 390 / 171);
  position: relative;
  width: 100vw;
  max-width: none;
  margin-inline: calc(50% - 50vw);
  overflow: hidden;
  background: var(--hero-bg, #0f172a);
}
.home-hero-track {
  position: relative;
  width: 100%;
  aspect-ratio: var(--hero-aspect);
}
.home-hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.45s ease; pointer-events: none;
  display: block;
}
.home-hero-slide.is-active { opacity: 1; pointer-events: auto; }
.home-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* تصویر از قبل با همان نسبت برش شده؛ cover دوباره برش نزند */
  object-fit: fill;
  object-position: center center;
  display: block;
}
.home-hero-img--desktop { display: none; }
@media (min-width: 768px) {
  .home-hero-slider { --hero-aspect: var(--hero-aspect-desktop, 1440 / 480); }
  .home-hero-img--mobile { display: none; }
  .home-hero-img--desktop { display: block; }
}
.home-hero-dots {
  position: absolute; bottom: 0.5rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.35rem; z-index: 2;
}
.home-hero-dot {
  width: 0.45rem; height: 0.45rem; border-radius: 999px; border: none; padding: 0;
  background: rgba(255,255,255,0.45); cursor: pointer;
}
.home-hero-dot.is-active { background: #fff; width: 1.1rem; }

.home-section { margin: 1rem 0 1.25rem; padding: 0 0.75rem; }
.home-section-heading {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}
.home-section-heading--center { justify-content: center; }
.home-section-heading--start { justify-content: flex-start; }
.home-section-heading--end { justify-content: flex-end; }
.home-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--home-title-color, #1e1b4b);
}
.home-section-heading--center .home-section-title { text-align: center; }
.home-section-heading--start .home-section-title { text-align: start; }
.home-section-heading--end .home-section-title { text-align: end; }
.home-section-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--home-icon-color, #f59e0b);
  flex-shrink: 0;
}
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }

.home-hero-slider .home-section-heading {
  position: relative;
  z-index: 2;
  margin: 0.75rem 0.75rem 0.5rem;
  max-width: 960px;
  margin-inline: auto;
  padding-inline: 0.75rem;
}
.home-hero-slider .home-section-title {
  color: var(--home-title-color, #ffffff);
}
.home-hero-slider .home-section-icon {
  color: var(--home-icon-color, #f59e0b);
}

.home-amazing-offer {
  --amazing-from: #e6123d;
  --amazing-to: #c90c32;
  --amazing-title-color: #ffffff;
  --amazing-icon-color: #ffffff;
  --amazing-title-size: var(--amazing-title-size-mobile, 0.95rem);
  --amazing-icon-size: var(--amazing-icon-size-mobile, 1.35rem);
  --amazing-title-gap: var(--amazing-title-gap-mobile, 0.35rem);
  margin: 1rem 0.75rem 1.25rem;
  border-radius: 1rem;
  overflow: hidden;
  /* شروع=راست ، پایان=چپ */
  background: linear-gradient(to left, var(--amazing-from) 0%, var(--amazing-to) 100%);
  box-shadow: 0 4px 14px rgba(230, 18, 61, 0.22);
}
.home-amazing-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.home-amazing-panel {
  display: none;
}
.home-amazing-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem 0.55rem;
  color: var(--amazing-title-color);
}
.home-amazing-mobile-brand {
  display: flex;
  align-items: center;
  gap: var(--amazing-title-gap);
  min-width: 0;
}
.home-amazing-mobile-title {
  font-size: var(--amazing-title-size);
  font-weight: 800;
  white-space: nowrap;
  color: var(--amazing-title-color);
}
.home-amazing-percent-icon {
  position: relative;
  width: var(--amazing-icon-size);
  height: var(--amazing-icon-size);
  flex-shrink: 0;
}
.home-amazing-panel .home-amazing-percent-icon {
  width: var(--amazing-icon-size);
  height: var(--amazing-icon-size);
  margin-bottom: 0.15rem;
}
.home-amazing-percent-sign {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--amazing-icon-size) * 0.72);
  font-weight: 900;
  line-height: 1;
  color: var(--amazing-icon-color);
}
.home-amazing-lucide-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.home-amazing-lucide-icon {
  width: var(--amazing-icon-size);
  height: var(--amazing-icon-size);
  color: var(--amazing-icon-color);
  stroke-width: 2;
}
.home-amazing-panel .home-amazing-lucide-icon {
  width: var(--amazing-icon-size);
  height: var(--amazing-icon-size);
}
.home-amazing-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  direction: ltr;
}
.home-amazing-countdown-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.25rem;
  border-radius: 0.35rem;
  background: #fff;
  color: #1e1b4b;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.home-amazing-panel .home-amazing-countdown-box {
  min-width: 2.1rem;
  height: 2.1rem;
  font-size: 0.95rem;
  border-radius: 0.45rem;
}
.home-amazing-countdown-sep {
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1;
}
.home-amazing-view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.home-amazing-view-all--panel { margin-top: auto; font-size: 0.85rem; }
.home-amazing-view-all--mobile { font-size: 0.75rem; }
.home-amazing-chevron { width: 0.85rem; height: 0.85rem; }
.home-amazing-products-wrap {
  position: relative;
  min-width: 0;
  padding: 0 0 0.65rem;
}
.home-amazing-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 0 0.65rem;
}
@media (max-width: 767.98px) {
  .home-amazing-products-wrap {
    padding-inline: 0.65rem;
    padding-bottom: 0.65rem;
  }
  .home-amazing-scroll {
    padding: 0;
    gap: 0.5rem;
  }
  .home-amazing-card {
    border-inline-start: none;
    border-radius: 0.65rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  }
}
.home-amazing-scroll::-webkit-scrollbar { height: 0; display: none; }
.home-amazing-nav {
  display: none;
}
.home-amazing-card {
  flex: 0 0 9.75rem;
  scroll-snap-align: start;
  background: #fff;
  border-inline-start: 1px solid #eef2f7;
}
.home-amazing-card:first-child { border-inline-start: none; }
.home-amazing-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.65rem 0.55rem 0.7rem;
  text-decoration: none;
  color: inherit;
}
.home-amazing-card-media {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.45rem;
  background: #fff;
}
.home-amazing-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.15rem;
}
.home-amazing-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #cbd5e1;
}
.home-amazing-card-title {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: right;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
  color: #334155;
}
.home-amazing-card-price-block { margin-top: auto; text-align: right; }
.home-amazing-card-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}
.home-amazing-card-discount {
  background: #ef394e;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.12rem 0.35rem;
  border-radius: 999px;
  line-height: 1.2;
}
.home-amazing-card-old {
  font-size: 0.62rem;
  color: #94a3b8;
  text-decoration: line-through;
}
.home-amazing-card-price {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e1b4b;
  text-align: right;
  line-height: 1.35;
}

@media (min-width: 768px) {
  .home-amazing-offer {
    --amazing-title-size: var(--amazing-title-size-desktop, 1.05rem);
    --amazing-icon-size: var(--amazing-icon-size-desktop, 3.25rem);
    --amazing-title-gap: var(--amazing-title-gap-desktop, 0.85rem);
  }
  .home-amazing-shell {
    flex-direction: row;
    align-items: stretch;
  }
  .home-amazing-panel {
    display: flex;
    flex: 0 0 11.5rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--amazing-title-gap);
    padding: 1.25rem 0.85rem;
    color: var(--amazing-title-color);
    text-align: center;
  }
  .home-amazing-panel-title {
    margin: 0;
    font-size: var(--amazing-title-size);
    font-weight: 800;
    line-height: 1.55;
    color: var(--amazing-title-color);
  }
  .home-amazing-mobile-head { display: none; }
  .home-amazing-products-wrap {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 0 0.85rem 0.35rem;
  }
  .home-amazing-scroll {
    padding: 0;
    border-radius: 0.85rem 0 0 0.85rem;
    background: #fff;
  }
  .home-amazing-card {
    flex: 0 0 12.5rem;
  }
  .home-amazing-card-link { padding: 0.85rem 0.75rem 0.9rem; }
  .home-amazing-card-title { font-size: 0.78rem; min-height: 2.35em; }
  .home-amazing-card-price { font-size: 0.9rem; }
  .home-amazing-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    cursor: pointer;
  }
  .home-amazing-nav-prev {
    left: 0.15rem;
  }
  .home-amazing-nav:disabled {
    opacity: 0.35;
    cursor: default;
  }
}

@media (min-width: 1024px) {
  .home-amazing-panel { flex-basis: 13rem; }
  .home-amazing-card { flex: 0 0 13.5rem; }
}

.home-countdown { text-align: left; color: #fff; font-size: 0.75rem; }
.home-countdown-value { display: block; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.05em; }

.home-scroll-row {
  display: flex; gap: 0.65rem; overflow-x: auto; padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.home-scroll-row::-webkit-scrollbar { height: 4px; }
.home-scroll-row::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.product-compact-card {
  flex: 0 0 9.5rem; scroll-snap-align: start;
  background: #fff; border-radius: var(--radius-sm); border: 1px solid #e2e8f0;
  overflow: hidden; box-shadow: var(--shadow-card);
}
.product-compact-media { display: block; aspect-ratio: 1; background: #f8fafc; }
.product-compact-media img { width: 100%; height: 100%; object-fit: contain; padding: 0.35rem; }
.product-compact-body { padding: 0.45rem 0.5rem 0.55rem; }
.product-compact-title {
  margin: 0 0 0.35rem; font-size: 0.72rem; font-weight: 600; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.1em;
}
.product-compact-prices { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.product-compact-discount { background: #ef4444; color: #fff; font-size: 0.65rem; padding: 0.1rem 0.3rem; border-radius: 0.25rem; font-weight: 700; }
.product-compact-old { font-size: 0.65rem; color: #94a3b8; }
.product-compact-price { font-size: 0.78rem; color: #1e1b4b; }
.btn-add-cart-mini {
  margin-top: 0.35rem; width: 100%; border: none; border-radius: 0.45rem;
  background: var(--violet-600); color: #fff; padding: 0.35rem; cursor: pointer;
}

.home-mosaic-section--desktop { display: none; }
.home-mosaic-grid {
  display: grid;
  grid-template-columns: repeat(var(--mosaic-cols, 2), minmax(0, 1fr));
  gap: 0.5rem;
}
.home-mosaic-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: var(--mosaic-height, 140px);
  display: block;
  box-shadow: var(--shadow-card);
}
.home-mosaic-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}
.home-mosaic-caption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 0.35rem 0.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.65)); color: #fff; font-size: 0.75rem; font-weight: 600;
  z-index: 1;
}
@media (min-width: 768px) {
  .home-mosaic-section--mobile { display: none; }
  .home-mosaic-section--desktop { display: block; }
}

.home-category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem;
}
.home-category-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  text-decoration: none; color: inherit; gap: 0.35rem;
}
.home-category-card img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 999px; border: 2px solid var(--violet-100);
}
.home-category-card span { font-size: 0.72rem; font-weight: 600; line-height: 1.35; }

/* ——— برندها: موبایل کارت / دسکتاپ نوار افقی ——— */
.home-brands-section .home-section-heading {
  margin-bottom: 0.95rem;
}

.home-brands-strip-wrap {
  position: relative;
}

.home-brands-strip {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 0.15rem 0.1rem 0.35rem;
}

.home-brands-strip::-webkit-scrollbar { height: 0; display: none; }

.home-brand-item {
  flex: 0 0 7.25rem;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e8edf3;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.home-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1.15;
  background: #f3f4f6;
  padding: 0.85rem;
}

.home-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-brand-name {
  display: block;
  padding: 0.55rem 0.4rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  color: #334155;
  background: #fff;
  border-top: 1px solid #eef2f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-brands-nav { display: none; }

@media (min-width: 768px) {
  .home-brands-strip-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    background: #fff;
    overflow: hidden;
  }

  .home-brands-strip {
    gap: 0;
    padding: 0;
    scroll-snap-type: none;
    justify-content: center;
  }

  .home-brand-item {
    flex: 0 0 12.5%;
    min-width: 7.5rem;
    border: none;
    border-radius: 0;
    box-shadow: none;
    border-inline-start: 1px solid #eef2f7;
    background: transparent;
  }

  .home-brand-item:first-child {
    border-inline-start: none;
  }

  .home-brand-logo {
    aspect-ratio: auto;
    min-height: 5.5rem;
    background: transparent;
    padding: 1.1rem 1rem;
  }

  .home-brand-name {
    display: none;
  }

  .home-brands-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
    cursor: pointer;
  }

  .home-brands-nav-prev { inset-inline-start: 0.55rem; }
  .home-brands-nav-next { inset-inline-end: 0.55rem; }
  .home-brands-nav:disabled { opacity: 0.35; cursor: default; }
  .home-brands-nav .icon { width: 1.1rem; height: 1.1rem; }
}

.home-featured-wrap {
  display: grid; grid-template-columns: 1fr; gap: 0.75rem;
  background: #fff; border-radius: var(--radius); border: 1px solid #e2e8f0; padding: 0.75rem;
}
@media (min-width: 640px) { .home-featured-wrap { grid-template-columns: 1fr 1fr; align-items: center; } }
.home-featured-media { border-radius: 0.65rem; overflow: hidden; background: #000; }
.home-featured-video, .home-featured-media img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.home-featured-info h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.home-featured-price { margin: 0 0 0.65rem; font-weight: 700; color: var(--violet-700); }

.store-footer {
  margin: 1.5rem 0.75rem 0; padding: 1rem 0 0.5rem; border-top: 1px solid #e2e8f0;
}
.store-footer-grid { display: grid; gap: 0.5rem; }
.store-footer-block summary {
  cursor: pointer; font-weight: 700; font-size: 0.85rem; padding: 0.35rem 0; list-style: none;
}
.store-footer-block summary::-webkit-details-marker { display: none; }
.store-footer-text { font-size: 0.8rem; color: #64748b; line-height: 1.65; padding-bottom: 0.5rem; }

.store-support-fab {
  position: fixed; left: 0.85rem; bottom: 4.75rem; z-index: 45;
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: #fff; color: var(--violet-700); border: 1px solid var(--violet-200);
  border-radius: 999px; padding: 0.45rem 0.75rem 0.45rem 0.55rem;
  box-shadow: 0 8px 24px rgba(109,40,217,0.18); text-decoration: none; font-size: 0.72rem; font-weight: 700;
}
.store-support-fab .icon { width: 1.1rem; height: 1.1rem; }
@media (min-width: 768px) { .store-support-fab { bottom: 1.25rem; } }

.store-products-toolbar { margin: 0 1rem 0.75rem; }
.store-products-hero { margin-top: 0.25rem; }
