@import url('/css/fonts.css?v=6.1-d1');

:root {
  --ink: #1a1d2e;
  --ink-soft: #6b7094;
  --ink-lighter: #9ca0bd;
  --paper: #f0f2f8;
  --paper-card: #ffffff;
  --line: #e2e4ef;
  --primary: #3b5bdb;
  --primary-dark: #2b44b8;
  --primary-rgb: 59, 91, 219;
  --primary-light: #edf2ff;
  --accent: #f76707;
  --accent-dark: #e05500;
  --teal: #0ca678;
  --teal-light: #e6fcf5;
  --red: #e03131;
  --red-light: #fff5f5;
  --amber: #f59f00;
  --amber-light: #fff9db;
  --shadow-sm: 0 1px 3px rgba(26,29,46,.06);
  --shadow: 0 2px 8px rgba(26,29,46,.08);
  --shadow-lg: 0 8px 24px rgba(26,29,46,.12);
  --shadow-xl: 0 16px 48px rgba(26,29,46,.16);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { direction: rtl; scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a, button, input, select, textarea {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}

.num { font-family: 'IBM Plex Mono', 'Vazirmatn', monospace; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; }
.hidden { display: none !important; }

/* ─── انیمیشن‌ها ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── هدر ─── */
.store-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  animation: slideInDown .4s ease both;
}
.store-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.store-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.store-logo img {
  height: 36px;
  width: auto;
}
.store-logo-text {
  font-weight: 800;
  font-size: 16px;
  color: var(--primary);
  white-space: nowrap;
}
.store-search {
  flex: 1;
  display: flex;
  align-items: stretch;
  max-width: 520px;
}
.store-search input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: inherit;
  font-size: 14px;
  background: var(--paper);
  transition: border-color .15s;
}
.store-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.store-search-btn {
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.store-search-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.store-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.store-menu-toggle { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:34px; padding:6px 10px; border:1px solid var(--line); border-radius:var(--radius-sm); background:#fff; color:var(--ink); font:inherit; font-size:12px; font-weight:700; line-height:20px; }
.store-menu-toggle svg { color:var(--primary); }
.store-menu-toggle b { white-space:nowrap; }.store-menu-toggle:hover { border-color:var(--primary); color:var(--primary); }
.store-category-backdrop { position:fixed; inset:0; z-index:180; background:rgba(26,29,46,.3); backdrop-filter:blur(2px); animation:fadeIn .18s ease; }
.store-category-menu { position:fixed; top:0; left:12px; z-index:181; width:min(360px,calc(100vw - 24px)); padding:18px; overflow-y:auto; overscroll-behavior:contain; background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:0 14px 35px rgba(26,29,46,.16); opacity:0; visibility:hidden; pointer-events:none; transform:translateY(-8px); transition:opacity .22s ease,transform .22s ease,visibility .22s; }
.store-category-menu.open { opacity:1; visibility:visible; pointer-events:auto; transform:translateY(0); }
.store-category-menu-head { display:flex; align-items:center; justify-content:space-between; padding-bottom:14px; border-bottom:1px solid var(--line); font-size:16px; }.store-category-menu-head button { width:32px; height:32px; border:0; border-radius:50%; background:var(--paper); color:var(--ink-soft); font-size:24px; line-height:1; }
.store-category-menu-body { padding-top:16px; }
.store-category-all { display:block; width:100%; min-height:44px; margin-bottom:14px; padding:10px 14px; border:1px solid var(--primary); border-radius:11px; background:var(--primary-light); color:var(--primary); text-align:right; text-decoration:none; font:inherit; font-size:13px; font-weight:800; cursor:pointer; }
.store-category-all:hover { background:var(--primary); color:#fff; }
.store-category-group { margin-bottom:9px; border:1px solid var(--line); border-radius:12px; background:#fff; transition:border-color .18s,box-shadow .18s; }
.store-category-group.is-open { border-color:rgba(var(--primary-rgb),.35); background:#fafbff; box-shadow:0 4px 14px rgba(var(--primary-rgb),.06); }
.store-category-root { display:flex; align-items:center; gap:10px; width:100%; min-height:52px; padding:12px 14px; border:0; border-radius:11px; background:transparent; color:var(--ink); text-align:right; font:inherit; font-weight:800; font-size:13px; cursor:pointer; }
.store-category-root-row { display:flex; align-items:center; }
.store-category-root-row .store-category-root { flex:1; width:auto; min-width:0; text-decoration:none; }
.store-category-toggle { flex:0 0 44px; display:grid; place-items:center; width:44px; height:44px; margin-inline-end:4px; border:0; border-radius:8px; background:transparent; color:var(--ink-soft); cursor:pointer; }
.store-category-toggle:hover { color:var(--primary); background:var(--primary-light); }
.store-category-name { flex:1; min-width:0; overflow-wrap:anywhere; }
.store-category-count { display:grid; place-items:center; min-width:23px; height:23px; padding:0 5px; border-radius:7px; background:var(--paper); color:var(--ink-soft); font-size:11px; font-weight:500; }
.store-category-chevron { flex:0 0 18px; width:18px; height:18px; color:var(--ink-soft); transition:transform .2s; }
.store-category-group.is-open .store-category-chevron { transform:rotate(180deg); color:var(--primary); }
.store-category-group.is-open .store-category-root, .store-category-group.is-selected .store-category-root { color:var(--primary); }
.store-category-children { display:grid; grid-template-columns:minmax(0,1fr); gap:4px; margin:0 12px 12px; padding:8px 8px 0 0; border-top:1px solid var(--line); border-inline-start:2px solid rgba(var(--primary-rgb),.18); }
.store-category-children[hidden] { display:none; }
.store-category-children {
  max-height:var(--category-children-height, 280px);
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:contain;
  touch-action:pan-y;
  scrollbar-width:thin;
  scrollbar-color:#a8b6e5 transparent;
  scrollbar-gutter:stable;
  align-content:start;
}
.store-category-children::-webkit-scrollbar { width:6px; }
.store-category-children::-webkit-scrollbar-thumb { background:#a8b6e5; border-radius:8px; }
.store-category-children:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.store-combo-trigger[aria-expanded=true] i { transform:rotate(180deg); }
.store-category-children :is(button,a) { display:flex; align-items:center; gap:9px; min-height:42px; padding:9px 10px; border:0; border-radius:8px; background:transparent; color:var(--ink-soft); text-decoration:none; font:inherit; font-size:12px; text-align:right; line-height:1.8; overflow-wrap:anywhere; cursor:pointer; }
.store-category-children :is(button,a)::before { content:''; flex:0 0 5px; width:5px; height:5px; border-radius:50%; background:currentColor; opacity:.5; }
.store-category-children .store-category-view-all { font-weight:700; color:var(--primary); }
.store-category-root:hover, .store-category-children :is(button,a):hover, .store-category-children :is(button,a)[aria-current=true] { color:var(--primary); background:var(--primary-light); }
.store-category-menu-body :is(button,a):focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.store-category-empty { color:var(--ink-soft); font-size:13px; text-align:center; padding:24px 0; }
@media (prefers-reduced-motion:reduce) { .store-category-chevron, .store-category-group { transition:none; } }
.store-link-b2b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  flex-wrap: nowrap;
  line-height: 20px;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all .15s;
}
.store-menu-toggle svg, .store-link-b2b svg { display:block; width:14px; height:14px; flex:0 0 14px; transform:translateY(-1px); }
.store-link-b2b span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.store-link-b2b:hover { border-color: var(--primary); color: var(--primary); }
.store-cart-btn {
  position: relative;
  background: none;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  transition: all .15s;
}
.store-cart-btn:hover { border-color: var(--primary); color: var(--primary); }
.store-cart-count {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ─── بنر ─── */
.store-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
  color: #fff;
  padding: 48px 24px;
  text-align: center;
  animation: fadeInUp .5s ease both;
  animation-delay: .1s;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.store-hero::before,
.store-hero::after {
  content: '';
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255,255,255,.11);
  filter: blur(1px);
  animation: heroFloat 9s ease-in-out infinite alternate;
}
.store-hero::before { width: 260px; height: 260px; top: -180px; right: 8%; }
.store-hero::after { width: 180px; height: 180px; bottom: -130px; left: 13%; animation-delay: -4s; }
.store-hero-inner { position: relative; z-index: 1; }
.store-hero h1 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
}
.store-hero p {
  font-size: 16px;
  opacity: .85;
}

/* ─── لیوت اصلی ─── */
.store-main { flex: 1; padding: 24px 0 60px; }
.store-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* ─── فیلترها ─── */
.store-filters {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  color: var(--ink);
  box-shadow: var(--shadow-xl);
}
.store-filters::backdrop { background:rgba(26,29,46,.4); backdrop-filter:blur(4px); }
.store-filters[open] { animation:storeFiltersIn .3s cubic-bezier(.2,.8,.2,1) both; }
.store-filters[open]::backdrop { animation:fadeIn .3s ease both; }
.store-filters.is-closing { animation:storeFiltersOut .22s ease both; pointer-events:none; }
.store-filters.is-closing::backdrop { animation:storeFiltersBackdropOut .22s ease both; }
@keyframes storeFiltersIn { from { opacity:0; transform:translateY(18px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes storeFiltersOut { from { opacity:1; transform:translateY(0) scale(1); } to { opacity:0; transform:translateY(12px) scale(.98); } }
@keyframes storeFiltersBackdropOut { from { opacity:1; } to { opacity:0; } }
@media (prefers-reduced-motion:reduce) {
  .store-filters[open], .store-filters[open]::backdrop { animation:none; }
  .store-category-menu { transition:none; }
}
body.store-filters-open { overflow:hidden; }
.store-filters .store-combo-menu { position:static; margin-top:7px; max-height:240px; max-height:min(240px,35dvh); overflow-y:auto; box-shadow:none; animation:none; }
.store-filters button:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
.store-filters .store-btn-full { margin-top:4px; min-height:44px; }
.store-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.store-filters-header h3 { font-size: 16px; font-weight: 700; }
.store-filter-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--paper);
  border: none;
  color: var(--ink-soft);
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
}
.store-filter-close:hover { background:var(--primary-light); color:var(--primary); }
.store-filter-group { margin-bottom: 16px; }
.store-filter-group:last-child { margin-bottom: 0; }
.store-filter-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.store-filter-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b5bdb' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat 12px center;
  background-size: 16px;
  padding-left: 38px;
  box-shadow: 0 2px 5px rgba(26,29,46,.04);
  color: var(--ink);
  margin-bottom: 8px;
  cursor: pointer;
}
.store-filter-group select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.store-filter-group { padding:12px; border:1px solid #e3e7f4; border-radius:var(--radius-sm); background:linear-gradient(135deg,#fff,#fafbff); }
.store-filter-group select:hover { border-color:#9eb0ff; box-shadow:0 3px 9px rgba(59,91,219,.12); }
.store-native-select-hidden { display:none !important; }
.store-combo { position:relative; }.store-combo-trigger { width:100%; min-height:41px; display:flex; align-items:center; justify-content:space-between; padding:9px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); background:#fff; color:var(--ink); font:inherit; font-size:13px; text-align:right; }.store-combo-trigger i { color:var(--primary); font-style:normal; font-size:18px; transition:transform .18s; }.store-combo:has(.store-combo-menu:not(.hidden)) .store-combo-trigger { border-color:var(--primary); box-shadow:0 0 0 2px rgba(59,91,219,.12); }.store-filter-group:has(.store-combo-menu:not(.hidden)) { position:relative; z-index:2; }.store-combo-menu { position:absolute; top:calc(100% + 5px); right:0; left:0; z-index:170; overflow:hidden; padding:5px; border:1px solid #d9e0f5; border-radius:10px; background:#fff; box-shadow:0 10px 22px rgba(26,29,46,.16); animation:fadeInUp .16s ease; }.store-combo-menu button { width:100%; padding:9px 10px; border:0; border-radius:6px; background:transparent; color:var(--ink); font:inherit; font-size:12px; text-align:right; }.store-combo-menu button:hover, .store-combo-menu button.selected { background:var(--primary-light); color:var(--primary); }

/* ─── محصولات ─── */
.store-products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.store-products-header span {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}
.store-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-height: 40px;
  cursor: pointer;
}
.store-filter-toggle:hover, .store-filter-toggle[aria-expanded=true] { color:var(--primary); border-color:var(--primary); background:var(--primary-light); }

.store-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* کارت محصول */
.store-product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .25s, transform .25s, border-color .25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  animation: fadeInUp .4s ease both;
}
.store-product-card:nth-child(1) { animation-delay: .05s; }
.store-product-card:nth-child(2) { animation-delay: .1s; }
.store-product-card:nth-child(3) { animation-delay: .15s; }
.store-product-card:nth-child(4) { animation-delay: .2s; }
.store-product-card:nth-child(5) { animation-delay: .25s; }
.store-product-card:nth-child(6) { animation-delay: .3s; }
.store-product-card:nth-child(7) { animation-delay: .35s; }
.store-product-card:nth-child(8) { animation-delay: .4s; }
.store-product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary);
}
.store-product-image {
  position: relative;
  padding-top: 100%;
  background: #f8f9fc;
  border-radius: 7px;
  overflow: hidden;
}
.store-product-image img {
  position: absolute;
  top: 7px;
  left: 7px;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  object-fit: contain;
  padding: 0;
  border-radius: 7px;
  transition: transform .3s;
}
.store-product-card:hover .store-product-image img {
  transform: scale(1.05);
}
.store-product-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-lighter);
  font-size: 13px;
}
.store-product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.store-product-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.store-product-brand {
  font-size: 12px;
  color: var(--ink-lighter);
  margin-bottom: 4px;
}
.store-product-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 10px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.store-product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.store-product-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  direction: rtl;
  unicode-bidi: normal;
}
.store-product-price small {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-lighter);
  direction: rtl;
  unicode-bidi: normal;
}
.store-product-price { display:flex; flex-direction:column; align-items:flex-start; line-height:1.35; }
.store-old-price { display:block; color:var(--ink-lighter); font-size:13px; font-weight:600; line-height:1.4; text-decoration:line-through; direction:rtl; unicode-bidi:normal; }
.store-product-current-price { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px; white-space:nowrap; direction:rtl; }
.store-add-cart-btn {
  justify-content: center;
  text-align: center;
  padding: 8px 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background .15s, transform .15s;
  white-space: nowrap;
}
.store-add-cart-btn:hover { background: var(--primary-dark); transform: scale(1.05); }
.store-add-cart-btn:active { transform: scale(.95); }
.store-add-cart-btn:disabled {
  background: var(--ink-lighter);
  cursor: not-allowed;
}

.store-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-lighter);
}
.store-empty p { margin-top: 12px; font-size: 15px; }

/* ─── صفحه‌بندی ─── */
/* Same pagination layout and controls as the partner/admin list dock. */
.store-list-dock {
  position:sticky; bottom:calc(12px + env(safe-area-inset-bottom, 0px)); z-index:30;
  display:flow-root;
  /* دکمه‌ی شناور سبد خرید با position:absolute دقیقاً 10px بالای لبه‌ی بالای همین
     باکس می‌نشیند. بدون فاصله‌ی واقعی بین شبکه‌ی محصولات و این باکس، آن لبه‌ی بالا
     دقیقاً همان انتهای شبکه است و دکمه (ارتفاع ~46px) روی ردیف آخر محصولات می‌افتد.
     این margin-top همان فاصله را ایجاد می‌کند تا دکمه در فضای خالی بنشیند. */
  margin-top: 70px;
}
.store-pagination {
  --ink:#181a30; --ink-soft:#5c5f80; --line:#e6e5f3;
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px;
  margin-top:14px; padding:10px 14px; background:#fff;
  border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 24px rgba(24,26,48,.14);
}
.store-pagination:empty { display:none; }
.store-pagination .pagination-info { font-size:12.5px; color:var(--ink-soft); }
.store-pagination .pagination-controls { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.store-pagination .pagination-pages { display:flex; align-items:center; gap:4px; }
.store-pagination .btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:6px 10px; border:0; border-radius:6px; font:inherit; font-weight:700; font-size:12.5px; cursor:pointer; transition:background .15s ease,box-shadow .15s ease,transform .1s ease; }
.store-pagination .btn:active { transform:translateY(1px); }
.store-pagination .btn-outline { background:transparent; border:1px solid var(--line); color:var(--ink); }
.store-pagination .btn-outline:hover { background:#f2f1fa; }
.store-pagination .btn-gold { background:linear-gradient(135deg,#7d6bff 0%,#5541e0 100%); color:#fff; box-shadow:0 6px 16px rgba(109,94,248,.32); }
.store-pagination .btn-gold:hover { background:#5541e0; }
.store-pagination .btn:disabled { opacity:.45; cursor:not-allowed; }
.store-pagination .btn:disabled:hover { background:transparent; }
.store-pagination .btn:focus-visible { outline:2px solid #6d5ef8; outline-offset:2px; }
.store-pagination .pagination-page { min-width:34px; padding:6px 8px; }
.store-pagination .pagination-nav { white-space:nowrap; gap:4px; }
.store-pagination .ico-chev { width:14px; height:14px; flex:0 0 auto; }
.store-pagination .pagination-ellipsis { padding:0 4px; color:var(--ink-soft); font-size:13px; }
@media (max-width:640px) {
  .store-pagination { flex-direction:column; align-items:stretch; gap:8px; padding:10px; }
  .store-pagination .pagination-info { display:none; }
  .store-pagination .pagination-controls { flex-wrap:nowrap; justify-content:center; gap:4px; }
  .store-pagination .pagination-nav { flex:0 0 auto; min-height:38px; padding:6px; gap:2px; }
  .store-pagination .pagination-page { min-width:30px; min-height:38px; padding:6px; }
}

.store-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,29,46,.45);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s;
}
.store-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.store-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 400px;
  max-width: 90vw;
  background: #fff;
  z-index: 201;
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
}
.store-drawer.open { transform: translateX(0); }
/* پنل شناور سمت راست (پروفایل) */
.store-drawer-right {
  left: auto;
  right: 0;
  transform: translateX(100%);
}
.store-drawer-right.open { transform: translateX(0); }
.store-drawer-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
  color: var(--ink-lighter);
  font-size: 12px;
  font-weight: 700;
}
.store-drawer-divider::before,
.store-drawer-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.store-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.store-drawer-header h3 { font-size: 17px; font-weight: 700; }
.store-drawer-close {
  background: none;
  border: none;
  color: var(--ink-soft);
  padding: 4px;
}
.store-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.store-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.store-cart-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--ink-lighter);
}
.store-cart-empty p { margin-top: 12px; font-size: 14px; }

/* آیتم سبد */
.store-cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.store-cart-item:last-child { border-bottom: none; }
.store-cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  object-fit: contain;
  padding: 4px;
  background: #f8f9fc;
  flex-shrink: 0;
}
.store-cart-item-info { flex: 1; min-width: 0; }
.store-cart-item-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.store-cart-item-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  direction: ltr;
  unicode-bidi: plaintext;
}
.store-cart-item-controls {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.store-cart-item-controls button {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: none;
  background: #f4f5f9;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.store-cart-item-controls button:hover { background: #eaecf5; }
.store-cart-item-controls span {
  min-width: 26px;
  padding-inline: 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}
.store-cart-item-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 0;
  margin-top: 4px;
}

.store-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* ─── دکمه‌ها ─── */
.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.store-btn:disabled { opacity: .5; cursor: not-allowed; }
.store-btn-primary { background: var(--primary); color: #fff; }
.store-btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--primary-rgb),.35); }
.store-btn-primary:active:not(:disabled) { transform: translateY(0); }
.store-btn-full { width: 100%; }
.store-btn-outline {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  margin-top: 10px;
}
.store-btn-outline:hover { border-color: var(--red); color: var(--red); }

/* ─── دکمه شناور سبد خرید ─── */
.store-cart-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 190;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-xl);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  animation: fadeInUp .3s ease both;
}
.store-cart-fab:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(var(--primary-rgb),.3); }
.store-cart-fab:active { transform: translateY(0); }
.store-cart-fab.cart-fab-hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }
.store-cart-fab #cartFabCount {
  background: rgba(255,255,255,.25);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 0 5px;
}
.store-cart-fab-total { direction: ltr; unicode-bidi: plaintext; }

/* ─── یادداشت روش پرداخت ─── */
.store-payment-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

/* ─── مودال ─── */
.store-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,29,46,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}
.store-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn .25s ease both;
}
.store-modal-lg { max-width: 720px; }
.store-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.store-modal-header h3 { font-size: 17px; font-weight: 700; }
.store-modal-close {
  background: none;
  border: none;
  color: var(--ink-soft);
  padding: 4px;
}
.store-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ─── فرم‌ها ─── */
.store-field { margin-bottom: 16px; }
.store-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.store-field input,
.store-field textarea,
.store-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  transition: border-color .15s;
}
.store-field input:focus,
.store-field textarea:focus,
.store-field select:focus {
  outline: none;
  border-color: var(--primary);
}
.store-field textarea { resize: vertical; }

/* روش پرداخت */
.store-payment-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.store-payment-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
}
.store-payment-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.store-payment-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.store-payment-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.store-checkout-summary {
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}
.store-checkout-summary .summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.store-checkout-summary .summary-row:last-child { margin-bottom: 0; }
.store-checkout-summary .summary-total {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: 8px;
}

.store-msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.store-msg.error { background: var(--red-light); color: var(--red); }
.store-msg.ok { background: var(--teal-light); color: var(--teal); }

/* ─── مودال نتیجه پرداخت ─── */
.store-payment-result-modal { max-width: 380px; }
.store-payment-result-body {
  padding: 32px 24px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.store-payment-result-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.store-payment-result-icon svg { width: 32px; height: 32px; }
.store-payment-result-modal.is-success .store-payment-result-icon { background: var(--teal-light); color: var(--teal); }
.store-payment-result-modal.is-fail .store-payment-result-icon { background: var(--red-light); color: var(--red); }
#paymentResultTitle { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.store-payment-result-modal.is-success #paymentResultTitle { color: var(--teal); }
.store-payment-result-modal.is-fail #paymentResultTitle { color: var(--red); }
#paymentResultMessage { font-size: 14px; color: var(--ink-soft); line-height: 1.8; margin-bottom: 16px; }
.store-payment-result-ref {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 13px;
}
.store-payment-result-ref span { color: var(--ink-soft); font-weight: 600; }
.store-payment-result-ref strong { font-weight: 800; letter-spacing: .3px; }

/* ─── مودال جزئیات محصول ─── */
#productModal {
  align-items: center;
  padding: 16px;
}
#productModal > .store-modal {
  align-self: center;
  border-radius: var(--radius-lg);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  box-shadow: var(--shadow-xl);
  animation: scaleIn .2s ease both;
}
#productModal .store-modal-header { flex-shrink:0; gap:12px; }
#productModal .store-modal-header h3 { overflow-wrap:anywhere; }
#productModal .store-modal-close { flex-shrink:0; }
.store-product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 24px;
  align-items: start;
}
.store-detail-gallery { grid-column:1; grid-row:1 / 3; min-width:0; }
.store-detail-info { grid-column:2; }
.store-detail-actions { grid-column:2; display:grid; gap:10px; min-width:0; }
.store-detail-actions .store-detail-specs-btn { margin:0; }
.store-detail-image {
  --image-inset: 16px;
  position: relative;
  background: #f8f9fc;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 0;
}
.store-detail-image > img {
  position: absolute;
  inset: 0;
  margin: auto;
  padding: 0;
  width: auto;
  height: auto;
  max-width: calc(100% - 2 * var(--image-inset));
  max-height: calc(100% - 2 * var(--image-inset));
  min-height: 0;
  object-fit: contain;
  border-radius: 7px;
}
.store-detail-thumbs {
  position: absolute;
  z-index: 1;
  inset-inline: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: calc(100% - 20px);
  margin-inline: auto;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 3px 14px rgba(26,29,46,.1);
  scrollbar-width: thin;
}
.store-detail-thumb {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 2px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.store-detail-thumb img { display:block; width:100%; height:100%; object-fit:contain; border-radius:4px; }
.store-detail-thumb:hover, .store-detail-thumb.active { border-color:var(--primary); }
.store-detail-thumb:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.store-detail-info h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.store-detail-brand {
  font-size: 13px;
  color: var(--ink-lighter);
  margin-bottom: 16px;
}
.store-detail-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 16px;
  line-height: 1.4;
  direction: rtl;
  unicode-bidi: normal;
}
.store-detail-price .store-old-price { align-self:flex-start; margin:0; font-size:15px; }
.store-detail-price .store-product-current-price { align-self:flex-start; }
.store-detail-price small {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-lighter);
  direction: rtl;
  unicode-bidi: normal;
}
.store-detail-stock {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.store-detail-stock.in-stock { color: var(--teal); }
.store-detail-stock.out-of-stock { color: var(--red); }
.store-detail-specs {
  font-size: 13px;
  line-height: 2;
  color: var(--ink-soft);
  white-space: pre-wrap;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}
.store-detail-info { min-width:0; overflow-wrap:anywhere; }
.store-detail-specs-btn { margin-bottom:10px; border-color:var(--primary); color:var(--primary); background:var(--primary-light); }
.store-detail-specs-btn:hover { border-color:var(--primary-dark); color:var(--primary-dark); }
.store-specs-dialog {
  margin:auto;
  padding:0;
  width:calc(100% - 32px);
  max-width:560px;
  max-height:calc(100vh - 48px);
  max-height:calc(100dvh - 48px);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  background:var(--paper-card);
  color:var(--ink);
  box-shadow:var(--shadow-xl);
  overflow:hidden;
}
.store-specs-dialog[open] { display:flex; flex-direction:column; animation:scaleIn .2s ease both; }
.store-specs-dialog::backdrop { background:rgba(26,29,46,.6); }
.store-specs-dialog .store-modal-header { flex-shrink:0; gap:12px; }
.store-specs-dialog .store-modal-close { font-size:26px; line-height:1; min-width:36px; min-height:36px; }
.store-specs-dialog .store-detail-specs {
  max-height:none;
  overflow:visible;
  overflow-wrap:anywhere;
  margin:0;
  padding:16px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#f8f9fc;
  line-height:2.1;
}
@media (max-width:600px) {
  #productModal .store-modal-header { padding:12px 14px; }
  #productModal .store-modal-header h3 { font-size:14px; }
  #productModal .store-modal-body { padding:14px; }
  .store-product-detail { gap:12px; }
  .store-detail-gallery { grid-row:1; }
  .store-detail-actions { grid-column:1 / -1; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .store-detail-actions .store-btn { min-width:0; min-height:44px; padding:10px 6px; font-size:12px; white-space:normal; }
  .store-detail-actions .store-btn:only-child { grid-column:1 / -1; }
  .store-detail-info h2 { font-size:14px; }
  .store-detail-brand, .store-detail-price, .store-detail-stock { margin-bottom:10px; }
  .store-detail-price { font-size:20px; }
  .store-detail-info .store-btn { padding:10px 6px; font-size:12px; }
  .store-detail-image { --image-inset:10px; }
  .store-detail-thumbs { inset-inline:6px; bottom:6px; max-width:calc(100% - 12px); padding:4px; gap:4px; }
  .store-detail-thumb { flex-basis:44px; width:44px; height:44px; }
}

/* ─── فوتر ─── */
.store-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
}
.store-footer p {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.store-version { display:inline-block; margin-inline-start:8px; padding-inline-start:8px; border-inline-start:1px solid var(--line); white-space:nowrap; font-size:12px; }
.store-footer-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
}
.store-footer-links a {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}
.store-footer-links a:hover { text-decoration: underline; }
.store-footer-links span { color: var(--line); }

/* ─── ریسپانسیو (۴ دسته دستگاه) ───
   دسکتاپ:           بزرگ‌تر از 1024px (پیش‌فرض، بدون media query)
   دسکتاپ عمودی:      بین 901px تا 1024px، یا دسکتاپ در جهت عمودی
   تبلت:              بین 601px تا 900px
   موبایل:            کوچک‌تر یا مساوی 600px
*/

/* --- دسکتاپ عمودی / لپ‌تاپ‌های کوچک --- */
@media (max-width: 1024px) {
  .store-container { gap: 16px; }
  .store-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

/* --- تبلت (و دسکتاپ عمودی از نظر چیدمان ستون‌ها) --- */
@media (max-width: 900px) {
  .store-container {
    grid-template-columns: 1fr;
  }
  .store-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
  .store-product-name { font-size: 13px; }
  .store-product-price { font-size: 14px; }
  .store-detail-grid { grid-template-columns: 1fr; }
  .store-hero h1 { font-size: 22px; }
  .store-hero p { font-size: 14px; }
  .store-drawer, .store-drawer-right { width: 380px; }
}

/* --- موبایل --- */
@media (max-width: 600px) {
  .store-header-inner { padding: 10px 14px; gap: 10px; }
  .store-header-actions { gap: 8px; }
  .store-logo-text { display: none; }
  .store-link-b2b { font-size: 12px; padding: 5px 10px; }
  .store-link-b2b svg { display: block; }
  .store-partner-btn { font-size: 12px; padding: 6px 10px; }
  .store-partner-btn svg { display: none; }
  .store-partner-logout-btn { width: 30px; height: 30px; }
  .store-search input { padding: 9px 12px; font-size: 13px; }
  .store-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .store-product-info { padding: 10px; }
  .store-product-name { font-size: 12px; -webkit-line-clamp: 2; }
  .store-product-price { font-size: 13px; }
  .store-add-cart-btn { padding: 6px 8px; font-size: 11px; }
  .store-hero { padding: 32px 16px; }
  .store-hero h1 { font-size: 20px; }
  .store-container { padding: 0 12px; }
  .store-drawer, .store-drawer-right { width: 100%; max-width: 100vw; }
  .store-cart-fab-total { display: none; } /* روی موبایل فقط تعداد نشان داده می‌شود تا جا بیشتری بماند */
  .store-modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; align-self: flex-end; max-height: 92vh; }
  .store-modal-backdrop { align-items: flex-end; padding: 0; }
}

/* ============================================================
   نسخه 5.0 - چیدمان فروشگاه در ۴ اندازه صفحه
   ============================================================ */
html, body { max-width:100%; overflow-x:clip; }

/* دسکتاپ افقی */
@media (min-width:1201px) {
  .store-header-inner { padding-inline:clamp(24px, 4vw, 56px); }
  .store-header-actions { gap:10px; }
  .store-product-card { min-width:0; }
}

/* دسکتاپ عمودی: هدر دو ردیف، فیلتر ثابت و کارت‌های دو ستونه */
@media (min-width:901px) and (max-width:1200px) and (orientation:portrait) {
  .store-header-inner { display:grid; grid-template-columns:auto auto 1fr; justify-content:stretch; }
  .store-search { grid-column:1 / -1; grid-row:2; max-width:none; width:100%; }
  .store-header-actions { justify-self:end; gap:7px; }
  .store-hero { padding-block:44px; }
}

/* تبلت: نوار جست‌وجو در ردیف مستقل و اجزای هدر قابل لمس */
@media (min-width:601px) and (max-width:900px) {
  .store-header-inner { display:grid; grid-template-columns:auto 1fr auto; }
  .store-menu-toggle { justify-self:start; }
  .store-header-actions { justify-self:end; gap:8px; }
  .store-search { grid-column:1 / -1; grid-row:2; max-width:none; width:100%; }
  .store-hero { padding-block:38px; }
  .store-hero h1 { font-size:28px; }
  .store-products-header { gap:10px; }
}

/* موبایل: لوگو و دسته‌بندی در بالا، اقدامات در یک ردیف و جست‌وجو تمام‌عرض */
@media (max-width:600px) {
  .store-header-inner { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:10px; }
  .store-logo { min-width:0; }
  .store-logo-text { overflow:hidden; text-overflow:ellipsis; font-size:14px; }
  .store-menu-toggle b { display:none; }
  .store-menu-toggle { padding:8px 10px; }
  .store-header-actions { grid-column:1 / -1; grid-row:2; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); width:100%; gap:8px; }
  .store-header-actions > button { width:100%; min-width:0; justify-content:center; }
  .store-search { grid-column:1 / -1; grid-row:3; width:100%; }
  .store-hero { padding-block:30px; }
  .store-hero h1 { font-size:23px; line-height:1.7; }
  .store-hero p { font-size:13px; }
  .store-products-header { align-items:flex-start; flex-wrap:wrap; }
  .store-products-header > * { min-width:0; }
  .store-category-menu { width:min(360px, 94vw); }
}

/* --- انیمیشن نرم در همه‌ی دستگاه‌ها، با احترام به تنظیم کاهش حرکت سیستم‌عامل --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── دکمه پنل همکاران ─── */
.store-partner-btn {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .15s, box-shadow .15s;
  white-space: nowrap;
  animation: fadeIn .3s ease both;
}
.store-partner-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(247,103,7,.35);
}
.store-partner-btn:active { transform: translateY(0); }
.store-partner-btn svg { width: 16px; height: 16px; }
.store-partner-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  transition: all .15s;
}
.store-partner-logout-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* ─── مودال ورود / ثبت‌نام ─── */
.store-auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}
.store-auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
}
.store-auth-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.store-auth-tab:hover:not(.active) { color: var(--ink); }
.store-auth-hint {
  font-size: 12px;
  color: var(--ink-lighter);
  text-align: center;
  margin-top: 14px;
  line-height: 1.8;
}
/* تیک همکار هستم */
.store-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  cursor: pointer;
  transition: background .15s;
}
.store-checkbox-row:hover { background: #dde3ff; }
.store-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.store-checkbox-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
}
.store-support-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  direction: rtl;
  transition: color .15s;
}
.store-support-link:hover { color: var(--primary); }
.store-support-link a {
  direction: ltr;
  unicode-bidi: plaintext;
  font-family: 'IBM Plex Mono', monospace;
}

/* کارت پشتیبانی در فوتر؛ هم‌خانواده با کارت سبز کارشناس فروش */
.store-footer-support { display:flex; align-items:center; justify-content:space-between; gap:10px; width:min(100%,320px); margin:10px auto 0; padding:8px 12px; border:1px solid #bfe8d9; border-radius:10px; background:var(--teal-light); color:var(--ink); text-align:right; box-shadow:0 3px 10px rgba(12,166,120,.08); }
.store-footer-support:hover { border-color:var(--teal); transform:translateY(-1px); }
.store-footer-support-info { display:grid; gap:1px; min-width:0; }
.store-footer-support-info small { color:var(--ink-soft); font-size:11px; font-weight:600; }
.store-footer-support-info strong { font-size:13px; }
.store-footer-support-info b { color:var(--teal); font-size:13px; }
.store-footer-support-phone { display:inline-flex; flex:0 0 38px; width:38px; height:38px; align-items:center; justify-content:center; border-radius:50%; background:var(--teal); color:#fff; box-shadow:0 4px 10px rgba(12,166,120,.28); }
.store-footer-support-phone svg { width:18px; height:18px; }
@media (max-width:600px) { .store-footer-support { width:100%; } }

/* ─── انیمیشن اسکرول ─── */
.store-animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .4s ease, transform .4s ease;
}
.store-animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── کارت سفارش‌های مشتری ─── */
#ordersListBody { display: grid; gap: 14px; }
.store-order-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp .35s ease both;
}
.store-order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fafbff, var(--primary-light));
}
.store-order-card-header strong { display: block; font-size: 14px; color: var(--ink); }
.store-order-eyebrow, .store-order-field > span {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}
.store-order-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--primary-light);
  border: 1px solid #cbd5ff;
}
.store-order-status-processing { color: #087f5b; background: var(--teal-light); border-color: #96f2d7; }
.store-order-status-awaiting-payment { color: var(--accent-dark, #a15c00); background: var(--accent-light, #fff3d6); border-color: #ffd873; }
.store-order-status-rejected, .store-order-status-cancelled { color: var(--red); background: var(--red-light); border-color: #ffc9c9; }
.store-order-status-delivered { color: #5f3dc4; background: #f3f0ff; border-color: #d0bfff; }
.store-order-card-body { padding: 14px 16px 16px; }
.store-order-fields { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 10px; margin-bottom: 12px; }
.store-order-field { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.store-order-field strong { display: block; overflow-wrap: anywhere; font-size: 12px; line-height: 1.7; }
.store-order-items { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.store-order-items-title { display: flex; justify-content: space-between; padding: 9px 12px; background: #fafbff; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.store-order-item-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px dashed var(--line); }
.store-order-item-row:last-child { border-bottom: 0; }
.store-order-item-row strong { display: block; font-size: 12px; line-height: 1.65; }
.store-order-item-row small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.store-order-item-row > .num { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.store-order-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-weight: 800; font-size: 13px; }
.store-order-total .num { font-size: 15px; white-space: nowrap; }
.store-order-pay-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .15s;
}
.store-order-pay-btn:hover { opacity: .9; }
.store-order-pay-btn:disabled { opacity: .6; cursor: default; }
@media (max-width: 600px) {
  .store-order-card-header, .store-order-card-body { padding-inline: 12px; }
  .store-order-fields { grid-template-columns: 1fr; }
  .store-order-item-row { align-items: flex-start; }
  .store-order-item-row > .num { font-size: 11px; }
  .store-order-total .num { font-size: 13px; }
}

/* ─── تنظیم دقیق چهار نمای هدف ─── */
@keyframes heroFloat {
  from { transform: translate3d(-10px, 0, 0) scale(.95); }
  to { transform: translate3d(18px, 20px, 0) scale(1.08); }
}

/* دسکتاپ افقی: فضای وسیع و کارت‌های بزرگ‌تر */
@media (min-width: 1201px) {
  .store-container { gap: 28px; }
  .store-products-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
  .store-hero { padding-block: 56px; }
  .store-hero h1 { font-size: 32px; }
}

/* دسکتاپ عمودی/پنجره‌های باریک: از فشرده‌شدن هدر و کارت‌ها جلوگیری می‌کند */
@media (min-width: 901px) and (max-width: 1200px) and (orientation: portrait) {
  .store-header-inner { padding-inline: 18px; gap: 12px; }
  .store-logo-text { font-size: 14px; }
  .store-header-actions { gap: 8px; }
  .store-link-b2b { padding-inline: 9px; }
  .store-container { padding-inline: 18px; gap: 16px; }
  .store-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* تبلت: نوار ابزار قابل لمس، فیلتر کشویی و کارت‌های سه‌ستونه */
@media (min-width: 601px) and (max-width: 900px) {
  .store-header-inner { padding-inline: 18px; gap: 12px; }
  .store-search { max-width: none; }
  .store-products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .store-product-info { padding: 12px; }
  .store-filter-toggle { min-height: 40px; }
  .store-hero { padding-block: 40px; }
}

/* موبایل: هدر دو‌ردیفه، اهداف لمسی بزرگ و کارت‌های جمع‌وجور */
@media (max-width: 600px) {
  .store-header-inner { flex-wrap: wrap; justify-content: flex-start; }
  .store-search { order: 3; flex: 0 0 100%; max-width: none; }
  .store-header-actions { margin-inline-start: auto; }
  .store-link-b2b, .store-partner-btn { min-height: 34px; }
  .store-hero::before { right: -80px; }
  .store-hero::after { left: -60px; }
  .store-product-card:hover { transform: none; }
  .store-products-header { margin-bottom: 12px; }
}

/* اولویت نهایی نسخه 5.0 برای هدر فروشگاه در موبایل */
@media (max-width:600px) {
  .store-header-inner { display:flex; flex-wrap:wrap; gap:8px; }
  .store-logo { order:0; flex:1 1 0; min-width:0; }
  .store-logo img { max-width:100%; object-fit:contain; }
  .store-logo-text { overflow:hidden; text-overflow:ellipsis; font-size:14px; }
  .store-menu-toggle { order:3; flex:0 0 44px; width:44px; min-width:44px; height:44px; min-height:44px; aspect-ratio:1; padding:0; }
  .store-menu-toggle b { display:none; }
  .store-header-actions { display:contents; }
  .store-header-actions > button { order:1; position:relative; flex:0 0 44px; width:44px; min-width:44px; height:44px; min-height:44px; aspect-ratio:1; padding:0; justify-content:center; }
  .store-header-actions > #authBtn { order:2; }
  .store-header-actions > .store-partner-logout-btn { order:4; margin-inline-start:8px; }
  /* Keep icon buttons named for screen readers while hiding their visible labels. */
  .store-header-actions > button > span { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
  .store-header-actions > button > svg, .store-menu-toggle svg { display:block; width:18px; height:18px; flex:0 0 18px; transform:none; }
  .store-search { order:5; flex:0 0 100%; width:100%; max-width:none; }
}

.store-specs-dialog.overlay-closing::backdrop { animation:storeFiltersBackdropOut .24s cubic-bezier(.4,0,.2,1) both; }

.price-updating { display:inline-block; font-family:inherit; font-size:12px; font-weight:600; line-height:1.9; color:var(--ink-soft); white-space:normal; direction:rtl; }

.store-detail-price > .price-updating,
.store-detail-actions > .price-updating {
  display:flex;
  width:100%;
  min-width:0;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.store-detail-actions > .price-updating { min-height:44px; }
/* One-row header; search yields width to the surrounding actions. */
.store-header-inner { display:flex; flex-wrap:nowrap; gap:10px; }
.store-logo { order:0; flex:0 1 auto; min-width:0; }
.store-logo-text { max-width:180px; overflow:hidden; text-overflow:ellipsis; }
.store-menu-toggle { order:1; flex:0 0 auto; }
.store-search-toggle { display:none; }
.store-search { order:2; flex:1 1 240px; min-width:0; width:auto; max-width:none; }
.store-search input { min-width:0; width:0; }
.store-search-btn { flex:0 0 44px; padding-inline:10px; }
.store-header-actions { display:contents; }
.store-header-actions > button { order:3; flex:0 0 auto; width:auto; margin:0; white-space:nowrap; }
.store-header-actions > #authBtn { order:3; }
.store-header-actions > #ordersBtn { order:4; }
.store-header-actions > .store-partner-logout-btn { order:5; margin-inline-start:0; }
@media (min-width:601px) and (max-width:1100px) {
  .store-logo-text { display:none; }
  .store-header-inner { padding-inline:14px; gap:8px; }
  .store-header-actions > button { max-width:140px; }
}
@media (max-width:600px) {
  .store-header-inner { padding:10px 12px; gap:6px; }
  .store-logo { flex:1 1 0; }
  .store-logo-text { display:none; }
  .store-logo img { max-width:100%; height:36px; object-fit:contain; }
  .store-menu-toggle, .store-search-toggle, .store-header-actions > button {
    flex:0 0 44px; width:44px; min-width:44px; height:44px; min-height:44px; padding:0; aspect-ratio:1;
  }
  .store-search-toggle { order:2; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:var(--radius-sm); color:var(--primary); background:white; cursor:pointer; }
  .store-search-toggle[aria-expanded=true] { background:var(--primary-light); border-color:var(--primary); }
  .store-search { display:none; position:absolute; top:100%; inset-inline:12px; width:auto; padding:10px; background:white; border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); }
  .store-header.search-open .store-search { display:flex; animation:fadeInUp .18s ease; }
}
@media (prefers-reduced-motion:reduce) {
  .store-header.search-open .store-search { animation:none; }
}
.store-header-actions > .store-partner-logout-btn { flex:0 0 44px; width:44px; min-width:44px; height:44px; padding:0; display:inline-flex; align-items:center; justify-content:center; }
/* Keep the search field and header actions at the same height. */
@media (min-width:601px) {
  .store-menu-toggle, .store-header-actions > button { height:44px; min-height:44px; box-sizing:border-box; }
  .store-search { height:44px; }
  .store-search input, .store-search-btn { height:44px; min-height:0; box-sizing:border-box; padding-block:0; }
}
