/* =====================================================================
   عابد — استایل فروشگاه نرم‌افزار
   ===================================================================== */

/* ---------- فونت محلی Ravi ---------- */
@font-face { font-family: "Ravi"; src: url("../font/Ravi-Thin.woff2") format("woff2"); font-weight: 100; font-display: swap; }
@font-face { font-family: "Ravi"; src: url("../font/Ravi-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Ravi"; src: url("../font/Ravi-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ravi"; src: url("../font/Ravi-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Ravi"; src: url("../font/Ravi-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Ravi"; src: url("../font/Ravi-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Ravi"; src: url("../font/Ravi-Black.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Ravi"; src: url("../font/Ravi-ExtraBlack.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #161b2e;
  --text-soft: #525c75;
  --muted: #94a0b8;
  --primary: #4f46e5;        /* ایندیگو */
  --primary-dark: #3a31c4;
  --primary-soft: #e8e7fd;
  --accent: #0ea5e9;         /* آبی آسمانی */
  --accent-soft: #e0f2fe;
  --gold: #06b6d4;           /* فیروزه‌ای روشن (برای گرادیان) */
  --danger: #ef4444;
  --success: #16a34a;
  --border: #e4e8f1;
  --shadow-sm: 0 2px 8px rgba(30, 41, 90, 0.06);
  --shadow: 0 8px 28px rgba(30, 41, 90, 0.10);
  --shadow-lg: 0 18px 50px rgba(30, 41, 90, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1240px;
  --header-h: 70px;
  --mnav-h: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; height: 100%; }

body {
  font-family: "Ravi", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 15px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
#app { flex: 1 0 auto; width: 100%; padding-bottom: 24px; }
.page-view { width: 100%; transition: opacity .24s ease; }
.page-view.page-enter { opacity: 0; }
.page-view.page-morph { opacity: .72; transition-duration: .16s; }
.section-swap { transition: opacity .2s ease; }
.section-swap.is-swapping { opacity: .55; }

@media (prefers-reduced-motion: reduce) {
  .page-view, .section-swap { transition: none !important; }
}

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm); font-weight: 700;
  font-size: 15px; transition: .2s; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.3); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #185c58; transform: translateY(-2px); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { color: var(--text-soft); }
.btn-ghost:hover { color: var(--primary); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 28px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* آیکن‌های SVG درون‌خطی (اندازه بر اساس font-size والد) */
.ic-svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
.ic-svg.spin { animation: ic-spin 1s linear infinite; transform-origin: center; }
@keyframes ic-spin { to { transform: rotate(360deg); } }

/* بارگذاری صفحه (اسپینر) */
.page-loader { display: grid; place-items: center; gap: 14px; padding: 100px 20px; color: var(--muted); }
.page-loader .loader-ring { font-size: 48px; color: var(--primary); line-height: 0; }
.page-loader .loader-ring.css-only {
  width: 44px; height: 44px; border: 3px solid var(--primary-soft); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.page-loader p { font-size: 14px; }

/* اسکلت بارگذاری محصولات */
.sk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; padding-bottom: 16px; }
.sk-thumb { aspect-ratio: 1 / 1; background: var(--surface-2); }
.sk-line { height: 12px; border-radius: 6px; background: var(--surface-2); margin: 12px 14px 0; }
.sk-line.sk-sm { width: 40%; height: 10px; }
.sk-line.sk-md { width: 60%; }
.sk-thumb, .sk-line { position: relative; overflow: hidden; }
.sk-thumb::after, .sk-line::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: sk-shimmer 1.2s infinite;
}
@keyframes sk-shimmer { 100% { transform: translateX(100%); } }

/* ---------- هدر ---------- */
.header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.header-top { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--gold)); color: #fff;
  font-size: 22px; box-shadow: var(--shadow-sm);
}
.logo-text b { font-size: 18px; display: block; line-height: 1.3; }
.logo-text span { font-size: 11px; color: var(--muted); }

.search-box {
  flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: 12px; padding: 0 14px; height: 46px;
  transition: .2s;
}
.search-box:focus-within { border-color: var(--primary); background: #fff; }
.search-box input { flex: 1; border: none; background: none; outline: none; height: 100%; color: var(--text); }
.search-box .ico { color: var(--muted); font-size: 18px; }

.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  position: relative; width: 46px; height: 46px; border-radius: 12px; display: grid;
  place-items: center; font-size: 21px; color: var(--text-soft); transition: .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--primary); }
.badge-count {
  position: absolute; top: 4px; left: 4px; min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--primary); color: #fff; border-radius: 10px; font-size: 11px;
  display: grid; place-items: center; font-weight: 700; border: 2px solid #fff;
}

/* نوار دسته‌بندی */
.nav-cats { border-top: 1px solid var(--border); background: var(--surface); }
.nav-cats-inner { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.nav-cats-inner::-webkit-scrollbar { display: none; }
.nav-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 30px;
  background: var(--surface-2); color: var(--text-soft); font-size: 13.5px; font-weight: 600;
  white-space: nowrap; transition: .2s;
}
.nav-chip:hover, .nav-chip.active { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- هیرو ---------- */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden; margin: 22px 0;
  background: linear-gradient(120deg, #0f172a 0%, #3730a3 55%, #4f46e5 100%);
  color: #fff; padding: 56px 44px; min-height: 320px; display: flex; align-items: center;
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .12;
  background-image: radial-gradient(circle at 80% 20%, #fff 0, transparent 40%),
                    radial-gradient(circle at 10% 90%, var(--gold) 0, transparent 35%);
}
.hero-content { position: relative; z-index: 1; max-width: 560px; }
.hero h1 { font-size: 38px; line-height: 1.4; margin-bottom: 14px; }
.hero p { font-size: 17px; opacity: .92; margin-bottom: 26px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.15);
  padding: 7px 16px; border-radius: 30px; font-size: 13px; margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.2);
}

/* ---------- بخش‌ها ---------- */
.section { margin: 42px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ""; width: 5px; height: 26px; background: var(--primary); border-radius: 4px; }
.section-head a { color: var(--primary); font-size: 14px; font-weight: 600; }

/* شبکه دسته‌بندی */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.cat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 14px; text-align: center; transition: .25s; box-shadow: var(--shadow-sm);
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--primary-soft); }
.cat-card .ic {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid;
  place-items: center; font-size: 30px; background: var(--surface-2);
}
.cat-card b { font-size: 14.5px; display: block; }
.cat-card span { font-size: 12px; color: var(--muted); }

/* ---------- شبکه محصولات ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: .25s; box-shadow: var(--shadow-sm); position: relative;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.product-thumb { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); }
.cover { display: block; width: 100%; height: 100%; }
.product-thumb .cover { transition: .4s; }
.product-card:hover .product-thumb .cover { transform: scale(1.06); }
.product-badges { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; }
.tag { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; color: #fff; }
.tag-sale { background: var(--danger); }
.tag-hot { background: var(--primary); }
.tag-new { background: var(--accent); }
.tag-special { background: var(--gold); }
.fav-btn {
  position: absolute; top: 10px; left: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.9); display: grid; place-items: center; font-size: 18px;
  color: var(--muted); transition: .2s; box-shadow: var(--shadow-sm);
}
.fav-btn:hover, .fav-btn.on { color: var(--danger); transform: scale(1.1); }

.product-body { padding: 14px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.product-cat { font-size: 12px; color: var(--accent); font-weight: 600; }
.product-title { font-size: 14.5px; font-weight: 700; line-height: 1.6; height: 3.2em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-rating { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stars { color: #ddd; font-size: 14px; letter-spacing: 1px; }
.star.on { color: var(--gold); }
.product-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price-wrap { display: flex; flex-direction: column; }
.price-old { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.price-now { font-size: 16px; font-weight: 800; color: var(--text); }
.price-now small { font-size: 11px; font-weight: 500; color: var(--muted); }
.add-mini {
  width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 22px; transition: .2s; flex-shrink: 0;
}
.add-mini:hover { background: var(--primary); color: #fff; }

/* ---------- صفحه محصول ---------- */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 26px 0; }
.pdp-gallery { position: relative; align-self: start; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.pdp-gallery .cover { width: 100%; aspect-ratio: 1; height: auto; }
.pdp-info h1 { font-size: 26px; line-height: 1.5; margin-bottom: 14px; }
.pdp-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; color: var(--text-soft); font-size: 13px; }
.pdp-price-box { background: var(--surface-2); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.pdp-price-row { display: flex; align-items: center; justify-content: space-between; }
.pdp-price-now { font-size: 28px; font-weight: 900; color: var(--primary); }
.pdp-desc { color: var(--text-soft); margin: 18px 0; line-height: 2; }
.pdp-specs { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 18px 0; }
.spec-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 13px; }
.spec-row:nth-child(odd) { background: var(--surface-2); }
.spec-row span { display: inline-flex; align-items: center; gap: 8px; color: var(--text-soft); }
.spec-row b { font-weight: 700; text-align: left; }
.pdp-features { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 20px 0; }
.feat { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; font-size: 13px; }
.feat .fic { font-size: 22px; }
.qty-control { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.qty-control button { width: 42px; height: 46px; font-size: 22px; color: var(--primary); }
.qty-control button:hover { background: var(--surface-2); }
.qty-control span { width: 50px; text-align: center; font-weight: 700; font-size: 16px; }
.pdp-actions { display: flex; gap: 12px; margin-top: 20px; }

/* ---------- ابزار صفحه فهرست ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar select { border: 1.5px solid var(--border); border-radius: 10px; padding: 9px 12px; background: var(--surface); color: var(--text); cursor: pointer; }
.listing { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: 90px; }
.filters h3 { font-size: 15px; margin-bottom: 14px; }
.filter-group { margin-bottom: 20px; }
.filter-group h4 { font-size: 13px; color: var(--text-soft); margin-bottom: 10px; }
.filter-list label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; cursor: pointer; color: var(--text-soft); }
.filter-list input { accent-color: var(--primary); width: 16px; height: 16px; }

/* ---------- سبد خرید ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; margin: 24px 0; }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.cart-thumb { flex-shrink: 0; }
.cart-item .cover { width: 92px; height: 92px; border-radius: var(--radius-sm); }
.order-thumb { width: 54px; height: 54px; border-radius: 10px; display: block; }
.cart-item-body { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cart-item-title { font-weight: 700; font-size: 14.5px; }
.cart-item-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 10px; flex-wrap: wrap; }
.qty-mini { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 10px; }
.qty-mini button { width: 32px; height: 34px; font-size: 18px; color: var(--primary); }
.qty-mini span { width: 36px; text-align: center; font-weight: 700; }
.link-danger { color: var(--danger); font-size: 13px; }
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: sticky; top: 90px; }
.summary h3 { font-size: 17px; margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px; color: var(--text-soft); }
.summary-row.total { border-top: 1.5px dashed var(--border); margin-top: 8px; padding-top: 16px; font-size: 17px; font-weight: 800; color: var(--text); }
.coupon-row { display: flex; gap: 8px; margin: 14px 0; }
.coupon-row input { flex: 1; min-width: 0; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.coupon-row .btn { flex-shrink: 0; white-space: nowrap; }

/* انتخاب درگاه پرداخت */
.gw-list { display: flex; flex-direction: column; gap: 10px; }
.gw-title { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.gw-title svg { width: 16px; height: 16px; }
.gw-option { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; transition: .2s; font-size: 14px; }
.gw-option:hover { border-color: var(--primary-soft); }
.gw-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.gw-option input { position: absolute; opacity: 0; pointer-events: none; }
.gw-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; position: relative; transition: .2s; }
.gw-option.selected .gw-dot { border-color: var(--primary); }
.gw-option.selected .gw-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary); }
.gw-label { font-weight: 600; color: var(--text); }
.gw-empty { display: flex; align-items: center; gap: 8px; padding: 14px; border: 1.5px dashed var(--border); border-radius: 12px; color: var(--text-soft); font-size: 13px; }
.gw-empty svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- فرم‌ها ---------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--text-soft); }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px;
  background: var(--surface); color: var(--text); outline: none; transition: .2s;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .err { color: var(--danger); font-size: 12px; margin-top: 5px; display: none; }
.field.invalid .err { display: block; }
.field.invalid input { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ---------- چک‌اوت ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; margin: 24px 0; }
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; }
.step.active { color: var(--primary); }
.step.active .num { background: var(--primary); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--border); min-width: 20px; }

/* ---------- رسید سفارش ---------- */
.receipt { max-width: 640px; margin: 30px auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.receipt-head { padding: 36px; text-align: center; color: #fff; }
.receipt-head.ok { background: linear-gradient(135deg, var(--success), #146c3a); }
.receipt-head.fail { background: linear-gradient(135deg, var(--danger), #922b21); }
.receipt-head .ic { font-size: 64px; margin-bottom: 12px; }
.receipt-head h2 { font-size: 24px; }
.receipt-body { padding: 28px; }
.receipt-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.receipt-row span:first-child { color: var(--muted); }

/* ---------- کدهای لایسنس ---------- */
.lic-box { margin-top: 18px; padding: 16px; border: 1px solid var(--primary-soft); background: var(--primary-soft); border-radius: var(--radius-sm); }
.lic-box h4 { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--primary-dark); margin-bottom: 4px; }
.lic-hint { font-size: 12px; color: var(--text-soft); margin-bottom: 12px; }
.lic-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.lic-item:last-child { margin-bottom: 0; }
.lic-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.lic-code { display: inline-block; font-family: "Consolas", monospace; font-size: 14px; letter-spacing: 1px; background: var(--surface-2); color: var(--text); border: 1px dashed var(--border); border-radius: 8px; padding: 6px 12px; margin: 2px 4px 2px 0; user-select: all; }

/* ---------- پنل کاربری ---------- */
.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; margin: 24px 0; }
.account-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.account-nav .me { text-align: center; padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.account-nav .avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; background: linear-gradient(135deg,var(--primary),var(--gold)); color:#fff; display:grid; place-items:center; font-size:26px; }
.account-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--radius-sm); color: var(--text-soft); font-size: 14px; transition: .2s; }
.account-nav a:hover, .account-nav a.active { background: var(--primary-soft); color: var(--primary-dark); }
.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.order-card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.status-pill { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 20px; }
.status-paid { background: #e3f5ea; color: var(--success); }
.status-pending { background: #fef3e0; color: #b8860b; }
.status-failed { background: #fde8e6; color: var(--danger); }

/* ---------- فوتر ---------- */
.footer { background: #2b2118; color: #d9cdbd; margin-top: auto; padding: 60px 0 20px; flex-shrink: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 30px; }
.footer h4 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.footer a { color: #d9cdbd; font-size: 13.5px; display: block; padding: 4px 0; transition: .2s; }
.footer a:hover { color: var(--gold); padding-right: 4px; }
.footer-brand p { font-size: 13.5px; opacity: .8; line-height: 2; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 36px; padding-top: 20px; text-align: center; font-size: 12.5px; opacity: .7; }
.footer-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.trust-badge { background: #fff; border-radius: 12px; padding: 8px; display: grid; place-items: center; min-width: 92px; min-height: 92px; transition: .2s; }
.trust-badge:hover { transform: translateY(-3px); }
.trust-badge img { max-width: 86px; max-height: 86px; border-radius: 8px; }
.trust-badge.placeholder { background: rgba(255,255,255,.06); border: 1.5px dashed rgba(255,255,255,.25); color: #d9cdbd; font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.7; }
.trust-badge.placeholder small { font-weight: 400; opacity: .7; font-size: 11px; }
.socials { display: flex; gap: 10px; margin-top: 14px; }
.socials a { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 18px; padding: 0; }
.socials a:hover { background: var(--primary); }
.trust-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 30px 0; }
.trust-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; flex: 1; min-width: 180px; box-shadow: var(--shadow-sm); }
.trust-item .ic { font-size: 28px; }
.trust-item b { display: block; font-size: 14px; }
.trust-item span { font-size: 12px; color: var(--muted); }

/* ---------- مودال ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(43,33,24,.55); backdrop-filter: blur(3px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 18px; }
.modal-overlay.open { display: flex; animation: fade .2s; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); animation: pop .25s; max-height: 92vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 19px; }
.modal-body { padding: 22px; }
.modal-close { font-size: 26px; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; }
.modal-close:hover { background: var(--surface-2); }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--text-soft); transition: .2s; }
.auth-tabs button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(10px); } }

/* ---------- توست ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--text); color: #fff; padding: 13px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; align-items: center; gap: 10px; animation: slideIn .3s; max-width: 340px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast .ic { font-size: 18px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-30px); } }

/* ---------- حالت خالی ---------- */
.empty-state {
  text-align: center; padding: 60px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#homeHot, #homeSale, #homeNewest, #productList { min-height: 260px; }
.empty-state .ic { font-size: 70px; margin-bottom: 16px; opacity: .6; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 22px; }

/* ---------- ناوبری پایین موبایل ---------- */
.mobile-nav { position: fixed; bottom: 0; right: 0; left: 0; z-index: 90; background: var(--surface); border-top: 1px solid var(--border); display: none; justify-content: space-around; align-items: center; height: var(--mnav-h); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 20px rgba(0,0,0,.06); }
.mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 14px; color: var(--muted); font-size: 10px; line-height: 1.3; position: relative; }
.mobile-nav a.active { color: var(--primary); }
.mobile-nav a .ic { font-size: 19px; }
.mobile-nav .badge-count { top: -2px; left: 6px; }

/* ---------- صفحه/بخش‌بندی محتوای ساده ---------- */
.page-head { background: linear-gradient(120deg, var(--surface-2), var(--primary-soft)); border-radius: var(--radius); padding: 30px; margin: 22px 0; }
.page-head h1 { font-size: 26px; }
.page-head .breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--primary); }
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; line-height: 2.1; color: var(--text-soft); }
.prose h3 { color: var(--text); margin: 18px 0 10px; font-size: 18px; }
.prose p { margin-bottom: 12px; }
.prose ul { margin: 0 0 14px; padding-right: 22px; }
.prose li { margin-bottom: 8px; }
.prose b { color: var(--text); }

.skeleton { animation: pulse 1.2s infinite; background: var(--surface-2); border-radius: var(--radius); }
.skeleton-card { pointer-events: none; box-shadow: var(--shadow-sm) !important; }
.skeleton-card:hover { transform: none !important; box-shadow: var(--shadow-sm) !important; }
.skeleton-thumb { width: 100%; aspect-ratio: 1; display: block; border-radius: 0; }
.skeleton-line { height: 14px; margin-bottom: 10px; border-radius: 8px; }
.skeleton-line.sm { width: 38%; height: 12px; }
.skeleton-line.md { width: 62%; }
.skeleton-line.lg { width: 88%; height: 2.6em; margin-bottom: 12px; }
.skeleton-line.xl { width: 72%; height: 28px; margin: 10px 0 14px; }
.skeleton-inline { display: inline-block; width: 64px; height: 12px; border-radius: 6px; vertical-align: middle; }
.skeleton-block { height: 88px; border-radius: var(--radius); margin: 16px 0; }
.skeleton-btn { height: 52px; border-radius: var(--radius-sm); width: 100%; }
.skeleton-cart-thumb { width: 92px; height: 92px; border-radius: var(--radius-sm); flex-shrink: 0; }
.skeleton-summary { height: 280px; border-radius: var(--radius); }
@keyframes pulse { 50% { opacity: .55; } }

/* عناصر مخصوص موبایل (در دسکتاپ مخفی) */
.search-toggle { display: none; }
.filter-trigger { display: none; }
.filters-head { display: flex; align-items: center; justify-content: space-between; }
.filters-close { display: none; width: 38px; height: 38px; border-radius: 10px; color: var(--text-soft); font-size: 22px; place-items: center; }
.filters-overlay { display: none; }
body.no-scroll { overflow: hidden; }

/* ---------- رسپانسیو ---------- */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 860px) {
  .pdp { grid-template-columns: 1fr; gap: 22px; }
  .cart-layout, .checkout-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-layout > *, .checkout-layout > * { min-width: 0; }
  .summary { position: static; }
  .account-layout { grid-template-columns: 1fr; }
  .hero { padding: 40px 26px; min-height: auto; }
  .hero h1 { font-size: 28px; }

  /* فهرست محصولات: یک‌ستونه + فیلترِ کشویی */
  .listing { display: block; }
  .filter-trigger { display: inline-flex; }
  .toolbar { position: sticky; top: var(--header-h); z-index: 40; }
  .filters {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 340px);
    z-index: 120; border-radius: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(100%); transition: transform .28s ease; box-shadow: var(--shadow-lg);
    padding-bottom: 30px;
  }
  .filters.open { transform: translateX(0); }
  .filters-close { display: grid; }
  .filters-overlay { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(15,18,34,.45);
    opacity: 0; visibility: hidden; transition: .28s; }
  .filters-overlay.show { opacity: 1; visibility: visible; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  body { padding-bottom: calc(var(--mnav-h) + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
  .container { padding: 0 14px; }

  /* هدر فشرده‌تر — لوگو راست، آیکن‌ها چپ */
  .header-top { gap: 10px; justify-content: space-between; }
  .logo-mark { width: 38px; height: 38px; font-size: 19px; border-radius: 11px; }
  .logo-text b { font-size: 16px; }
  .logo-text span { display: none; }
  .icon-btn { width: 42px; height: 42px; font-size: 20px; }
  .search-toggle { display: grid; }
  .header-actions .hide-mobile { display: none; }
  .nav-cats { display: none; }

  /* جستجوی موبایل: نوار تمام‌عرض زیر هدر */
  .search-box { display: none; position: absolute; top: var(--header-h); right: 0; left: 0;
    margin: 0; border-radius: 0; height: 56px; padding: 0 16px; border: none; border-bottom: 1px solid var(--border);
    background: var(--surface); box-shadow: var(--shadow); }
  .search-box.mobile-show { display: flex; }

  .mobile-nav { display: flex; }

  /* نوار ابزار صفحه محصولات: دکمه‌ها تمام‌عرض */
  .toolbar { gap: 8px; padding: 10px; flex-wrap: wrap; }
  .filter-trigger { flex: 1; justify-content: center; height: 44px; box-sizing: border-box; }
  .sort-field { flex: 1; }
  .sort-field select { flex: 1; width: 100%; height: 44px; box-sizing: border-box; }
  .sort-label-text { display: none; }

  /* مراحل تسویه فشرده‌تر */
  .steps { gap: 4px; margin-bottom: 18px; }
  .step { font-size: 10.5px; gap: 5px; white-space: nowrap; }
  .step .num { width: 22px; height: 22px; font-size: 12px; }
  .step-line { min-width: 8px; }

  /* هیرو */
  .hero { padding: 34px 22px; margin: 14px 0; border-radius: var(--radius); }
  .hero h1 { font-size: 23px; line-height: 1.5; }
  .hero p { font-size: 14px; margin-bottom: 20px; }
  .hero .btn { width: 100%; }

  /* بخش‌ها و گرید */
  .section { margin: 26px 0; }
  .section-head { margin-bottom: 16px; }
  .section-head h2 { font-size: 19px; }
  .section-head h2::before { height: 22px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-card { padding: 16px 8px; }
  .cat-card .ic { width: 52px; height: 52px; font-size: 25px; margin-bottom: 8px; }
  .cat-card b { font-size: 13px; }
  .product-body { padding: 12px; gap: 6px; }
  .product-title { font-size: 13.5px; }

  /* فرم‌ها و چیدمان‌ها */
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px 16px; }
  .pdp-features { grid-template-columns: 1fr 1fr; }
  .page-head { padding: 20px 18px; margin: 14px 0; }
  .page-head h1 { font-size: 21px; }
  .prose { padding: 18px; }
  .form-card { padding: 18px; }

  /* جلوگیری از زوم خودکار iOS روی فیلدها (≥16px) */
  input, textarea, select, .field input, .field textarea, .field select,
  .search-box input, .coupon-row input { font-size: 16px; }

  /* صفحه محصول: نوار چسبانِ خرید در پایین */
  .pdp { margin: 14px 0; }
  .pdp-info h1 { font-size: 21px; }
  .pdp-actions {
    position: fixed; right: 0; left: 0; bottom: calc(var(--mnav-h) + env(safe-area-inset-bottom));
    z-index: 80; background: var(--surface); border-top: 1px solid var(--border);
    margin: 0; padding: 10px 14px; gap: 10px; box-shadow: 0 -6px 20px rgba(15,18,34,.08);
  }
  .pdp-actions .btn-lg { padding: 14px 18px; }
  /* فضای پایینی اضافه در صفحه محصول تا نوار خرید محتوا را نپوشاند */
  body[data-route="product"] { padding-bottom: calc(var(--mnav-h) + 78px + env(safe-area-inset-bottom)); }

  /* مودال تمام‌عرض‌تر */
  .receipt { margin: 16px 0; }
}

@media (max-width: 380px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* غیرفعال‌کردن جلوه‌ی شناوری روی دستگاه‌های لمسی (تا روی تپ نچسبد) */
@media (hover: none) {
  .product-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .product-card:hover .product-thumb .cover { transform: none; }
  .cat-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .btn-primary:hover, .btn-accent:hover { transform: none; }
}
