/* FILE: style.css — AiQio — تم شبیه اپل استور (پاکسازی‌شده) */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;

  --bg-base: #f5f5f7;
  --bg-card: #ffffff;
  --bg-raised: #ffffff;
  --bg-input: #f5f5f7;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-elevated: #ffffff;
  --glass-blur: 20px;
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-sheen: linear-gradient(180deg, rgba(255,255,255,0.4), transparent 40%);

  --border: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --rim: rgba(0, 0, 0, 0.08);

  --text-primary: #1d1d1f;
  --text-muted: #6e6e73;
  --text-disabled: #86868b;

  --accent: #0071e3;
  --accent-dim: #0077ed;
  --accent-glow: rgba(0, 113, 227, 0.25);
  --on-accent: #ffffff;

  --success: #34c759;
  --warning: #ff9500;
  --danger: #ff3b30;
  --success-text: #248a3d;
  --warning-text: #c93400;
  --danger-text: #d70015;
  --star: #ff9f0a;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-pill: 980px;

  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-pop: 0 20px 60px rgba(0, 0, 0, 0.12);
  --shadow-glass: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-glass-hover: 0 8px 32px rgba(0, 0, 0, 0.1);

  --t: 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --t-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --nav-h: 52px;
  --bottom-nav-h: 64px;
  --font: "Ravi", system-ui, -apple-system, "SF Pro Text", "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg-base: #000000;
  --bg-card: #1c1c1e;
  --bg-raised: #2c2c2e;
  --bg-input: #1c1c1e;
  --bg-glass: rgba(28, 28, 30, 0.78);
  --bg-elevated: #2c2c2e;
  --glass-blur: 24px;
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-sheen: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 40%);

  --border: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --rim: rgba(255, 255, 255, 0.12);

  --text-primary: #f5f5f7;
  --text-muted: #a1a1a6;
  --text-disabled: #6e6e73;

  --accent: #0a84ff;
  --accent-dim: #409cff;
  --accent-glow: rgba(10, 132, 255, 0.3);
  --on-accent: #ffffff;

  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff453a;
  --success-text: #30d158;
  --warning-text: #ff9f0a;
  --danger-text: #ff453a;
  --star: #ff9f0a;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-glass: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-glass-hover: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* ---------- 2. Base (بازیابی‌شده) ---------- */

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

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--bg-base);
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  transition: background-color 0.3s ease, color 0.3s ease;
  word-spacing: 0.12em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: min(100% - 2 * var(--s2), 1120px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body[data-page="detail"] {
  scroll-padding-top: calc(var(--nav-h) + 64px);
}

[data-theme="light"] body,
body:has([data-theme="light"]) {
  /* fallback if attribute on html */
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t);
}

a:hover {
  color: var(--accent-dim);
}

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

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.container {
  width: min(100% - 2 * var(--s2), 1120px);
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 200;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

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

.ltr {
  direction: ltr;
  text-align: right;
}

/* ---------- 3. Buttons — Apple style ---------- */

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

[data-theme="dark"] .btn-ghost:hover:not(:disabled) {
  background: rgba(10, 132, 255, 0.15);
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.1);
}

.icon-btn:active {
  background: var(--border);
}

.icon-btn-sm {
  width: 34px;
  height: 34px;
}

.icon-btn-done {
  background: rgba(52, 199, 89, 0.15);
  color: var(--success-text);
}

.icon-btn:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* ---------- 4. Navbar, bottom nav, footer ---------- */

.nav {
  display: flex;
  align-items: center;
  gap: var(--s1);
  height: var(--nav-h);
}

.logo:hover {
  color: var(--text-primary);
  opacity: 0.8;
}

.nav-links {
  margin-inline: auto;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
}

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

.nav-actions {
  margin-inline-start: auto;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--t), color var(--t);
}

.theme-toggle:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.search-box {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border-radius: var(--r-pill);
  padding: 0 14px;
  height: 36px;
  min-width: 180px;
  transition: box-shadow var(--t);
}

.search-box:focus-within {
  box-shadow: 0 0 0 2px var(--accent);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 0.875rem;
  color: var(--text-primary);
  min-width: 0;
}

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

@media (min-width: 768px) {
  .search-box {
    display: flex;
  }
}

@media (min-width: 900px) {
  .bottom-nav {
    display: none;
  }
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t);
}

.bn-item.active,
.bn-item:hover {
  color: var(--accent);
}

.bn-item svg {
  width: 24px;
  height: 24px;
}

.footer-inner {
  display: grid;
  gap: var(--s4);
}

@media (min-width: 700px) {
  .footer-inner {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  padding: 4px 0;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- 5. Forms ---------- */

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

.label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: var(--s3);
}

.form-row {
  display: grid;
  gap: var(--s2);
}

@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.checkbox,
.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9375rem;
}

.checkbox input,
.radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ---------- 6. Badges & stars ---------- */

.badge-accent {
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent);
}

[data-theme="dark"] .badge-accent {
  background: rgba(10, 132, 255, 0.2);
}

.badge-success {
  background: rgba(52, 199, 89, 0.12);
  color: var(--success-text);
}

.badge-warn {
  background: rgba(255, 149, 0, 0.12);
  color: var(--warning-text);
}

.stars .empty {
  color: var(--text-disabled);
  opacity: 0.4;
}

.rating-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-inline-start: 4px;
}

/* ---------- 7. Product card (matches JS structure) ---------- */

.product-card:hover .pc-icon,
.product-card:hover .pc-top > img {
  transform: scale(1.05);
}

.pc-title a {
  color: inherit;
}

.pc-title a:hover {
  color: var(--accent);
}

.product-card .icon-btn {
  background: var(--bg-input);
}

.product-card .icon-btn:hover {
  background: var(--border);
}

[data-theme="dark"] .badge-uc {
  background: oklch(0.3 0.04 var(--h, 250));
  color: oklch(0.85 0.06 var(--h, 250));
}

.badge[style*="--c"] {
  background: color-mix(in oklch, var(--c) 15%, transparent);
  color: var(--c);
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-raised) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sk-card {
  height: 280px;
}

.sk-row {
  display: flex;
  gap: var(--s2);
  overflow: hidden;
}

/* ---------- 8. Home page ---------- */

[data-theme="dark"] .hero-badge {
  background: rgba(10, 132, 255, 0.15);
}

.slides {
  display: flex;
  gap: var(--s2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--s2) 0;
  margin: 0 calc(-1 * var(--s2));
  padding-inline: var(--s2);
  scrollbar-width: none;
}

.slides::-webkit-scrollbar {
  display: none;
}

.slide-emoji {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background var(--t), border-color var(--t), color var(--t);
  white-space: nowrap;
}

.chip:hover,
.chip.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-base);
}

[data-theme="dark"] .chip:hover,
[data-theme="dark"] .chip.active {
  background: #f5f5f7;
  color: #000;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
  text-align: center;
}

@media (min-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stats-grid dt {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.stats-grid dd {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.feature-grid {
  display: grid;
  gap: var(--s3);
}

@media (min-width: 700px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  margin-bottom: var(--s2);
}

[data-theme="dark"] .feature-icon {
  background: rgba(10, 132, 255, 0.15);
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- 9. Products list ---------- */

.products-layout {
  display: grid;
  gap: var(--s3);
  padding: var(--s3) 0;
}

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

.filter-group h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--t);
}

.filter-option:hover {
  background: var(--bg-input);
}

.products-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s2);
}

.results-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.sort-select {
  margin-inline-start: auto;
  min-width: 160px;
}

/* ---------- 10. Product detail ---------- */

.detail-layout {
  display: grid;
  gap: var(--s4);
  padding: var(--s4) 0;
}

@media (min-width: 800px) {
  .detail-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.detail-gallery {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.detail-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.detail-price {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 16px 0;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.detail-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 24px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- 11. Dashboard ---------- */

.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s4) 0 var(--s3);
}

.dash-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s2);
  margin-bottom: var(--s4);
}

.dash-stat {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: var(--s3);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.dash-stat .val {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-stat .lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.dash-table th,
.dash-table td {
  padding: 14px 16px;
  text-align: start;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
}

.dash-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dash-table tr:last-child td {
  border-bottom: none;
}

.dash-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.dash-tab {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t), border-color var(--t);
}

.dash-tab.active,
.dash-tab:hover {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* ---------- 12. Dialog & toast ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s2);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  width: min(100%, 420px);
  max-height: 90dvh;
  overflow-y: auto;
  padding: var(--s4);
  box-shadow: var(--shadow-pop);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--t);
}

.modal-backdrop.open .modal {
  transform: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s3);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

@media (min-width: 900px) {
  .toast {
    bottom: 24px;
    inset-inline-start: auto;
    inset-inline-end: 24px;
  }
}

.toast.show {
  transform: none;
}

.toast.success {
  border-color: var(--success);
}

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

/* ---------- 13. Cart ---------- */

@media (min-width: 800px) {
  .cart-layout {
    grid-template-columns: 1fr 340px;
    align-items: start;
  }
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.cart-item {
  display: flex;
  gap: var(--s2);
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: var(--s3);
  border: 1px solid var(--border-subtle);
}

.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--bg-input);
  flex-shrink: 0;
}

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

.cart-item-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.cart-item-price {
  font-weight: 700;
  font-size: 1rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.qty-control button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.qty-control button:hover {
  background: var(--bg-input);
}

.qty-control span {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.cart-summary {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: var(--s4);
  border: 1px solid var(--border-subtle);
  position: sticky;
  top: calc(var(--nav-h) + 16px);
}

.cart-summary h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--s3);
}

.sum-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9375rem;
}

.sum-row.total {
  font-size: 1.125rem;
  font-weight: 700;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 16px;
}

.coupon-form {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.coupon-form .input {
  flex: 1;
  min-width: 0;
}

.empty {
  text-align: center;
  padding: var(--s6) var(--s3);
}

.empty-icon {
  display: inline-flex;
  margin-bottom: var(--s3);
  color: var(--text-disabled);
}

.empty h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty p {
  color: var(--text-muted);
  margin-bottom: var(--s3);
}

/* ---------- 14. Login ---------- */

.auth-page {
  min-height: calc(100dvh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4) var(--s2);
}

.auth-card {
  width: min(100%, 400px);
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: var(--s4);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  text-align: center;
}

.auth-card .sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--s4);
}

.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: var(--s4);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: background var(--t), color var(--t);
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  direction: ltr;
}

.otp-inputs input {
  width: 48px;
  height: 52px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
}

.otp-inputs input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ---------- 15. Motion & utilities ---------- */

@media (prefers-reduced-motion: reduce) {
  
}

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }
}

.wish-btn.wish-on {
  color: var(--danger);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.seller-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.page-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: var(--s4) 0 var(--s2);
}

@media (min-width: 600px) {
  .h-row > li {
    flex: 0 0 240px;
  }
}

@media (min-width: 900px) {
  .h-row > li {
    flex: 0 0 260px;
  }
}

/* ---------- Extra chrome & components used by app.js ---------- */

.nav-spacer { flex: 1; }

.nav-search {
  position: absolute;
  top: 100%;
  inset-inline: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  z-index: 60;
}

.nav-search[hidden] { display: none; }

.search-form {
  max-width: 560px;
}

.search-icon { color: var(--text-muted); flex-shrink: 0; }

.badge-count {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-btn { position: relative; }

.notif-list a, .wish-list a, .wish-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 0.8125rem;
  color: var(--text-primary);
  transition: background var(--t);
}

.notif-list a:hover, .wish-list a:hover, .wish-list li:hover {
  background: var(--bg-input);
}

.notif-list .unread { background: rgba(0, 113, 227, 0.06); }

[data-theme="dark"] .notif-list .unread { background: rgba(10, 132, 255, 0.1); }

.footer-grid {
  display: grid;
}

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

.footer-grid h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-grid ul { display: flex; flex-direction: column; gap: 6px; }

.footer-grid a {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.footer-grid a:hover { color: var(--accent); }

.footer-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
}

.social {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-muted);
  transition: background var(--t), color var(--t);
}

.social a:hover {
  background: var(--accent);
  color: #fff;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t);
  position: relative;
}

.bottom-nav a[aria-current="page"],
.bottom-nav a:hover {
  color: var(--accent);
}

.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: 14px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skel-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.skel-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.detail-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.detail-media {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

@media (min-width: 900px) {
  .buy-bar { display: none; }
}

.breadcrumb {
  flex-wrap: wrap;
  gap: 6px;
}

.cat-chip:hover, .cat-chip.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-base);
}

[data-theme="dark"] .cat-chip:hover,
[data-theme="dark"] .cat-chip.active {
  background: #f5f5f7;
  color: #000;
}

.page-btn:hover, .page-btn.active {
  background: var(--accent);
  color: #fff;
}

.code-block {
  background: var(--bg-input);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  direction: ltr;
  text-align: left;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--accent);
}

.chart-wrap { position: relative; height: 180px; }

.chart { width: 100%; height: 100%; }

.bar {
  fill: var(--accent);
  opacity: 0.7;
  transition: opacity var(--t);
}

.bar.latest, .bar:hover { opacity: 1; }

.grid-line { stroke: var(--border); stroke-width: 1; }

.chart-tip {
  position: absolute;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}

.note {
  font-size: 0.75rem;
  color: var(--success-text);
}

.note.down { color: var(--danger-text); }

.count { font-weight: 700; }

.lbl { font-size: 0.75rem; color: var(--text-muted); }

.bullets { display: flex; flex-direction: column; gap: 8px; }

.bullets li {
  display: flex;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.bullets li::before {
  content: "•";
  color: var(--accent);
  font-weight: 700;
}

.emoji { font-size: 1.5rem; }

.dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }

.dot-btn {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--t), transform var(--t);
}

.dot-btn.active {
  background: var(--accent);
  transform: scale(1.25);
}

.btn-added {
  background: var(--success) !important;
  color: #fff !important;
}

.btn-add { position: relative; z-index: 2; }

/* ==========================================================================
   16. Apple theme layer — سطوح تخت، خط‌های مویی، آبی سیستمی، بدون شیشه‌ی سنگین
   (این لایه بعد از بقیه می‌آید و ظاهر قبلی را بازنویسی می‌کند)
   ========================================================================== */

html[data-theme] body {
  background: var(--bg-base);
  background-attachment: scroll;
  line-height: 1.8;
}

h1, h2, h3 {
  letter-spacing: -0.015em;
}

.site-header {
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: none;
}

.logo-mark {
  box-shadow: none;
}

.nav-logout { display: none; }

@media (min-width: 769px) {
  .nav-logout { display: inline-flex; }
}

.nav-link { font-weight: 500; }

.nav-link[aria-current="page"] {
  background: transparent;
  color: var(--text-primary);
}

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

.btn-primary,
.btn-primary:hover:not(:disabled) {
  background: var(--accent);
  border-color: transparent;
  box-shadow: none;
  filter: none;
}

.hero-cta .btn-primary,
.hero-cta .btn-primary:hover:not(:disabled) { box-shadow: none; }

.icon-btn-fill:hover { background: var(--accent-dim); }

.search-input:hover { border-color: transparent; }

.product-card,
.feature-card,
.panel,
.stat-card,
.dash-nav,
.dash-welcome,
.cat-chip,
.skeleton-card,
.cart-list > li {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.product-card:hover .pc-icon { transform: none; }

.pc-icon {
  border-radius: 22%;
  box-shadow: none;
}

.feature-card:hover {
  transform: none;
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-hover);
}

.feature-icon,
.feature-card:hover .feature-icon {
  border-radius: var(--r-md);
  box-shadow: none;
  transform: none;
}

.panel, .dash-nav, .dash-welcome { border-radius: var(--r-xl); }

.stat-card::before { display: none; }

.hero-glow { display: none; }

.hero-badge::before { display: none; }

.hero h1 em {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--accent);
}

@media (min-width: 769px) {
  .hero { padding: 88px 0 40px; }
}

.section { padding-top: 48px; }

.link-more:hover { text-decoration: none; opacity: 0.8; }

.cat-chip:hover {
  transform: none;
  box-shadow: none;
}

.cat-chip[aria-current="true"],
.cat-chip[aria-pressed="true"] {
  border-color: var(--text-primary);
  background: var(--text-primary);
  color: var(--bg-base);
  box-shadow: none;
}

.chip-btn[aria-pressed="true"] {
  border-color: var(--text-primary);
  background: var(--text-primary);
  color: var(--bg-base);
}

.stats-strip {
  margin-top: 56px;
  border-block: 0;
  background: none;
}

.stat-item { flex-direction: column-reverse; }

.stat-num {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--text-primary);
  font-weight: 700;
}

.tab[aria-selected="true"]::after { height: 2px; }

.table tbody tr:hover { background: color-mix(in oklch, var(--text-primary) 4%, transparent); }

.chart .bar { fill: color-mix(in oklch, var(--accent) 40%, transparent); }

.chart .bar:hover,
.chart .bar:focus-visible,
.chart .bar.latest { fill: var(--accent); }

.filters { background: var(--bg-card); }

@media (min-width: 1024px) {
  .filters { border-radius: var(--r-lg); }
}

.drawer-backdrop { background: rgb(0 0 0 / 0.4); }

.buy-bar {
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border-subtle);
}

.prompt-block { border-inline-start-width: 3px; }

dialog.modal {
  -webkit-backdrop-filter: none;
}

.toast svg { color: inherit; }

.hero h1, .hero p { text-wrap: balance; }

[data-theme="dark"] .btn-secondary { background: rgb(255 255 255 / 0.14); }

.filter-scroll { max-height: 180px; }

.filter-group { margin-bottom: var(--s2); }

@media (min-width: 1024px) {
  #filters-apply { display: none; }
}

@media (min-width: 769px) {
  .h-row { margin-inline: -4px; padding-inline: 4px; }
}

@media (min-width: 900px) {
  .slides {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s2);
  }
  .slide,
  .slide.active {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    min-height: 220px;
    animation: none;
  }
  .slides .dots { display: none; }
}

.hscroll { position: relative; }

.hs-btn:hover { background: var(--bg-raised); }

.hs-btn:active { transform: scale(0.94); }

.hs-prev { inset-inline-start: -14px; }

.hs-next { inset-inline-end: -14px; }

@media (hover: hover) and (pointer: fine) {
  .hs-btn { display: inline-flex; }
  .hscroll > .h-row,
  .hscroll > .chips-scroll,
  .hscroll > .shots { cursor: grab; }
}

.hscroll-dragging { cursor: grabbing !important; user-select: none; scroll-snap-type: none !important; }

.hscroll-dragging * { pointer-events: none; }

@media (min-width: 1024px) {
  .filters { position: static; max-height: none; overflow: visible; }
}

/* ==========================================================================
   17. Liquid Glass — زمینه‌ی گرادیانی آبی–بنفش + همه‌ی سطوح شیشه‌ای
   (این لایه آخرین لایه است و رنگ‌های تخت لایه‌ی ۱۶ را با شیشه جایگزین می‌کند)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-base: oklch(0.16 0.025 250);
  --bg-card: oklch(0.32 0.045 250 / 0.38);
  --bg-raised: oklch(0.38 0.045 250 / 0.5);
  --bg-input: oklch(0.3 0.04 250 / 0.5);
  --bg-elevated: oklch(0.24 0.035 250 / 0.8);
  --bg-glass: oklch(0.28 0.04 250 / 0.45);
  --glass-btn: oklch(1 0 0 / 0.1);
  --glass-blur: 28px;
  --sheen: oklch(1 0 0 / 0.1);
  --rim: oklch(1 0 0 / 0.16);
  --border: oklch(1 0 0 / 0.18);
  --border-subtle: oklch(1 0 0 / 0.09);
  --glass-sheen: linear-gradient(135deg, var(--sheen) 0%, transparent 42%);
  --shadow-glass: 0 10px 36px oklch(0 0 0 / 0.35), inset 0 1px 0 oklch(1 0 0 / 0.22), inset 0 -1px 0 oklch(1 0 0 / 0.05);
  --shadow-glass-hover: 0 18px 50px oklch(0 0 0 / 0.5), inset 0 1px 0 oklch(1 0 0 / 0.28), inset 0 -1px 0 oklch(1 0 0 / 0.07);
  --shadow-pop: 0 30px 80px oklch(0 0 0 / 0.55), inset 0 1px 0 oklch(1 0 0 / 0.22);
}

[data-theme="light"] {
  --bg-base: oklch(0.94 0.015 250);
  --bg-card: oklch(1 0 0 / 0.56);
  --bg-raised: oklch(1 0 0 / 0.72);
  --bg-input: oklch(1 0 0 / 0.62);
  --bg-elevated: oklch(0.99 0.004 250 / 0.84);
  --bg-glass: oklch(1 0 0 / 0.5);
  --glass-btn: oklch(1 0 0 / 0.6);
  --glass-blur: 28px;
  --sheen: oklch(1 0 0 / 0.5);
  --rim: oklch(1 0 0 / 0.75);
  --border: oklch(0.45 0.03 250 / 0.2);
  --border-subtle: oklch(0.45 0.03 250 / 0.1);
  --glass-sheen: linear-gradient(135deg, var(--sheen) 0%, transparent 42%);
  --shadow-glass: 0 8px 30px oklch(0.4 0.08 260 / 0.12), inset 0 1px 0 oklch(1 0 0 / 0.9), inset 0 -1px 0 oklch(1 0 0 / 0.35);
  --shadow-glass-hover: 0 16px 44px oklch(0.4 0.08 260 / 0.2), inset 0 1px 0 oklch(1 0 0 / 0.95), inset 0 -1px 0 oklch(1 0 0 / 0.4);
  --shadow-pop: 0 28px 72px oklch(0.35 0.06 260 / 0.28), inset 0 1px 0 oklch(1 0 0 / 0.9);
}

html[data-theme="light"] body {
  background:
    radial-gradient(120% 80% at 0% 0%, oklch(0.85 0.04 230 / 0.6), transparent 50%),
    radial-gradient(90% 70% at 100% 10%, oklch(0.9 0.03 280 / 0.5), transparent 45%),
    radial-gradient(70% 50% at 50% 100%, oklch(0.88 0.03 200 / 0.4), transparent 50%),
    var(--bg-base);
  background-attachment: fixed;
}

html:not([data-theme="light"]) body {
  background:
    radial-gradient(120% 80% at 10% -10%, oklch(0.45 0.08 230 / 0.35), transparent 50%),
    radial-gradient(90% 70% at 100% 0%, oklch(0.4 0.06 280 / 0.25), transparent 45%),
    radial-gradient(80% 60% at 50% 100%, oklch(0.35 0.05 200 / 0.2), transparent 50%),
    var(--bg-base);
  background-attachment: fixed;
}

.product-card,
.feature-card,
.panel,
.stat-card,
.dash-nav,
.dash-welcome,
.slide,
.cat-chip,
.page-btn,
.skeleton-card,
.cart-list > li,
.filters {
  background: var(--glass-sheen), var(--bg-card);
  border: 1px solid var(--rim);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
}

.product-card:hover,
.feature-card:hover {
  border-color: var(--rim);
  box-shadow: var(--shadow-glass-hover);
}

.cat-chip:hover,
.page-btn:hover:not(:disabled) {
  background: var(--glass-sheen), var(--bg-raised);
  border-color: var(--rim);
  box-shadow: var(--shadow-glass);
}

.cat-chip[aria-current="true"],
.cat-chip[aria-pressed="true"],
.page-btn[aria-current="page"],
.chip-btn[aria-pressed="true"] {
  border-color: oklch(1 0 0 / 0.35);
  background: color-mix(in srgb, var(--accent) 88%, transparent);
  color: var(--on-accent);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.45), 0 6px 18px var(--accent-glow);
}

.site-header,
.bottom-nav,
.buy-bar {
  background: var(--glass-sheen), var(--bg-glass);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border-color: var(--rim);
  box-shadow: 0 8px 30px oklch(0.4 0.08 260 / 0.08), inset 0 -1px 0 var(--rim);
}

.bottom-nav,
.buy-bar { box-shadow: 0 -8px 30px oklch(0.4 0.08 260 / 0.08), inset 0 1px 0 var(--rim); }

dialog.modal,
.notif-panel,
.wish-panel {
  background: var(--glass-sheen), var(--bg-elevated);
  border: 1px solid var(--rim);
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
}

dialog.modal::backdrop {
  -webkit-backdrop-filter: blur(8px);
}

.toast {
  border: 1px solid oklch(1 0 0 / 0.18);
  background: oklch(0.22 0.035 250 / 0.72);
  color: #fff;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.hs-btn {
  background: var(--bg-elevated);
  border-color: var(--rim);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.input,
.select,
.textarea,
.search-input,
.dash-search .search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px oklch(0.3 0.05 260 / 0.1), inset 0 -1px 0 var(--rim);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}

.search-input { border-color: var(--rim); }

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.search-input:focus-visible {
  border-color: var(--accent);
  box-shadow: inset 0 1px 3px oklch(0.3 0.05 260 / 0.1), 0 0 0 4px var(--accent-glow);
}

.btn-primary {
  border: 1px solid oklch(1 0 0 / 0.3);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.5), inset 0 -1px 0 oklch(0 0 0 / 0.1), 0 8px 22px var(--accent-glow);
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
}

.btn-primary:hover:not(:disabled),
.hero-cta .btn-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-dim) 92%, transparent);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.5), inset 0 -1px 0 oklch(0 0 0 / 0.1), 0 10px 26px var(--accent-glow);
}

.hero-cta .btn-primary { box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.5), inset 0 -1px 0 oklch(0 0 0 / 0.1), 0 8px 22px var(--accent-glow); }

.btn-secondary {
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-secondary:hover:not(:disabled) { background: var(--glass-sheen), var(--glass-btn); }

[data-theme="dark"] .btn-secondary:hover:not(:disabled) { background: var(--glass-sheen), var(--bg-raised); }

.icon-btn:hover {
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
}

.icon-btn-fill {
  border: 1px solid oklch(1 0 0 / 0.3);
  background: color-mix(in srgb, var(--accent) 88%, transparent);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.5), 0 4px 12px var(--accent-glow);
}

@media (max-width: 1023px) {
  .filters { background: var(--glass-sheen), var(--bg-elevated); }
}

/* ==========================================================================
   18. صفحه‌ی جزئیات محصول — سبک App Store
   بنر رنگی · نوار اطلاعات · تصاویر · توضیح با «بیشتر» · امتیاز و نظرات · اطلاعات · فهرست‌ها
   ========================================================================== */

.as-page { padding-bottom: var(--s5); }

.as-sub a:hover { text-decoration: underline; }

.as-get { min-height: 42px; padding-inline: 28px; }

.as-icon-btn {
  place-items: center;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35);
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  transition: background-color var(--t), transform var(--t);
}

.as-icon-btn:active { transform: scale(0.94); }

.as-icon-btn.wish-on { color: #ff7a93; }

.as-info,
.as-card,
.as-review {
  border: 1px solid var(--rim);
  border-radius: var(--r-lg);
  background: var(--glass-sheen), var(--bg-card);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
}

.as-info {
  margin-top: var(--s3);
}

.as-info > div {
  flex: 1 0 140px;
}

.as-info .v { display: flex; align-items: center; gap: 6px; line-height: 1.3; }

.as-info .v svg { color: var(--text-muted); }

.as-sec { margin-top: 44px; }

.as-sec > h2 { margin-bottom: 14px; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }

.as-info + .as-sec { margin-top: 28px; }

.hscroll > .as-shots { cursor: grab; }

.as-desc { max-width: 880px; line-height: 2; }

.as-desc h3 { margin: 18px 0 6px; font-size: 1rem; font-weight: 700; }

.as-desc.clamp {
  max-height: 8.4em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}

.as-more { margin-top: 6px; color: var(--accent); font-weight: 600; }

.as-more:hover { text-decoration: underline; }

.as-card { max-width: 880px; padding: 20px; }

.as-count { margin-top: 4px; font-size: 0.8125rem; }

.as-new { display: flex; justify-content: space-between; gap: 24px; max-width: 880px; line-height: 1.9; }

.as-new .muted { white-space: nowrap; font-size: 0.875rem; text-align: end; }

.as-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 36px; margin: 0; }

.as-info-grid dt { margin-bottom: 2px; font-size: 0.8125rem; color: var(--text-muted); }

.as-info-grid dd { margin: 0; font-size: 0.9375rem; line-height: 1.8; }

.as-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 32px; margin: 0; padding: 0; list-style: none; }

.as-li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }

.as-li img { flex: none; width: 64px; height: 64px; border-radius: 22%; object-fit: cover; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25); }

.as-li .tx { display: flex; min-width: 0; flex-direction: column; gap: 2px; }

.as-li .t { display: -webkit-box; overflow: hidden; font-weight: 600; line-height: 1.6; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.as-li .s { font-size: 0.8125rem; color: var(--text-muted); }

.as-li .view {
  flex: none;
  margin-inline-start: auto;
  padding: 5px 18px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  transition: background-color var(--t), color var(--t);
}

.as-li:hover .view { background: var(--accent); color: var(--on-accent); }

@media (max-width: 640px) {
  .as-hero { grid-template-columns: 1fr; justify-items: center; padding: 24px 18px; text-align: center; gap: 18px; }
  .as-icon { width: 112px; height: 112px; }
  .as-actions { justify-content: center; }
  
  .as-new { flex-direction: column; gap: 8px; }
  .as-new .muted { text-align: start; }
  .as-sec { margin-top: 36px; }
}

/* ==========================================================================
   19. رنگ‌های نرم‌تر برای بنر و کاشی‌های صفحه‌ی جزئیات
   موازی با زمینه‌ی آبی–بنفش؛ سه نقطه‌ی کم‌اشباع، نه قهوه‌ای/زیتونی و سبز تیره
   ========================================================================== */

.as-mock { background: rgb(255 255 255 / 0.22); border-color: rgb(255 255 255 / 0.4); }

.as-rating { grid-template-columns: auto minmax(0, 420px); justify-content: start; gap: 40px; max-width: none; }

@media (max-width: 640px) {
  .as-rating { grid-template-columns: 1fr; gap: 14px; }
}

/* ==========================================================================
   20. رنگ‌های زنده‌تر — روشن و پراشباع، با طیف گرم و سرد
   در حالت روز روشنایی از ۰٫۵۷ پایین‌تر نمی‌رود؛ در حالت شب تا ۰٫۴۴ (نارنجی انتهای گرادیان در شب ممکن است کمی قرمزِ تیره بشود)
   ========================================================================== */

[data-theme="dark"] .as-hero {
  background:
    radial-gradient(60% 100% at 12% 0%, oklch(0.85 0.1 var(--h) / 0.28), transparent 60%),
    linear-gradient(135deg, oklch(0.58 0.17 var(--h)), oklch(0.45 0.18 var(--h2)));
}

[data-theme="dark"] .as-shot {
  background:
    radial-gradient(90% 55% at 80% 0%, oklch(0.85 0.1 var(--h) / 0.26), transparent 60%),
    linear-gradient(160deg, oklch(0.56 0.17 var(--h)), oklch(0.44 0.18 var(--h2)));
}

.as-sub { color: #fff; }

.as-hero h1,
.as-shot h3 { text-shadow: 0 1px 10px rgb(0 0 0 / 0.28); }

/* ==========================================================================
   21. اصلاح فاصله‌ی فونت Ravi
   فاصله‌ی کلمات در Ravi کم است و فاصله‌ی منفی حروف تیترها آن را بیشتر می‌کرد
   («بخر و بفروش» شده بود «بخروبفروش»). در خط فارسی هم letter-spacing منفی مناسب نیست
   ========================================================================== */

h1, h2, h3, h4,
.hero h1,
.as-hero h1,
.as-sec > h2,
.as-shot h3 { letter-spacing: 0; word-spacing: 0.16em; }

.as-big, .stat-num { letter-spacing: 0; word-spacing: 0; }

/* ==========================================================================
   22. صفحه‌ی جزئیات — تکمیل سبک App Store
   نوار چسبان · بج‌ها · امتیاز و نظرات کامل · حریم خصوصی · کارت فروشنده
   ========================================================================== */

/* ---------- نوار چسبان (sticky mini-header) ---------- */

.as-sticky {
  position: fixed;
  inset-inline: 0;
  top: var(--nav-h);
  z-index: 45;
  padding-block: 8px;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.as-sticky.is-visible {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.as-sticky-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.as-sticky-text .muted {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.as-sticky .as-get {
  flex-shrink: 0;
}

/* ---------- بج‌های بنر ---------- */

.as-tag {
  -webkit-backdrop-filter: blur(10px);
}

/* ---------- بخش امتیاز و نظرات (بازنویسی کامل) ---------- */

@media (min-width: 720px) {
  .as-rating-wrap {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 40px;
  }
}

@media (min-width: 720px) {
  .as-rating-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: center;
    grid-column: 1 / -1;
  }
}

.as-bar:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
}

.as-bar[aria-pressed="true"] {
  background: var(--accent-glow);
}

.as-bar .n {
  min-width: 38px;
}

.as-bar .cnt {
  min-width: 32px;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* ---------- کارت «چه چیزی تازه است» ---------- */

.as-new-card {
  max-width: 720px;
  padding: 20px;
}

.as-new-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.as-new-head strong {
  font-size: 1rem;
}

.as-new-card p {
  line-height: 1.9;
}

.as-new-list {
  margin-top: 12px;
  padding-inline-start: 0;
}

.as-new-list li {
  position: relative;
  padding-inline-start: 22px;
  font-size: 0.9375rem;
  line-height: 1.9;
}

.as-new-list li + li {
  margin-top: 4px;
}

.as-new-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  top: 0.75em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- کارت حریم خصوصی ---------- */

.as-privacy {
  max-width: 720px;
  padding: 20px;
}

.as-privacy-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.as-privacy-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: var(--accent-glow);
  color: var(--accent);
}

.as-privacy-head strong {
  display: block;
  font-size: 1rem;
}

.as-privacy-head p {
  font-size: 0.8125rem;
}

/* ---------- کارت فروشنده ---------- */

.as-seller-card {
  display: grid;
  gap: 16px;
  max-width: 720px;
  padding: 20px;
}

.as-seller-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.as-seller-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.as-seller-info strong {
  font-size: 1.0625rem;
}

.as-seller-info .muted {
  font-size: 0.875rem;
  line-height: 1.8;
}

.as-seller-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

.as-seller-meta svg {
  width: 14px;
  height: 14px;
}

/* ---------- ریسپانسیو موبایل ---------- */

@media (max-width: 640px) {
  .as-sticky {
    top: 0;
  }
  .as-sticky-text strong {
    font-size: 0.875rem;
  }
  .as-rating-wrap {
    padding: 16px;
    gap: 16px;
  }
  .as-big {
    font-size: 3.5rem;
  }
  .as-review {
    padding: 16px;
  }
  .as-seller-card {
    padding: 16px;
  }
}

/* ---------- حالت کفایت اسکرول برای نوار چسبان ---------- */

@media (prefers-reduced-motion: reduce) {
  .as-sticky {
    transition: none;
  }
}

/* ---------- 15. Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   23. نوار فیلتر افقی (products) — fbar + fdrop
   پاپ‌اور روی دسکتاپ، کشوی پایین روی موبایل
   ========================================================================== */

.fbar::-webkit-scrollbar { display: none; }

.fdrop {
  position: relative;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.fdrop-btn.has-active {
  background: color-mix(in oklch, var(--accent) 20%, var(--bg-raised));
}

.fdrop-btn[aria-expanded="true"] .fd-chev {
  transform: rotate(180deg);
}

.fd-chev {
  display: inline-flex;
  transition: transform var(--t);
  opacity: 0.7;
}

.fd-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.6875rem;
  font-weight: 800;
}

.fdrop-btn[aria-expanded="true"] .fd-count {
  background: var(--on-accent);
  color: var(--accent);
}

.fdrop-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 70;
  width: min(340px, 92vw);
  max-height: min(70vh, 480px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--rim);
  border-radius: var(--r-lg);
  background: var(--glass-sheen), var(--bg-elevated);
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.fdrop-title {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  font-weight: 800;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.fdrop-done {
  margin-top: 4px;
}

@media (max-width: 767px) {
  .fdrop {
    position: static;
  }
  .fdrop-panel {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-inline: 0;
    border-bottom: 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    animation: fdrop-sheet-in 220ms ease;
  }
  @keyframes fdrop-sheet-in {
    from { transform: translateY(100%); }
    to { transform: none; }
  }
  .fdrop-panel::before {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 99px;
    background: var(--border);
  }
}

@media (min-width: 768px) {
  .fbar {
    flex-wrap: wrap;
    overflow: visible;
  }
  .fdrop-panel[hidden] {
    display: none !important;
  }
}

.fdrop-panel[hidden] {
  display: none !important;
}

/* ==========================================================================
   24. سبد خرید و چک‌اوت — بازنویسی کامل
   ========================================================================== */

/* ---------- سرصفحه‌ی سبد ---------- */

.cart-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cart-head p {
  margin: 4px 0 0;
  font-size: 0.9375rem;
}

/* ---------- چیدمان دو ستونه ---------- */

.cart-layout {
  display: grid;
  gap: var(--s3);
  align-items: start;
  margin-top: var(--s2);
}

@media (min-width: 1024px) {
  .cart-layout {
    grid-template-columns: 1fr 380px;
  }
  .cart-summary {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
  }
}

/* ---------- ستون اصلی ---------- */

.cart-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- کارت‌های سبد: بزرگ‌تر و جادارتر ---------- */

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-list > li {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--rim);
  border-radius: var(--r-lg);
  background: var(--glass-sheen), var(--bg-card);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  transition: transform 200ms ease, opacity 200ms ease, box-shadow 220ms ease;
}

.cart-list > li.is-removing {
  opacity: 0;
  transform: translateX(30px) scale(0.98);
  pointer-events: none;
}

.cart-list > li:hover {
  box-shadow: var(--shadow-glass-hover);
}

.cart-list img {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15);
}

.cart-item-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cart-item-main h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.cart-item-main h3 a:hover {
  color: var(--accent);
}

.cart-item-seller {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.cart-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 88px;
}

.cart-item-side .price {
  font-size: 1.0625rem;
  font-weight: 800;
}

.cart-item-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  transition: background-color var(--t), color var(--t);
}

.cart-item-remove:hover {
  background: color-mix(in oklch, var(--danger) 14%, transparent);
  color: var(--danger-text);
}

@media (max-width: 560px) {
  .cart-list > li {
    grid-template-columns: 72px 1fr;
    gap: 12px;
  }
  .cart-list img {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }
  .cart-item-side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
  }
}

/* ---------- پایین سبد: دکمه‌های اضافی ---------- */

.cart-actions-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ---------- خلاصه‌ی سفارش ---------- */

.cart-summary-title {
  margin: 0 0 16px;
  font-size: 1.125rem;
  font-weight: 800;
}

.summary-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px;
  font-size: 0.9375rem;
}

.summary-rows > div span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.summary-rows .total {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 1.125rem;
  font-weight: 800;
}

.summary-rows .total span:last-child {
  color: var(--accent);
  font-size: 1.25rem;
}

#sum-discount-row span:last-child {
  color: var(--success-text);
  font-weight: 700;
}

.coupon-hint {
  font-size: 0.75rem;
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.coupon-sample {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--bg-raised);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  transition: background-color var(--t), color var(--t);
}

.coupon-sample:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.cart-checkout-btn {
  margin-top: 20px;
  font-size: 1rem;
}

/* ==========================================================================
   چک‌اوت — مراحل و چیدمان
   ========================================================================== */

.checkout-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.checkout-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  position: relative;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: background-color var(--t), color var(--t), border-color var(--t);
}

.checkout-steps li::after {
  content: "";
  position: absolute;
  inset-inline-end: -8px;
  top: 50%;
  width: 16px;
  height: 2px;
  background: var(--border-subtle);
  transform: translateY(-50%);
}

.checkout-steps li:last-child::after {
  display: none;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-raised);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: background-color var(--t), color var(--t);
}

.step-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.checkout-steps li.is-current {
  background: var(--glass-sheen), var(--bg-card);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: var(--shadow-glass);
}

.checkout-steps li.is-current .step-num {
  background: var(--accent);
  color: var(--on-accent);
}

.checkout-steps li.is-done {
  color: var(--text-primary);
}

.checkout-steps li.is-done .step-num {
  font-size: 0;
}

.checkout-steps li.is-done .step-num::before {
  font-size: 0.9375rem;
}

@media (max-width: 640px) {
  .checkout-steps {
    gap: 4px;
  }
  .checkout-steps li {
    padding: 10px 8px;
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
  .step-title {
    font-size: 0.75rem;
  }
  .step-num {
    width: 26px;
    height: 26px;
    font-size: 0.8125rem;
  }
}

.checkout-layout {
  display: grid;
  gap: var(--s3);
  align-items: start;
  margin-top: var(--s2);
}

@media (min-width: 1024px) {
  .checkout-layout {
    grid-template-columns: 1fr 380px;
  }
  .checkout-summary {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
  }
}

.checkout-main {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.checkout-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.checkout-panel[hidden] {
  display: none !important;
}

.checkout-secure {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--success-text);
  font-weight: 600;
}

.checkout-secure svg {
  width: 14px;
  height: 14px;
}

.checkout-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-items > li {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
}

.checkout-items img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
}

.checkout-items h3 {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.checkout-items .muted {
  font-size: 0.75rem;
}

.checkout-items .price {
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
}

.checkout-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.checkout-nav .btn-primary {
  min-width: 200px;
}

.checkout-success {
  text-align: center;
}

.checkout-success .success-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: color-mix(in oklch, var(--success) 22%, var(--bg-raised));
  color: var(--success-text);
  margin-bottom: 16px;
}

.checkout-success h2 {
  margin-bottom: 8px;
}

.checkout-success .modal-actions {
  justify-content: center;
  margin-top: 24px;
  gap: 12px;
}

/* ---------- حالت خالی بهتر ---------- */

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 64px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
  text-align: center;
  background: var(--bg-card);
}

.cart-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
}

.cart-empty h2 {
  font-size: 1.375rem;
  margin: 0;
}

.cart-empty p {
  max-width: 420px;
  color: var(--text-muted);
  line-height: 1.9;
  margin: 0;
}

.cart-empty-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* ==========================================================================
   25. صفحه‌ی پروفایل کاربر
   ========================================================================== */

.profile-layout {
  display: grid;
  gap: var(--s3);
  align-items: start;
  margin-top: var(--s2);
}

@media (min-width: 1024px) {
  .profile-layout {
    grid-template-columns: 260px 1fr;
  }
  .profile-nav {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
  }
}

.profile-nav {
  padding: 0;
  overflow: hidden;
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-user strong {
  display: block;
  font-size: 0.9375rem;
}

.profile-user .muted {
  font-size: 0.75rem;
}

.profile-nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

.profile-nav-foot {
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border-subtle);
}

.profile-main {
  display: grid;
  gap: var(--s3);
  min-width: 0;
}

.profile-panel[hidden] {
  display: none !important;
}

.profile-wish-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-wish-list li {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
}

.profile-wish-list img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
}

.profile-wish-list h3 {
  margin: 0;
  font-size: 0.9375rem;
}

.profile-wish-list .muted {
  font-size: 0.75rem;
}

@media (max-width: 560px) {
  .profile-wish-list li {
    grid-template-columns: 48px 1fr auto;
  }
  .profile-wish-list li .price {
    grid-column: 1 / -1;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
    text-align: end;
  }
}

.profile-order {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-card);
  margin-bottom: 12px;
}

.profile-order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-order-head strong {
  font-size: 0.9375rem;
}

.profile-order-head time {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.profile-order-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-order-items img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.profile-order-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.profile-order-foot .price {
  font-size: 1rem;
}

.profile-review-list li {
  display: grid;
  gap: 6px;
  padding: 14px 0;
}

.profile-review-list li + li {
  border-top: 1px solid var(--border-subtle);
}

.profile-review-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
}

/* ==========================================================================
   26. نما‌ی فهرست محصولات (products) — رفع بهم‌ریختگی
   سبک App Store: ردیف‌های بزرگ با آیکون، عنوان، نمره، توضیح و دکمه‌ی قیمت
   ========================================================================== */

/* ---------- گرید پیش‌فرض ---------- */

.grid-products {
  display: grid;
  gap: var(--s2);
  grid-template-columns: 1fr;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 640px) {
  .grid-products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .grid-products {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- نمای فهرست: تبدیل گرید به ستون تک ---------- */

.grid-products.list-view {
  grid-template-columns: 1fr !important;
  gap: 8px;
  max-width: 880px;
}

@media (min-width: 1024px) {
  .grid-products.list-view {
    max-width: 100%;
  }
}

/* ---------- ردیف فهرست: prod-row ---------- */

.prod-row > li,
.grid-products.list-view > li {
  list-style: none;
}

.prod-row .pr-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15);
  flex-shrink: 0;
}

.pr-title a {
  color: inherit;
}

.pr-title a:hover {
  color: var(--accent);
}

.pr-main .rating-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  margin-top: 2px;
}

.get-pill.btn-added,
.get-pill.btn-added:hover {
  border-color: color-mix(in oklch, var(--success) 50%, transparent);
  box-shadow: none;
}

/* ---------- چیدمان لیست: دسکتاپ پرعرض ---------- */

@media (min-width: 1024px) {
  .prod-row {
    /* ۴ ستون: آیکون | عنوان+فروشنده | توضیح | دکمه‌ها */
    grid-template-columns: 72px minmax(180px, 1fr) minmax(220px, 1.4fr) auto;
    gap: 20px;
  }
  .prod-row .pr-desc {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    -webkit-line-clamp: 3;
  }
  .pr-end {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
  }
}

/* ---------- موبایل: کارت عمودی‌تر ---------- */

@media (max-width: 640px) {
  
  .prod-row .pr-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }
  .pr-desc {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
  }
  .pr-end {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
  .pr-end .get-pill {
    flex: 1;
    max-width: 240px;
  }
  .pr-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* ---------- دکمه‌های نمایش شبکه/لیست ---------- */

.seg button:hover {
  color: var(--text-primary);
}

.toolbar .result-count {
  flex: 1;
  min-width: 160px;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.toolbar .sort {
  font-size: 0.875rem;
}

.toolbar .select {
  width: auto;
  padding-inline: 14px 32px;
}

@media (max-width: 560px) {
  .toolbar .sort {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .toolbar .sort .select {
    flex: 1;
  }
}

/* ==========================================================================
   27. اصلاحات ظاهری نهایی — نزدیک‌تر به App Store + رفع مشکلات موبایل
   ========================================================================== */

@media (max-width: 767px) {
  .nav {
    gap: 2px;
    padding-inline: 0;
  }
  .logo {
    font-size: 1.125rem;
    gap: 6px;
    max-width: 110px;
    overflow: hidden;
  }
  .logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    flex-shrink: 0;
  }
  .nav-actions {
    gap: 0;
  }
  .nav-actions .icon-btn {
    width: 36px;
    height: 36px;
  }
  /* مخفی کردن اعلان و علاقه‌مندی در موبایل برای جلوگیری از overflow (در پروفایل و پایین‌تر در دسترس) */
  .nav-actions .notif-wrap,
  .nav-actions .wish-wrap {
    display: none;
  }
  .nav-actions .nav-login,
  .nav-actions a.btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.8125rem;
  }
  .container.nav {
    padding-inline: 12px;
  }
}

@media (max-width: 380px) {
  .logo {
    font-size: 1rem;
    max-width: 90px;
  }
  .nav-actions .icon-btn {
    width: 34px;
    height: 34px;
  }
}

.product-card:hover {
  transform: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  border-color: var(--border);
}

[data-theme="dark"] .product-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.pc-icon,
.pc-top > img {
  background: var(--bg-input);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .pc-icon,
[data-theme="dark"] .pc-top > img {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.pc-actions .get-btn,
.pc-actions .btn-get {
  min-height: 32px;
  padding: 0 16px;
  border-radius: 980px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
}

.pc-actions .get-btn:hover,
.pc-actions .btn-get:hover {
  background: var(--accent-dim);
}

.h-row {
  padding-bottom: 8px;
}

.slide:hover {
  transform: scale(1.015);
}

.chips-scroll {
  padding-bottom: 4px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
}

.bottom-nav {
  height: 62px;
}

.bn-item,
.bottom-nav a {
  font-size: 0.6875rem;
  gap: 3px;
  padding: 6px 10px;
}

.bottom-nav a svg {
  width: 22px;
  height: 22px;
}

.site-header + main {
  padding-top: 4px;
}

@media (max-width: 640px) {
  .section {
    padding: var(--s3) 0;
  }
  .sec-head h2 {
    font-size: 1.25rem;
  }
  .product-card {
    padding: 14px;
  }
  .pc-icon,
  .pc-top > img {
    width: 68px;
    height: 68px;
    border-radius: 16px;
  }
  .h-row > li {
    flex: 0 0 min(260px, 82vw);
  }
}

/* ==========================================================================
   28. داشبورد فروشنده — چیدمان کامل و شبیه اپ‌استور
   ========================================================================== */

.dash-welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 20px;
  padding: 24px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
}

.dash-welcome h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 4px 0;
}

.dash-greet {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
}

.dash-welcome-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dash {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 48px;
}

@media (min-width: 1024px) {
  .dash {
    grid-template-columns: 260px 1fr;
    align-items: start;
  }
  /* همیشه نمایش سایدبار در دسکتاپ */
  .dash-nav {
    display: block !important;
    position: sticky;
    top: calc(var(--nav-h) + 16px);
  }
  .dash-nav-toggle {
    display: none !important;
  }
}

.dash-nav {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-seller {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.dash-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.dash-seller strong {
  display: block;
  font-size: 0.9375rem;
}

.dash-seller .muted {
  font-size: 0.75rem;
}

.dash-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.15s ease, color 0.15s ease;
}

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

.dash-link[aria-current="page"] {
  background: color-mix(in oklch, var(--accent) 12%, transparent);
  color: var(--accent);
  font-weight: 600;
}

.dash-link .nav-count {
  margin-inline-start: auto;
  font-size: 0.75rem;
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 980px;
  color: var(--text-muted);
}

.dash-link[aria-current="page"] .nav-count {
  background: color-mix(in oklch, var(--accent) 18%, transparent);
  color: var(--accent);
}

.dash-nav-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.dash-main {
  min-width: 0;
}

.dash-panel[hidden] {
  display: none !important;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border);
}

.stat-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card .feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in oklch, var(--sc-accent, var(--accent)) 14%, transparent);
  color: var(--sc-accent, var(--accent));
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
}

.stat-card .note {
  font-size: 0.75rem;
  color: var(--success-text);
}

.dash-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 900px) {
  .dash-two-col {
    grid-template-columns: 1.2fr 1fr;
  }
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-input);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.activity-list p {
  font-size: 0.875rem;
  margin: 0 0 2px;
  line-height: 1.4;
}

.activity-list time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 12px 10px;
  text-align: start;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table tr:last-child td {
  border-bottom: none;
}

.cell-product {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cell-product img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.row-actions {
  display: flex;
  gap: 4px;
}

.status {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active { background: rgba(52, 199, 89, 0.12); color: var(--success-text); }

.status-pending { background: rgba(255, 149, 0, 0.12); color: var(--warning-text); }

.status-inactive { background: var(--bg-input); color: var(--text-muted); }

.status-refunded { background: rgba(255, 59, 48, 0.12); color: var(--danger-text); }

.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.dash-search {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border-radius: 12px;
  padding: 0 12px;
  height: 40px;
}

.dash-search .search-input {
  flex: 1;
  font-size: 0.875rem;
  min-width: 0;
}

@media (max-width: 1023px) {
  .dash-nav[hidden] {
    display: none;
  }
  .dash-nav:not([hidden]) {
    display: flex;
    margin-bottom: 16px;
  }
}

[data-earnings-chart] {
  min-height: 180px;
}

/* ==========================================================================
   29. رفع ناهماهنگی رنگ، وسط‌چین آیکون‌ها و شباهت بیشتر به App Store
   ========================================================================== */

.pc-icon,
.pr-icon,
.as-icon,
.as-sticky-icon,
.slide-icon,
.feature-icon,
.logo-mark,
.activity-icon,
.stat-card .feature-icon,
.empty-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
  object-fit: cover;
}

.pc-icon,
.pr-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px; /* App Store style ~22% */
  flex-shrink: 0;
  background: var(--bg-input);
}

.pr-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  vertical-align: middle;
}

.stars svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.stars .star-full { fill: var(--star); stroke: none; }

.stars .star-empty { fill: var(--border-subtle); stroke: none; }

.product-card {
  padding: 16px;
  border-radius: 20px;
  gap: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.pc-info {
  padding-top: 2px;
}

.pc-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rating-num {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.75rem;
}

.pc-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pc-actions {
  position: relative;
  z-index: 2;
}

.pc-actions .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.pc-actions .icon-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.pc-actions .icon-btn svg {
  width: 16px;
  height: 16px;
}

.prod-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prod-row:hover {
  border-color: var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.pr-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pr-title {
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.pr-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.pr-desc {
  display: none; /* در دسکتاپ وسیع‌تر نمایش داده می‌شود */
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 900px) {
  .prod-row {
    grid-template-columns: 72px minmax(160px, 1fr) minmax(200px, 1.3fr) auto;
  }
  .pr-desc {
    display: -webkit-box;
  }
}

.pr-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.get-pill {
  transition: background 0.15s ease, transform 0.15s ease;
}

.get-pill:hover {
  background: var(--accent-dim);
}

.get-pill:active {
  transform: scale(0.97);
}

.get-pill.btn-added {
  background: color-mix(in oklch, var(--success) 18%, transparent);
  color: var(--success-text);
}

.slide {
  border-radius: 20px;
  padding: 22px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.slide-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-icon svg {
  width: 28px;
  height: 28px;
}

.slide h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

.slide p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.as-sticky-inner {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 16px;
  width: 100%;
}

.as-sticky-text {
  overflow: hidden;
}

.as-sticky-text strong {
  max-width: 100%;
}

.seg button {
  transition: background 0.15s, color 0.15s;
}

.seg button[aria-pressed="true"] {
  box-shadow: none;
}

.badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 980px;
  background: color-mix(in oklch, var(--c, var(--accent)) 12%, transparent);
  color: color-mix(in oklch, var(--c, var(--accent)) 75%, var(--text-primary));
}

.badge-uc {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 980px;
}

.h-row > li {
  flex: 0 0 min(270px, 78vw);
}

.product-card.compact .pc-desc,
.product-card.compact .badges {
  display: none;
}

.pc-icon img,
.pr-icon img,
.as-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

@media (max-width: 640px) {
  .pc-icon {
    width: 68px;
    height: 68px;
    border-radius: 16px;
  }
  .prod-row {
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 12px;
  }
  .pr-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }
  .pr-end {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
  }
  .pr-desc {
    display: none !important;
  }
}

/* ==========================================================================
   30. رفع چیدمان بخش نظرات + دکمه افزودن به سبد
   ========================================================================== */

.as-rating-wrap {
  border-radius: 20px;
  -webkit-backdrop-filter: none;
}

.as-big {
  font-size: clamp(2.8rem, 6vw, 4rem);
}

.as-bar {
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.as-bar:hover,
.as-bar[aria-pressed="true"] {
  background: var(--bg-input);
  color: var(--text-primary);
}

.as-bar .tr {
  background: var(--border-subtle);
}

.as-bar[aria-pressed="true"] .fl {
  background: var(--accent);
}

.as-rev-actions {
  gap: 8px;
}

.as-reviews {
  grid-template-columns: 1fr;
  margin-top: 0;
}

@media (min-width: 700px) {
  .as-reviews {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .as-reviews {
    grid-template-columns: repeat(3, 1fr);
  }
}

.as-review-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.as-review p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.as-review .reviewer {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: auto;
}

.btn-primary,
.as-get,
.get-pill,
.as-sticky .as-get {
  background: var(--accent) !important;
  color: #ffffff !important;
  opacity: 1 !important;
  font-weight: 600;
  text-shadow: none;
  border: none;
}

.btn-primary:hover:not(:disabled),
.as-get:hover:not(:disabled),
.get-pill:hover:not(:disabled) {
  background: var(--accent-dim) !important;
  color: #ffffff !important;
}

.btn-primary:disabled,
.as-get:disabled {
  opacity: 0.45;
}

.as-hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

@media (max-width: 700px) {

  .as-rating-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .as-bars {
    max-width: 100%;
    width: 100%;
  }
}

/* ==========================================================================
   31. تراز یک‌خطی آیکون + متن + فلش داخل دکمه‌های فیلتر
   ========================================================================== */

.fbar {
  display: flex;
  justify-content: flex-start; /* راست‌چین (RTL) مثل قبل */
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px 2px 12px;
}

@media (max-width: 767px) {
  .fbar {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

.fdrop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding-inline: 14px 10px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-raised);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color var(--t), border-color var(--t), color var(--t);
}
.fdrop-btn:hover {
  border-color: var(--accent-dim);
  background: var(--bg-input);
}
.fdrop-btn[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.fdrop-btn.has-active {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 18%, var(--bg-raised));
  color: var(--accent);
}

.fdrop-btn > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.fdrop-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.fdrop-btn .fd-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  flex-shrink: 0;
}

.fdrop-btn .fd-chev svg {
  width: 14px;
  height: 14px;
}

.fdrop-btn .fd-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding-inline: 5px;
  line-height: 1;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 980px;
}

.fdrop-btn > span:not(.fd-chev):not(.fd-count) {
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
/* ==========================================================================
   بازیابی استایل‌های فرم و صفحه ورود (حذف‌شده در پاکسازی)
   ========================================================================== */

/* مرکز کردن کارت ورود */
.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100dvh - var(--nav-h) - 120px);
  padding: 48px 16px 64px;
}

.auth-card,
.panel.auth-card {
  width: min(100%, 420px);
  margin-inline: auto;
  padding: 28px 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 12px 0 8px;
  text-align: center;
  color: var(--text-primary);
}

/* تب‌های ورود / ثبت‌نام */
.tablist {
  display: flex;
  gap: 0;
  background: var(--bg-input);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 20px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background var(--t), color var(--t), box-shadow var(--t);
}
.tab[aria-selected="true"],
.tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.tabpanel[hidden] {
  display: none !important;
}

/* فیلد فرم */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field > label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.field .check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.field .check input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.field-error {
  min-height: 0;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--danger-text);
}
.field-error:empty {
  display: none;
}

/* اینپوت کامل */
.input,
.select,
.textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--t), box-shadow var(--t);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-disabled);
}
.input:focus,
.select:focus,
.textarea:focus,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  outline: none;
}
.input.ltr {
  direction: ltr;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.otp-input {
  letter-spacing: 0.35em;
  text-align: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* جداکننده «یا» */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* دکمه‌های تمام‌عرض */
.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
}
.btn-lg {
  min-height: 48px;
  padding-inline: 20px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
}

/* دکمه گوگل */
.btn-secondary {
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-input);
  border-color: var(--accent-dim);
}
.google-dots {
  display: inline-flex;
  gap: 3px;
  margin-inline-end: 8px;
}
.google-dots i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* اطمینان از نمایش صحیح کارت ورود روی پس‌زمینه */
body[data-page="login"] .auth-wrap {
  justify-content: center;
}
body[data-page="login"] main {
  min-height: calc(100dvh - var(--nav-h) - 80px);
}

/* بازیابی پایه دکمه‌ها */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--t), color var(--t), border-color var(--t), opacity var(--t), box-shadow var(--t);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-sm {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.8125rem;
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-input);
}
.btn-primary {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: transparent;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-dim) !important;
}

/* ناوبری سایت — اطمینان از چیدمان */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(var(--glass-blur));
  -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--nav-h);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-input);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-primary);
  transition: background var(--t);
}
.icon-btn:hover {
  background: var(--bg-input);
}

/* ==========================================================================
   بازیابی چیپ‌های دسته‌بندی افقی (صفحه اصلی)
   ========================================================================== */
.chips-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 6px 2px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.chips-scroll::-webkit-scrollbar {
  display: none;
}
.chips-scroll > li {
  flex: 0 0 auto;
  scroll-snap-align: start;
  list-style: none;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 980px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
  transition: background-color var(--t), color var(--t), border-color var(--t);
}
.cat-chip .emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cat-chip .emoji svg {
  width: 18px;
  height: 18px;
  display: block;
}
.cat-chip:hover {
  background: var(--bg-raised);
  border-color: var(--border);
  color: var(--text-primary);
}
.cat-chip[aria-current="true"],
.cat-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ردیف افقی محصولات هم */
.h-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 4px 2px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.h-row::-webkit-scrollbar {
  display: none;
}
.h-row > li {
  flex: 0 0 min(280px, 78vw);
  list-style: none;
}

/* ==========================================================================
   فاصله فوتر، دکمه قیمت، تولبار
   ========================================================================== */

/* جداسازی واضح بخش ویژگی‌ها از فوتر */
.feature-grid {
  margin-bottom: 48px;
}
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  min-height: 140px;
}
.feature-card .feature-icon {
  align-self: flex-start;
  margin-bottom: 4px;
}
.stats-grid,
.stats-strip {
  margin-bottom: 40px;
}
.site-footer {
  margin-top: 24px;
  padding-top: 40px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  background: transparent;
  clear: both;
  position: relative;
  z-index: 1;
}
.footer-grid {
  gap: 32px;
  padding-bottom: 24px;
}

/* دکمه قیمت: خوانا با فاصله کافی */
.get-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 18px;
  border-radius: 980px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  word-spacing: 0.15em;
  background: var(--accent);
  color: #fff;
  border: none;
  white-space: nowrap;
  line-height: 1;
}
.get-pill .lbl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* تولبار مرتب‌سازی و نما */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.toolbar .sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.toolbar .sort label {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.toolbar .select {
  min-height: 36px;
  padding: 6px 32px 6px 12px;
  border-radius: 980px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  appearance: none;
  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='%236e6e73' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}

.seg button svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   کارت‌های محصول هم‌اندازه در گرید
   ========================================================================== */
.grid-products {
  align-items: stretch;
}
.grid-products > li {
  display: flex;
  min-width: 0;
  height: 100%;
}
.grid-products > li > .product-card,
.grid-products .product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 180px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  gap: 0;
}

.pc-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 1 1 auto;
  min-height: 0;
}

.pc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* عنوان: همیشه ۲ خط جا رزرو می‌شود تا کارت‌ها هم‌ارتفاع بمانند */
.pc-title {
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.4em * 2);
}

.pc-seller {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rating-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  margin-top: 2px;
  min-height: 1.2em;
}

.pc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.pc-icon,
.pc-top > img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
}

.pc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ==========================================================================
   product-detail: مسیر · کنتراست · تصاویر
   ========================================================================== */

/* مسیر (breadcrumb) در یک خط */
.breadcrumb {
  display: block;
  padding: 12px 0 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  overflow: hidden;
}
.breadcrumb ol {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.breadcrumb ol::-webkit-scrollbar { display: none; }
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--text-muted);
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumb li + li::before {
  content: "/";
  margin-inline: 8px;
  color: var(--text-disabled);
  flex-shrink: 0;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb li[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 500;
}

/* بنر محصول: گرادیان و متن خوانا */
.as-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 28px 32px;
  border-radius: 24px;
  background:
    radial-gradient(90% 80% at 100% 0%, oklch(0.75 0.14 var(--h, 250) / 0.55), transparent 55%),
    linear-gradient(135deg, oklch(0.55 0.18 var(--h, 250)), oklch(0.42 0.16 var(--h2, 280)));
  color: #fff;
  margin-bottom: 20px;
}
.as-hero h1 {
  color: #fff;
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 6px;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.2);
}
.as-hero .as-sub,
.as-hero .as-sub a {
  color: rgb(255 255 255 / 0.9);
  font-size: 0.9375rem;
}
.as-meta {
  margin: 10px 0 0;
  color: rgb(255 255 255 / 0.95);
  font-size: 0.9375rem;
  font-weight: 600;
}
.as-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.as-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid rgb(255 255 255 / 0.4);
  background: rgb(255 255 255 / 0.22);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.as-tag svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.as-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.as-actions .btn-primary,
.as-actions .as-get {
  background: #0071e3 !important;
  color: #fff !important;
  min-height: 40px;
  padding: 0 22px;
  border-radius: 980px;
  font-weight: 600;
}
.as-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.2);
  border: 1px solid rgb(255 255 255 / 0.35);
  color: #fff;
}
.as-icon-btn:hover {
  background: rgb(255 255 255 / 0.32);
}
.as-icon {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.2);
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .as-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 24px 18px;
  }
  .as-icon {
    width: 100px;
    height: 100px;
  }
  .as-actions {
    justify-content: center;
  }
  .as-badges {
    justify-content: center;
  }
}

/* گالری تصاویر محصول */
.as-shots {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 14px;
  margin: 0;
  padding: 8px 2px 16px;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.as-shots::-webkit-scrollbar { display: none; }

.as-shot {
  position: relative;
  flex: 0 0 min(260px, 72vw);
  width: min(260px, 72vw);
  height: 180px;
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  scroll-snap-align: start;
  color: #fff;
  background:
    radial-gradient(90% 55% at 80% 0%, oklch(0.92 0.06 var(--h, 200) / 0.4), transparent 60%),
    linear-gradient(160deg, oklch(0.62 0.14 var(--h, 200)), oklch(0.48 0.16 var(--h2, 230)));
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.08);
}
.as-shot h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.25);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.as-mock {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}
.as-mock .ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.25);
  color: #fff;
  margin-bottom: 4px;
}
.as-mock i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: rgb(255 255 255 / 0.45);
}
.as-mock i:nth-child(2) { width: 90%; }
.as-mock i:nth-child(3) { width: 70%; }
.as-mock i:nth-child(4) { width: 80%; }

/* ==========================================================================
   امتیاز و نظرات — سبک App Store
   ========================================================================== */
.as-reviews-sec > .as-sec-head {
  display: flex;
  align-items: baseline;
  margin-bottom: 16px;
}
.as-reviews-sec > .as-sec-head h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
}

/* خلاصه امتیاز: عدد بزرگ + میله‌ها مثل اپ‌استور */
.as-rating-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
  margin-bottom: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.as-score {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.as-big {
  font-size: clamp(2.75rem, 6vw, 3.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}
.as-out-of {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.as-total {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.as-bars {
  display: flex;
  flex-direction: column;
}
.as-bar {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.6875rem;
  cursor: pointer;
}
.as-bar .n {
  font-variant-numeric: tabular-nums;
}
.as-bar .tr {
  background: var(--border-subtle);
  overflow: hidden;
}
.as-bar .fl {
  display: block;
  height: 100%;
  border-radius: 99px;
}
.as-bar:hover .fl,
.as-bar[aria-pressed="true"] .fl {
  background: var(--accent);
}
.as-bar[aria-pressed="true"] {
  color: var(--accent);
}

.as-rev-actions {
  display: flex;
  margin: 4px 0 8px;
}

/* کارت‌های نظر: افقی اسکرول مثل اپ‌استور */
.as-reviews {
  -webkit-overflow-scrolling: touch;
}

.as-review {
  flex: 0 0 min(300px, 85vw);
  width: min(300px, 85vw);
}

.as-review-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.as-review-body {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.as-more-reviews {
  margin-top: 8px;
}

/* ==========================================================================
   نظرات: راست‌چین + ستاره روی میله‌ها (مثل اپ‌استور)
   ========================================================================== */
.as-reviews-sec {
  text-align: start;
}
.as-reviews-sec > .as-sec-head {
  justify-content: flex-start;
}
.as-rating-wrap {
  align-items: stretch;
}
.as-rating-summary {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px 24px;
  width: 100%;
  max-width: 420px;
}
.as-score {
  align-items: flex-start;
  order: 0;
}
.as-bars {
  order: 1;
  flex: 1;
  min-width: 120px;
  max-width: 200px;
  gap: 3px;
}
.as-total {
  order: 2;
  margin-inline-start: 0;
  margin-inline-end: auto;
  align-self: flex-end;
  padding-bottom: 2px;
  white-space: nowrap;
}

/* میله‌ها: ستاره به‌جای عدد */
.as-bar {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
  direction: ltr; /* ستاره‌ها و میله چپ‌به‌راست مثل اپل */
  text-align: start;
}
.as-bar .n {
  font-size: 0.5625rem;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--text-muted);
  text-align: end;
  font-family: system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
}
.as-bar .tr {
  height: 2.5px;
  border-radius: 99px;
  background: color-mix(in oklch, var(--text-muted) 22%, transparent);
}
.as-bar .fl {
  background: var(--text-muted);
}
.as-bar[aria-pressed="true"] .n,
.as-bar:hover .n {
  color: var(--accent);
}

.as-rev-actions {
  justify-content: flex-start;
}

/* نوار نظرات: از راست شروع می‌شود */
.as-reviews {
  justify-content: flex-start;
  direction: rtl;
}

.as-more-reviews {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}
.as-more-reviews:hover {
  text-decoration: underline;
}

@media (max-width: 520px) {
  .as-rating-summary {
    max-width: 100%;
  }
  .as-bars {
    max-width: none;
  }
}

/* ==========================================================================
   دکمه قیمت / دریافت — آبی خالص App Store
   ========================================================================== */
button.get-pill,
.pr-end .get-pill,
.prod-row .get-pill,
.get-pill {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  height: 28px;
  padding: 0 14px !important;
  border-radius: 980px !important;
  border: none !important;
  background: #0071e3 !important;
  background-image: none !important;
  color: #ffffff !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  word-spacing: normal !important;
  white-space: nowrap;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1 !important;
  filter: none !important;
  text-shadow: none !important;
  cursor: pointer;
}
.get-pill .lbl {
  color: #ffffff !important;
  font-weight: 600;
  white-space: nowrap;
}
.get-pill:hover:not(:disabled):not(.btn-added) {
  background: #0077ed !important;
  color: #ffffff !important;
}
.get-pill:active:not(.btn-added) {
  background: #006edb !important;
  transform: scale(0.97);
}

/* حالت «در سبد» */
.get-pill.btn-added,
.get-pill.btn-added:hover {
  background: #e8f8ed !important;
  color: #248a3d !important;
  border: none !important;
}
.get-pill.btn-added .lbl {
  color: #248a3d !important;
}
[data-theme="dark"] .get-pill {
  background: #0a84ff !important;
}
[data-theme="dark"] .get-pill:hover:not(:disabled):not(.btn-added) {
  background: #409cff !important;
}
[data-theme="dark"] .get-pill.btn-added,
[data-theme="dark"] .get-pill.btn-added:hover {
  background: color-mix(in oklch, #30d158 22%, #1c1c1e) !important;
  color: #30d158 !important;
}
[data-theme="dark"] .get-pill.btn-added .lbl {
  color: #30d158 !important;
}

/* قیمت رایگان در متن کارت (نه دکمه) */
.price-free {
  color: #248a3d;
  font-weight: 700;
}

/* ==========================================================================
   نمای گرید/لیست + رفع stretched-link
   ========================================================================== */

/* سگمنت نما: آیکون‌ها وسط عمودی */
.seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 980px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  gap: 2px;
  height: 36px;
  box-sizing: border-box;
}
.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 30px;
  padding: 0;
  margin: 0;
  border-radius: 980px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 0;
}
.seg button svg,
.seg button [data-icon],
.seg button span {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  line-height: 0;
}
.seg button[aria-pressed="true"] {
  background: #0071e3;
  color: #fff;
}

/* کارت محصول: محدوده stretched-link */
.product-card,
.prod-row,
article.product-card,
article.prod-row {
  position: relative;
  isolation: isolate;
}
.stretched-link {
  position: static;
  color: inherit;
  text-decoration: none;
}
.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: auto;
}

/* دکمه‌ها و اکشن‌ها بالاتر از لینک کشیده */
.pc-actions,
.pr-end,
.pc-foot,
.product-card .icon-btn,
.prod-row .icon-btn,
.product-card .get-pill,
.prod-row .get-pill,
.product-card button,
.prod-row button,
.pc-actions a,
.pr-end a {
  position: relative;
  z-index: 2;
}

/* اطمینان از عدم پوشش کل صفحه */
.grid-products,
.grid-products > li {
  position: relative;
}

/* ==========================================================================
   صفحه‌بندی تمیز
   ========================================================================== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 12px;
  padding: 0;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 980px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  box-shadow: none;
  backdrop-filter: none;
}
.page-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}
.page-btn:hover:not(:disabled):not([aria-current="page"]) {
  background: var(--bg-input);
  border-color: var(--border);
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.page-btn.page-num {
  min-width: 36px;
  padding: 0;
  border-radius: 50%;
}
.page-btn.page-nav {
  padding: 0 14px;
  gap: 6px;
}
.page-btn.page-nav span {
  line-height: 1;
}
.page-btn[aria-current="page"] {
  background: #0071e3 !important;
  border-color: #0071e3 !important;
  color: #fff !important;
  box-shadow: none !important;
}
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
  user-select: none;
}

/* ==========================================================================
   اعلان‌ها · جستجو · مودال · نوار اطلاعات جزئیات
   ========================================================================== */

/* ----- پنل اعلان‌ها ----- */
.notif-wrap,
.wish-wrap {
  position: relative;
}
.notif-panel,
.wish-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 120;
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, 70vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-card) !important;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.14);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.notif-panel[hidden],
.wish-panel[hidden] {
  display: none !important;
}
.notif-panel .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.notif-panel .panel-head h2 {
  font-size: 0.9375rem !important;
  font-weight: 700;
  margin: 0 !important;
}
.notif-list,
.wish-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}
.notif-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 12px;
  border-radius: 12px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.45;
}
.notif-list li + li {
  margin-top: 2px;
}
.notif-list li.unread {
  background: color-mix(in oklch, var(--accent) 8%, transparent);
}
.notif-list li strong {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.notif-list li p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-list li time {
  font-size: 0.75rem;
  color: var(--text-disabled);
  margin-top: 2px;
}

/* ----- جستجو ----- */
.nav-search:not([hidden]) {
  display: block;
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: 90;
  padding: 10px 16px 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 560px);
  margin-inline: auto;
  height: 44px;
  padding: 0 14px;
  border-radius: 980px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--text-primary);
  outline: none;
}
.search-input::placeholder {
  color: var(--text-disabled);
}
.dash-search .search-input {
  border: 1px solid var(--border);
  background: var(--bg-input);
  border-radius: 980px;
  padding: 10px 14px;
  min-height: 40px;
}

/* ----- مودال (dialog) ----- */
dialog.modal {
  width: min(100% - 32px, 440px);
  max-height: min(90dvh, 640px);
  -webkit-backdrop-filter: none !important;
  display: flex;
}

dialog.modal form,
dialog.modal > form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 20px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
dialog.modal .form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
dialog.modal .form-grid.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

dialog.modal .field > label {
  text-align: start;
}
dialog.modal .input,
dialog.modal .select,
dialog.modal .textarea {
  backdrop-filter: none;
}

dialog.modal .field-hint,
dialog.modal .field-error {
  font-size: 0.75rem;
  margin: 0;
}
dialog.modal .field-hint {
  color: var(--text-muted);
}
dialog.modal .field-error {
  color: var(--danger-text);
}
dialog.modal .field-error:empty {
  display: none;
}
.modal-actions {
  margin-top: 16px;
  padding-top: 12px;
}
body.modal-open {
  overflow: hidden;
}

/* ----- نوار اطلاعات جزئیات محصول ----- */
.as-info {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 16px 0 8px;
  padding: 12px 0;
  overflow-x: auto;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  scrollbar-width: none;
}
.as-info::-webkit-scrollbar { display: none; }
.as-info > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 100px;
  padding: 8px 16px;
  border-inline-start: 1px solid var(--border-subtle);
  text-align: center;
  flex-shrink: 0;
}
.as-info > div:first-child {
  border-inline-start: 0;
}
.as-info .k {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  order: 3;
}
.as-info .v {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  min-height: auto;
  order: 1;
}
.as-info .s {
  font-size: 0.75rem;
  color: var(--text-muted);
  order: 2;
}

/* نوار چسبان جزئیات */
.as-sticky-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.as-sticky-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.as-sticky-text strong {
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   دکمه افزودن به سبد — آبی جامد (بدون شفافیت)
   ========================================================================== */
.as-actions .btn-primary,
.as-actions .as-get,
.as-actions .btn-add,
.as-sticky .as-get,
.as-sticky .btn-primary,
.buy-bar .btn-primary,
.buy-bar .btn-add,
button.as-get,
button.btn-add.btn-primary {
  background: #0071e3 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  text-shadow: none !important;
  font-weight: 600 !important;
  border-radius: 980px !important;
  min-height: 40px;
  padding-inline: 22px;
}
.as-actions .btn-primary:hover:not(:disabled),
.as-actions .as-get:hover:not(:disabled),
.as-sticky .as-get:hover:not(:disabled),
.buy-bar .btn-primary:hover:not(:disabled),
button.as-get:hover:not(:disabled) {
  background: #0077ed !important;
  color: #ffffff !important;
}
.as-actions .btn-primary .lbl,
.as-actions .as-get .lbl,
.as-sticky .as-get .lbl,
.buy-bar .btn-primary .lbl {
  color: #ffffff !important;
}

/* حالت در سبد */
.as-actions .btn-added,
.as-sticky .btn-added,
.buy-bar .btn-added,
button.as-get.btn-added {
  background: #e8f8ed !important;
  color: #248a3d !important;
}
.as-actions .btn-added .lbl,
.as-sticky .btn-added .lbl {
  color: #248a3d !important;
}

[data-theme="dark"] .as-actions .btn-primary,
[data-theme="dark"] .as-actions .as-get,
[data-theme="dark"] .as-sticky .as-get,
[data-theme="dark"] .buy-bar .btn-primary {
  background: #0a84ff !important;
  color: #ffffff !important;
}

/* ==========================================================================
   صفحه اصلی — سبک Today اپ‌استور + پرچم
   ========================================================================== */

/* تأکید با رنگ پرچم ایران (سبز · سفید · قرمز) */
.flag-em {
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .flag-em {
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* زیر‌خط پرچمی برای مرورگرهایی که clip متن ضعیف است */
@supports not (background-clip: text) {
  .flag-em {
    color: var(--text-primary);
    -webkit-text-fill-color: currentColor;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #239F40, #fff, #DA0000) 1;
  }
}

.hero {
  padding: 36px 0 20px;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 980px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0 0 12px;
}
.hero p {
  max-width: 520px;
  margin-inline: auto;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* گرید کارت‌های Today */
.today-stories {
  padding: 8px 0 24px;
}
.today-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 700px) {
  .today-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .today-card.today-large {
    grid-column: 1 / -1;
    min-height: 280px;
  }
  .today-card.today-wide {
    grid-column: 1 / -1;
    min-height: 200px;
  }
}
@media (min-width: 1000px) {
  .today-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .today-card.today-large {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 360px;
  }
  .today-card.today-wide {
    grid-column: span 2;
  }
  .today-card.today-small {
    min-height: 170px;
  }
}

.today-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 22px;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  min-height: 180px;
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.today-card:hover {
  transform: scale(1.012);
  box-shadow: 0 10px 32px rgb(0 0 0 / 0.14);
  color: #fff;
}
.today-label {
  text-transform: uppercase;
}
.today-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.2);
}
.today-card.today-large .today-title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
}
.today-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  opacity: 0.92;
  max-width: 36em;
}
.today-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.today-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.2);
  flex-shrink: 0;
}
.today-cta {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 980px;
  background: rgb(255 255 255 / 0.22);
  border: 1px solid rgb(255 255 255 / 0.3);
}

/* لیست محصولات صفحه اصلی کمی جمع‌وجورتر */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sec-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}
.link-more {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

/* ==========================================================================
   مودال داشبورد — تمیز و بدون هم‌پوشانی
   ========================================================================== */
dialog.modal {
  position: fixed !important;
  inset: 0 !important;
  margin: auto !important;
  width: min(100% - 32px, 460px) !important;
  max-height: min(88dvh, 620px) !important;
  padding: 0 !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 20px !important;
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.22) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: hidden !important;
  flex-direction: column;
}
dialog.modal[open] {
  display: flex !important;
}
dialog.modal:not([open]) {
  display: none !important;
}
dialog.modal::backdrop {
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(6px);
}

.modal-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(88dvh, 620px);
  overflow: hidden;
  background: var(--bg-card);
}
.modal-panel > .form-grid,
dialog.modal form > .form-grid,
#product-form > .form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.modal-panel > .form-grid .form-grid.cols-2,
#product-form .form-grid.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-card);
}
.modal-head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-card);
}
#delete-modal .modal-panel > p {
  padding: 20px 20px 8px;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-primary);
}
.btn-danger {
  background: #ff3b30 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 980px;
  min-height: 40px;
  padding: 0 18px;
  font-weight: 600;
}
.btn-danger:hover {
  background: #d70015 !important;
}

/* فیلدهای داخل مودال */
dialog.modal .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
dialog.modal .field > label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}
dialog.modal .input,
dialog.modal .select,
dialog.modal .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9375rem;
  box-shadow: none;
}
dialog.modal .textarea {
  min-height: 90px;
  resize: vertical;
}

/* ==========================================================================
   فهرست‌های Today (مثل Essential Games / Popular Apps)
   ========================================================================== */
.today-lists-sec {
  padding-top: 8px;
}
.today-lists {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 800px) {
  .today-lists {
    grid-template-columns: 1fr 1fr;
  }
}

.tl-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 20px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tl-head {
  margin-bottom: 10px;
  padding-inline: 4px;
}
.tl-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tl-heading {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
}
.tl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.tl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.tl-item:last-child {
  border-bottom: 0;
}
.tl-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.tl-icon,
.tl-link img.tl-icon,
.tl-link .pc-icon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
  object-fit: cover;
  flex-shrink: 0;
}
.tl-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tl-title {
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-view {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 980px;
  background: color-mix(in oklch, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
}
.tl-view:hover {
  background: color-mix(in oklch, var(--accent) 20%, transparent);
}
.tl-more {
  display: block;
  text-align: center;
  margin-top: 8px;
  padding: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

/* گرادیان قوی‌تر کارت‌های Today */
.today-card {
  background:
    radial-gradient(120% 80% at 90% -10%, oklch(0.92 0.12 var(--h) / 0.55), transparent 50%),
    radial-gradient(80% 60% at 10% 110%, oklch(0.4 0.1 var(--h) / 0.4), transparent 50%),
    linear-gradient(155deg,
      oklch(0.55 0.16 var(--h)),
      oklch(0.38 0.14 var(--h)) 55%,
      oklch(0.28 0.1 var(--h)));
}
.today-card.today-large {
  background:
    radial-gradient(100% 80% at 100% 0%, oklch(0.95 0.08 var(--h) / 0.45), transparent 55%),
    linear-gradient(145deg,
      oklch(0.52 0.15 var(--h)),
      oklch(0.30 0.12 var(--h)));
}

.hero-badge {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   رفع عنوان قهرمان + برچسب کارت Today
   ========================================================================== */

/* عبارت پرچمی — همیشه خوانا */
.flag-em {
  font-style: normal !important;
  font-weight: 800 !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  display: inline !important;
  padding: 0 2px;
}
/* اگر clip کار نکرد، رنگ تیره + زیر‌خط پرچم */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .flag-em {
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
    background: none !important;
    box-decoration-break: clone;
    border-bottom: 3px solid #239F40;
  }
}
[data-theme="dark"] .flag-em {
  background: linear-gradient(
    90deg,
    #3ecf5a 0%,
    #3ecf5a 32%,
    #f5f5f7 32%,
    #f5f5f7 68%,
    #ff453a 68%,
    #ff453a 100%
  ) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

.hero h1 {
  color: var(--text-primary);
}

/* برچسب کارت نباید روی عنوان بیفتد */
.today-card {
  padding-top: 44px !important;
}
.today-label {
  position: absolute;
  top: 14px;
  inset-inline-start: 18px;
  inset-inline-end: 18px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 1;
}
.today-title {
  position: relative;
  z-index: 0;
  margin: 0 0 6px !important;
}
.today-text {
  position: relative;
  z-index: 0;
}
/* سه رنگ جدا برای اطمینان از خوانایی */
.flag-em {
  background: none !important;
  -webkit-text-fill-color: unset !important;
  color: inherit !important;
  font-style: normal;
  font-weight: 800;
}
.flag-em .fg { color: #239F40; }
.flag-em .fw { color: var(--text-primary); }
.flag-em .fr { color: #DA0000; }
[data-theme="dark"] .flag-em .fg { color: #3ecf5a; }
[data-theme="dark"] .flag-em .fw { color: #f5f5f7; }
[data-theme="dark"] .flag-em .fr { color: #ff453a; }

/* ==========================================================================
   کارت نظرات — سبک App Store تمیزتر
   ========================================================================== */
.as-reviews {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin: 0;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.as-reviews::-webkit-scrollbar { display: none; }

.as-review {
  flex: 0 0 min(300px, 82vw);
  width: min(300px, 82vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: var(--bg-input);
  border: 0;
  box-shadow: none;
  min-height: 148px;
}
.as-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.as-review-title {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.as-review-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
  text-align: end;
  line-height: 1.25;
}
.as-review-meta time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.as-review-user {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-review-stars {
  line-height: 1;
  margin-top: 0;
}
.as-review-stars .stars {
  gap: 1px;
}
.as-review-stars .stars svg {
  width: 11px;
  height: 11px;
}
.as-review-body {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.as-reviews-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  margin: 8px 0 12px;
}
.as-reviews-head h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}
.as-reviews-head .muted {
  font-size: 0.8125rem;
}

/* نشان سبد در نوار پایین: جلوگیری از کش آمدن بین دو لبه */
html body .bottom-nav a .badge-count {
  inset-inline-end: auto;
  width: auto;
}

/* موبایل تک‌ستونی: رزرو دو خط برای عنوان لازم نیست */
@media (max-width: 520px) {
  html body .pc-title {
    min-height: 0;
  }
}

/* موبایل: مرتب‌سازی و نمای شبکه/فهرست در یک خط؛ تعداد نتایج بالای آن‌ها */
@media (max-width: 560px) {
  html body .toolbar .result-count {
    flex: 1 1 100%;
    min-width: 0;
  }
  html body .toolbar .sort {
    flex: 1 1 0;
    min-width: 0;
    justify-content: flex-start;
  }
  html body .toolbar .sort .select {
    flex: 1;
    min-width: 0;
  }
}

/* موبایل و تبلت: سبد در نوار پایین است، پس از هدر برش دارید */
@media (max-width: 899px) {
  html body .site-header .nav-actions [data-cart-link] {
    display: none;
  }
}

/* بنر نصب PWA */
.pwa-banner {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  margin-inline: auto;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--bg-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.pwa-banner.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.pwa-banner-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 22.37%;
  background: var(--accent);
  color: var(--on-accent);
}
.pwa-banner-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.4;
}
.pwa-banner-text strong {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pwa-banner-text span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.pwa-banner-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pwa-banner-close {
  padding-inline: 8px;
}
@media (min-width: 900px) {
  .pwa-banner { bottom: 16px; }
}