/* =============================================================
   رایا الکترونیک | استایل اصلی فروشگاه
   طراحی راست‌چین و رسپانسیو با CSS Grid/Flexbox
   رنگ‌های اصلی از پنل ادمین (SiteSetting) تزریق می‌شوند.
   ============================================================= */

/* ---------------------------------------------------- فونت */
@font-face {
  font-family: "IRANSansXV";
  src: url("../fonts/IRANSansXV.2c06d1d67811.woff2") format("woff2-variations"),
       url("../fonts/IRANSansXV.2c06d1d67811.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

/* ---------------------------------------------------- متغیرها */
:root {
  --primary: #ef4a23;
  --primary-dark: #c93916;
  --secondary: #10323c;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --text: #1f2730;
  --muted: #66717e;
  --border: #e4e8ee;
  --success: #12875d;
  --danger: #d92d2d;
  --warning: #f5a100;
  /* ته‌رنگ‌ها از رنگ اصلی ساخته می‌شوند تا با تغییر رنگ در پنل ادمین هماهنگ بمانند */
  --primary-soft: color-mix(in srgb, var(--primary) 10%, #fff);
  --primary-ring: color-mix(in srgb, var(--primary) 30%, transparent);
  --secondary-soft: color-mix(in srgb, var(--secondary) 7%, #fff);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(16, 50, 60, .06);
  --shadow: 0 8px 24px rgba(16, 50, 60, .09);
  --shadow-lg: 0 20px 48px rgba(16, 50, 60, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --container: 1280px;
  --header-h: 76px;
  --bottom-nav-h: 60px;
  /* مقیاس لایه‌ها */
  --z-header: 60; --z-dropdown: 70; --z-bottom-nav: 80; --z-backdrop: 90; --z-drawer: 95;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 130px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "IRANSansXV", "Vazirmatn", Tahoma, system-ui, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  font-size: 15px;
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--primary); }
ul, ol { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4, h5 { margin: 0 0 .6rem; font-weight: 800; line-height: 1.6; color: var(--secondary); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
button { touch-action: manipulation; }
::selection { background: var(--primary); color: #fff; }

/* فوکوس قابل‌مشاهده برای کاربران صفحه‌کلید */
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; top: -60px; inset-inline-start: 12px; z-index: 200;
  background: var(--secondary); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: 12px; color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------- آیکون‌ها */
.icon {
  width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -.24em;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------------------------------------------- لایه‌بندی */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.text-center { text-align: center; }
.text-start { text-align: start; }
.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.small { font-size: .82rem; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.6rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.6rem; }
.hidden { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }
.section { padding: 30px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.section-head h2 { position: relative; padding-inline-start: 14px; margin: 0; }
.section-head h2::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 22px; border-radius: 4px; background: var(--primary);
}
.section-link {
  display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--primary);
  font-weight: 700; white-space: nowrap; padding: 6px 10px; border-radius: 999px;
}
.section-link:hover { background: var(--primary-soft); }
.section-link .icon { transition: transform .2s var(--ease); }
.section-link:hover .icon { transform: translateX(-3px); }

/* ---------------------------------------------------- دکمه‌ها */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-weight: 700; font-size: .9rem; line-height: 1.4;
  cursor: pointer; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.btn:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 6px 16px var(--primary-ring); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.disabled, .btn.is-loading { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-loading { pointer-events: none; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-dark { background: var(--secondary); }
.btn-dark:hover { background: color-mix(in srgb, var(--secondary) 80%, #000); box-shadow: none; }
.btn-ghost { background: var(--surface-2); color: var(--secondary); }
.btn-ghost:hover { background: var(--border); color: var(--secondary); box-shadow: none; }
.btn-ghost.is-fav .icon { fill: var(--primary); stroke: var(--primary); }
.btn-light { background: #fff; color: var(--secondary); }
.btn-light:hover { background: #fff; color: var(--primary); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.btn-glass { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .32); color: #fff; }
.btn-glass:hover { background: #fff; color: var(--secondary); box-shadow: none; }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .8rem; }
.btn-lg { min-height: 52px; padding: 13px 28px; font-size: 1rem; }
.btn-icon { padding: 0; width: 44px; height: 44px; min-height: 44px; border-radius: 12px; }

.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.link-danger {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer;
  color: var(--danger); font-size: .8rem; padding: 6px 4px; border-radius: 6px;
}
.link-danger:hover { text-decoration: underline; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge-success { background: rgba(18, 135, 93, .12); color: var(--success); }
.badge-danger  { background: rgba(217, 45, 45, .1); color: var(--danger); }
.badge-warning { background: rgba(245, 161, 0, .16); color: #8a5a06; }
.badge-dark    { background: var(--secondary-soft); color: var(--secondary); }
.badge-glass   { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .24); }

/* ---------------------------------------------------- فرم‌ها */
.form-group { margin-bottom: 16px; }
.form-group > label { display: block; margin-bottom: 6px; font-weight: 700; font-size: .85rem; color: var(--secondary); }
.form-control, input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="tel"], input[type="date"], input[type="datetime-local"], input[type="search"], input[type="url"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); transition: border-color .18s ease, box-shadow .18s ease;
}
input::placeholder, textarea::placeholder { color: #98a2ae; }
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
/* دراپ‌داون: حذف ظاهر پیش‌فرض مرورگر + فلش سفارشی سمت چپ (سایت راست‌چین است) */
select:not([multiple]) {
  -webkit-appearance: none; appearance: none; cursor: pointer; font-weight: 500;
  padding-inline: 14px 40px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366717e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; background-size: 18px;
}
select:not([multiple]):hover { border-color: #c5ccd6; background-color: #fafbfc; }
select:not([multiple]):focus {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4a23' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E");
}
select:disabled { opacity: .6; cursor: not-allowed; }
select option { font-weight: 400; color: var(--text); background: #fff; }
select[multiple] { padding: 6px; min-height: 120px; }
select[multiple] option { padding: 6px 10px; border-radius: 6px; }

input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); flex: none; cursor: pointer; }
input[type="file"] { width: 100%; font-size: .82rem; }
textarea { resize: vertical; min-height: 96px; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check label { margin: 0; font-weight: 400; font-size: .87rem; cursor: pointer; }
.form-error { color: var(--danger); font-size: .8rem; margin-top: 5px; }
.form-help { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.errorlist { color: var(--danger); font-size: .85rem; }

/* ---------------------------------------------------- پیام‌ها */
.messages { margin: 16px auto; display: grid; gap: 8px; }
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: .88rem;
  border: 1px solid var(--border); border-inline-start: 4px solid var(--muted); background: #fff;
  transition: opacity .3s ease, transform .3s ease;
}
/* فاصله از عنصر بعدی؛ در فهرست پیام‌ها فاصله را gap خود ظرف می‌دهد */
.alert { margin-bottom: 16px; }
.alert:last-child, .messages .alert { margin-bottom: 0; }
.alert > .icon { margin-top: .28em; }
.alert > span, .alert > div { flex: 1; min-width: 0; }
.alert-success { border-color: #bfe6d5; border-inline-start-color: var(--success); color: #0c5c40; background: #f0fbf6; }
.alert-error, .alert-danger { border-color: #f6c9c9; border-inline-start-color: var(--danger); color: #9b1c1c; background: #fff5f5; }
.alert-warning { border-color: #f5dfae; border-inline-start-color: var(--warning); color: #7a4f05; background: #fffaf0; }
.alert-info { border-color: #cfdfe5; border-inline-start-color: var(--secondary); color: var(--secondary); background: #f3f8fa; }
.alert-close {
  border: 0; background: none; cursor: pointer; color: inherit; opacity: .6; padding: 4px; margin: -2px;
  border-radius: 6px; display: grid; place-items: center;
}
.alert-close:hover { opacity: 1; }
.alert.is-hiding { opacity: 0; transform: translateY(-6px); }

/* ---------------------------------------------------- اطلاعیه و تاپ‌بار */
.announcement {
  background: var(--secondary); color: #fff; font-size: .82rem; text-align: center;
  padding: 8px 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.announcement .icon { color: color-mix(in srgb, var(--primary) 60%, #fff); }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); font-size: .78rem; color: var(--muted); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 38px; gap: 14px; }
.topbar-links { display: flex; gap: 18px; }
.topbar-links > * { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------- هدر */
.site-header { background: var(--surface); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: var(--z-header); }
.header-main { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.25rem; color: var(--secondary); line-height: 1.5; white-space: nowrap; }
.brand:hover { color: var(--secondary); }
.brand img { height: 44px; width: auto; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  box-shadow: 0 6px 14px var(--primary-ring);
}
.brand-mark .icon { width: 24px; height: 24px; }
.brand small { display: block; font-size: .66rem; font-weight: 400; color: var(--muted); }

.search-box { flex: 1 1 320px; position: relative; max-width: 600px; margin-inline: auto; }
.search-box input {
  width: 100%; min-height: 48px; padding-block: 10px; padding-inline: 20px 56px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid transparent;
}
.search-box input:focus { background: #fff; border-color: var(--primary); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box button {
  position: absolute; inset-inline-end: 5px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--primary);
  color: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color .18s ease;
}
.search-box button:hover { background: var(--primary-dark); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 46px; height: 46px; border-radius: 13px; border: 1px solid var(--border);
  background: #fff; display: grid; place-items: center; color: var(--secondary); cursor: pointer; flex: none;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.icon-btn .icon { width: 22px; height: 22px; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.icon-btn .counter {
  position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px;
  border-radius: 999px; background: var(--primary); color: #fff; font-size: .68rem; line-height: 1;
  display: grid; place-items: center; font-weight: 700; padding: 0 5px; border: 2px solid #fff;
}
.btn-login { min-height: 46px; border-radius: 13px; padding-inline: 16px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px; padding-inline-end: 14px;
  border: 1px solid var(--border); border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.user-chip:hover { border-color: var(--primary); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--secondary); color: #fff; flex: none;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700; overflow: hidden;
}
.avatar .icon { width: 58%; height: 58%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------- منوی اصلی */
.main-nav { border-top: 1px solid var(--border); background: var(--surface); }
.main-nav > .container { display: flex; align-items: center; gap: 4px; }
.nav-list { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 6px; padding: 12px 14px;
  font-size: .88rem; font-weight: 700; color: var(--secondary); white-space: nowrap;
}
.nav-link:hover, .nav-item:hover > .nav-link, .nav-item:focus-within > .nav-link { color: var(--primary); }
.nav-link .chev { width: 14px; height: 14px; opacity: .6; transition: transform .2s var(--ease); }
.nav-item:hover .chev, .nav-item:focus-within .chev { transform: rotate(180deg); }
.nav-item.has-children > .nav-link { background: var(--surface-2); border-radius: var(--radius-sm); margin-block: 6px; padding-block: 8px; }
.dropdown {
  position: absolute; top: 100%; inset-inline-start: 0; min-width: 260px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; z-index: var(--z-dropdown);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .18s ease, transform .18s var(--ease), visibility .18s;
}
.nav-item:hover > .dropdown, .nav-item:focus-within > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .86rem; }
.dropdown a:hover { background: var(--surface-2); color: var(--primary); }
.dropdown-all { border-top: 1px solid var(--border); margin-top: 6px; color: var(--primary); font-weight: 700; }
.nav-cta { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 700; color: var(--primary); padding: 8px 12px; border-radius: 999px; }
.nav-cta:hover { background: var(--primary-soft); }

/* ---------------------------------------------------- اسلایدر */
.hero { display: grid; grid-template-columns: 2.1fr 1fr; gap: 18px; margin-top: 22px; }
.slider { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 340px; background: var(--secondary); isolation: isolate; }
.slide {
  position: absolute; inset: 0; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center;
  gap: 16px; padding: 36px 44px 64px; color: #fff; opacity: 0; visibility: hidden;
  transition: opacity .5s ease, visibility .5s;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .16), transparent 42%),
    linear-gradient(135deg, var(--slide-bg, var(--secondary)), color-mix(in srgb, var(--slide-bg, var(--secondary)) 72%, #000));
}
.slide.active { opacity: 1; visibility: visible; }
.slide-text { display: grid; gap: 10px; justify-items: start; }
.slide img { max-height: 250px; width: auto; margin-inline-start: auto; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .25)); }
.slide-art { justify-self: center; width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); }
.slide-art .icon { width: 84px; height: 84px; stroke-width: 1.2; opacity: .9; }
.slide h2 { color: #fff; font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 900; margin: 0; }
.slide p { color: rgba(255, 255, 255, .86); font-size: .95rem; margin: 0 0 6px; max-width: 46ch; }
.slider-controls { position: absolute; bottom: 16px; inset-inline-start: 44px; display: flex; align-items: center; gap: 10px; z-index: 3; }
.slider-dots { display: flex; align-items: center; gap: 6px; }
.slider-dots button {
  width: 9px; height: 9px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .45); cursor: pointer; padding: 0;
  transition: width .25s var(--ease), background-color .25s ease; position: relative;
}
.slider-dots button::after { content: ""; position: absolute; inset: -10px -4px; }
.slider-dots button.active { width: 26px; background: #fff; }
.slider-arrow {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .28); cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center;
  transition: background-color .18s ease;
}
.slider-arrow:hover { background: rgba(255, 255, 255, .32); }

.hero-side { display: grid; gap: 18px; }
.hero-card {
  border-radius: var(--radius-lg); padding: 22px; color: #fff; min-height: 160px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px; position: relative; overflow: hidden;
  background-image: radial-gradient(circle at 0% 100%, rgba(255, 255, 255, .2), transparent 55%);
}
.hero-card h3 { color: #fff; font-size: 1.1rem; margin-bottom: 2px; }
.hero-card span { font-size: .82rem; opacity: .9; }
.hero-card .btn { align-self: flex-start; }

/* ---------------------------------------------------- مزیت‌ها */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; align-items: center; gap: 12px;
}
.feature .ico {
  width: 48px; height: 48px; border-radius: 14px; flex: 0 0 48px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.feature .ico .icon { width: 24px; height: 24px; }
.feature strong { display: block; font-size: .9rem; color: var(--secondary); }
.feature span { font-size: .78rem; color: var(--muted); }

/* ---------------------------------------------------- دسته‌بندی‌ها (صفحه اصلی) */
.cat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.cat-tile {
  display: grid; justify-items: center; gap: 6px; text-align: center; padding: 20px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--ease);
}
.cat-tile:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-3px); color: inherit; }
.cat-tile .ring {
  width: 72px; height: 72px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; overflow: hidden; margin-bottom: 4px;
}
.cat-tile .ring img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile .ring .icon { width: 30px; height: 30px; }
.cat-name { font-size: .9rem; font-weight: 700; color: var(--secondary); }
.cat-tile:hover .cat-name { color: var(--primary); }
.cat-tile small { color: var(--muted); font-size: .76rem; }

/* ---------------------------------------------------- کارت محصول */
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.product-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: transform .2s var(--ease), box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover, .product-card:focus-within { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.product-thumb { position: relative; aspect-ratio: 1 / 1; background: #fafbfc; }
.product-thumb > a { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.product-thumb img { max-height: 100%; width: auto; object-fit: contain; mix-blend-mode: multiply; transition: transform .35s var(--ease); }
.product-card:hover .product-thumb img { transform: scale(1.05); }
.product-flags { position: absolute; top: 10px; inset-inline-start: 10px; display: grid; gap: 5px; justify-items: start; z-index: 2; pointer-events: none; }
.flag { padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff; background: var(--primary); line-height: 1.7; }
.flag.off { background: var(--danger); }
.flag.new { background: var(--secondary); }
.flag.out { background: var(--muted); }
.product-fav {
  position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: rgba(255, 255, 255, .92);
  display: grid; place-items: center; cursor: pointer; color: var(--muted);
  transition: color .18s ease, border-color .18s ease, transform .12s ease;
}
.product-fav .icon { width: 19px; height: 19px; }
.product-fav:hover { color: var(--primary); border-color: var(--primary); }
.product-fav:active { transform: scale(.9); }
.product-fav.active { color: var(--primary); border-color: var(--primary); }
.product-fav.active .icon { fill: currentColor; }
.product-info { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: .74rem; color: var(--muted); align-self: flex-start; }
.product-title {
  font-size: .9rem; font-weight: 700; line-height: 1.75; min-height: 3.5em; color: var(--secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card:hover .product-title { color: var(--primary); }
.rating { display: flex; align-items: center; gap: 6px; font-size: .78rem; min-height: 1.6em; }
.rating .count { color: var(--muted); }
/* ستاره‌ها: لایه خاکستری + لایه پرشده به نسبت ‎--r از ۵ */
.stars { position: relative; display: inline-block; direction: ltr; unicode-bidi: isolate; font-size: .95rem; line-height: 1; letter-spacing: 1px; color: #d7dce3; font-family: Arial, sans-serif; }
.stars::before { content: "★★★★★"; }
.stars::after { content: "★★★★★"; position: absolute; inset: 0; width: calc(var(--r, 0) / 5 * 100%); overflow: hidden; white-space: nowrap; color: var(--warning); }
.product-price { margin-top: auto; padding-top: 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price-now { font-size: 1.08rem; font-weight: 900; color: var(--secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-now .cur { font-size: .72rem; font-weight: 400; color: var(--muted); margin-inline-start: 2px; }
.price-old { font-size: .8rem; color: var(--muted); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.product-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.product-actions .btn { flex: 1; }

/* ---------------------------------------------------- صفحه محصول */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); padding: 16px 0; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { width: 14px; height: 14px; opacity: .5; }
.breadcrumb > span:last-child { color: var(--text); }

.product-detail { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.gallery { display: grid; gap: 12px; }
.gallery-main {
  position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 22px; overflow: hidden;
}
.gallery-main img { max-height: 100%; object-fit: contain; transition: transform .35s var(--ease); }
.gallery-main:hover img { transform: scale(1.06); }
.gallery-main .flag { position: absolute; top: 14px; inset-inline-start: 14px; font-size: .8rem; padding: 3px 12px; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumbs button {
  width: 68px; height: 68px; border-radius: 12px; border: 2px solid var(--border); background: #fff;
  padding: 5px; cursor: pointer; display: grid; place-items: center; overflow: hidden; transition: border-color .18s ease;
}
.gallery-thumbs button.active, .gallery-thumbs button:hover { border-color: var(--primary); }
.gallery-thumbs img { max-height: 100%; object-fit: contain; }

.product-summary h1 { font-size: 1.35rem; line-height: 1.8; margin: 10px 0 6px; }
.product-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.product-summary .lead { color: var(--muted); margin: 12px 0 0; font-size: .92rem; }
.key-specs { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.key-specs li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 14px; font-size: .85rem; }
.key-specs li:nth-child(odd) { background: #fafbfc; }
.key-specs span { color: var(--muted); }
.key-specs strong { font-weight: 700; text-align: end; }
.assurances { margin-top: 16px; display: grid; gap: 8px; }
.assurances li { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--secondary); }
.assurances .icon { color: var(--success); }

.buy-box {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; display: grid; gap: 14px; position: sticky; top: 140px;
}
.stock { display: flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 700; }
.stock.in { color: var(--success); }
.stock.out { color: var(--danger); }
.buy-box .total { display: flex; align-items: flex-end; justify-content: space-between; padding-block: 12px; border-block: 1px dashed var(--border); }
.buy-box .total .price-now { font-size: 1.5rem; }
.price-block { text-align: end; }
.qty-picker { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.qty-picker form { display: contents; }
.qty-picker button {
  width: 44px; height: 44px; border: 0; background: var(--surface-2); cursor: pointer; color: var(--secondary);
  display: grid; place-items: center; transition: background-color .15s ease;
}
.qty-picker button:hover:not(:disabled) { background: var(--border); }
.qty-picker button:disabled { opacity: .4; cursor: not-allowed; }
.qty-picker button.text-danger { color: var(--danger); }
.qty-picker .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.qty-picker input { width: 56px; height: 44px; min-height: 0; padding: 0; border: 0; border-radius: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.qty-picker input::-webkit-outer-spin-button, .qty-picker input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-picker input:focus { box-shadow: none; }
.qty-value { min-width: 44px; text-align: center; font-weight: 700; }

.spec-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.spec-table th, .spec-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: start; }
.spec-table th { width: 220px; color: var(--muted); font-weight: 400; background: #fafbfc; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  padding: 12px 18px; border: 0; background: transparent; cursor: pointer; font-weight: 700;
  font-size: .9rem; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap;
  transition: color .18s ease, border-color .18s ease;
}
.tabs button:hover { color: var(--secondary); }
.tabs button.active { color: var(--primary); border-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .25s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.review { border-bottom: 1px solid var(--border); padding: 16px 0; }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.review p { margin: 4px 0 0; }

/* ---------------------------------------------------- فروشگاه و فیلتر */
.shop-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: start; }
.shop-title { font-size: 1.25rem; margin-bottom: 12px; }
.filter-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: 140px; }
.filter-details > summary { display: flex; align-items: center; gap: 8px; list-style: none; margin-bottom: 14px; color: var(--secondary); }
.filter-details > summary::-webkit-details-marker { display: none; }
.filter-details > summary h3 { margin: 0; flex: 1; }
.filter-details > summary .chev { display: none; transition: transform .2s var(--ease); }
.filter-details[open] > summary .chev { transform: rotate(180deg); }
.filter-block { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.filter-block h4 { font-size: .88rem; margin-bottom: 10px; }
.filter-list { display: grid; gap: 2px; max-height: 340px; overflow-y: auto; scrollbar-width: thin; }
.filter-list a, .filter-list label {
  font-size: .85rem; color: var(--text); display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 7px 10px; border-radius: 8px; transition: background-color .15s ease;
}
.filter-list a:hover, .filter-list label:hover { background: var(--surface-2); color: var(--text); }
.filter-list a.child { padding-inline-start: 24px; color: var(--muted); font-size: .82rem; }
.filter-list a.active { color: var(--primary-dark); font-weight: 700; background: var(--primary-soft); }
.filter-list .cnt { color: var(--muted); font-size: .74rem; margin-inline-start: auto; background: var(--surface-2); border-radius: 999px; padding: 0 8px; }
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.price-inputs input { padding: 8px 10px; font-size: .84rem; min-height: 42px; }

.toolbar {
  min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.sort-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-chips a {
  padding: 6px 14px; border-radius: 999px; font-size: .8rem; background: var(--surface-2); color: var(--muted); font-weight: 700;
  transition: background-color .18s ease, color .18s ease;
}
.sort-chips a:hover { background: var(--border); color: var(--secondary); }
.sort-chips a.active { background: var(--secondary); color: #fff; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; display: grid; place-items: center; font-size: .86rem; font-weight: 700;
  transition: border-color .18s ease, color .18s ease;
}
.pagination .gap { min-width: 24px; padding: 0; border: 0; background: none; color: var(--muted); }
.pagination button {
  min-width: 42px; height: 42px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--border); background: #fff;
  display: grid; place-items: center; font-size: .86rem; font-weight: 700; cursor: pointer;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button[aria-current] { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state.compact { padding: 28px 12px; }
.empty-state .ico {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-size: 1.5rem; font-weight: 900;
}
.empty-state .ico .icon { width: 36px; height: 36px; stroke-width: 1.5; }
.empty-state h1, .empty-state h2, .empty-state h3 { font-size: 1.15rem; }

/* ---------------------------------------------------- صفحه دسته‌بندی‌ها */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.cat-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.cat-card h3 { font-size: 1rem; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.cat-card h3 .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; overflow: hidden; flex: none; }
.cat-card h3 .ico img { width: 100%; height: 100%; object-fit: cover; }
.cat-card ul { display: grid; gap: 2px; }
.cat-card li a { display: flex; align-items: center; gap: 4px; font-size: .84rem; color: var(--muted); padding: 5px 0; }
.cat-card li a .icon { width: 14px; height: 14px; }
.cat-card li a:hover { color: var(--primary); }
.cat-circle { display: grid; place-items: center; gap: 10px; text-align: center; }

/* ---------------------------------------------------- سبد خرید و تسویه */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 22px; align-items: start; }
.cart-title { font-size: 1.2rem; margin: 0; }
.cart-item {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.cart-item:last-of-type { border-bottom: 0; }
.cart-item .thumb { width: 92px; height: 92px; background: #fafbfc; border-radius: 12px; display: grid; place-items: center; padding: 8px; border: 1px solid var(--border); }
.cart-item .thumb img { max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.cart-item .product-title { min-height: 0; }
.cart-item .actions { display: grid; justify-items: end; gap: 6px; }
.summary { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: sticky; top: 140px; box-shadow: var(--shadow-sm); }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: .87rem; font-variant-numeric: tabular-nums; }
.summary-row > span { color: var(--muted); }
.summary-row.total { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 14px; font-size: 1rem; font-weight: 900; }
.summary-row.total > span { color: var(--secondary); }
.summary-row.total strong { color: var(--primary-dark); font-size: 1.1rem; }
.ship-hint { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--secondary); background: var(--secondary-soft); border-radius: var(--radius-sm); padding: 8px 12px; margin: 10px 0 0; }
.coupon-form { display: flex; gap: 8px; margin-top: 12px; }
.coupon-form input { flex: 1; min-width: 0; }
.form-group > .pay-method {
  display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft);
}
.pay-method .ico { color: var(--primary); display: grid; place-items: center; }
.pay-method strong, .pay-method small { display: block; line-height: 1.7; }
.pay-method small { color: var(--muted); font-weight: 400; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; }
.summary .alert form { flex: none; }

.steps { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); font-weight: 700; }
.step .num { width: 30px; height: 30px; border-radius: 50%; background: #e9edf1; display: grid; place-items: center; font-size: .8rem; }
.step .num .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.step.active { color: var(--primary); }
.step.active .num { background: var(--primary); color: #fff; }
.step.done { color: var(--success); }
.step.done .num { background: var(--success); color: #fff; }
.step-sep { width: 40px; height: 2px; background: var(--border); }

/* ---------------------------------------------------- پنل کاربری */
.dash-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.dash-menu { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; position: sticky; top: 140px; }
.dash-menu a, .dash-menu button {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: .87rem; font-weight: 700; color: var(--secondary);
}
.dash-menu button { width: 100%; border: 0; background: none; cursor: pointer; text-align: start; }
.dash-menu a:hover, .dash-menu button:hover { background: var(--surface-2); color: var(--primary); }
.dash-menu a.active { background: var(--primary); color: #fff; }
.dash-menu a.danger, .dash-menu button.danger { color: var(--danger); }
.dash-menu form { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.dash-user { display: grid; justify-items: center; gap: 2px; text-align: center; padding: 14px 10px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.dash-user .avatar { width: 64px; height: 64px; font-size: 1.4rem; margin-bottom: 6px; }
.dash-user strong { color: var(--secondary); }
.dash-content { min-width: 0; }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.info-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.info-list > div:nth-last-child(-n+2) { border-bottom: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 700; color: var(--secondary); text-align: end; overflow-wrap: anywhere; }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.order-layout .summary { position: static; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat b { display: block; font-size: 1.6rem; color: var(--primary); line-height: 1.5; }
.stat span { font-size: .8rem; color: var(--muted); }

/* position: relative تا عناصر absolute داخل جدول (مثل sr-only) هم داخل همین ظرف بریده شوند و صفحه را عریض نکنند */
.table-wrap { overflow-x: auto; position: relative; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; background: #fff; }
table.data th, table.data td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { background: #fafbfc; font-weight: 700; color: var(--muted); font-size: .8rem; }
table.data tbody tr:hover td { background: #fafbfc; }
table.data tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------- وبلاگ */
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.post-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s var(--ease), box-shadow .2s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card .cover { aspect-ratio: 16 / 9; background: #eef1f4; overflow: hidden; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.post-card:hover .cover img { transform: scale(1.06); }
.post-card .body { padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1; }
.post-card .body > .flex-between { width: 100%; }
.post-card h3 { font-size: .98rem; line-height: 1.75; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card p { font-size: .84rem; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; justify-content: space-between; gap: 14px; width: 100%; font-size: .78rem; color: var(--muted); margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.post-meta > * { display: inline-flex; align-items: center; gap: 5px; }
.post-meta a { color: var(--primary); font-weight: 700; }
.widget { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.widget h4 { font-size: .93rem; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a { padding: 5px 12px; background: var(--surface-2); border-radius: 999px; font-size: .8rem; transition: background-color .18s ease, color .18s ease; }
.tag-cloud a:hover { background: var(--primary); color: #fff; }
.article-body { font-size: 1rem; line-height: 2.1; max-width: 75ch; }
.article-body h2, .article-body h3 { margin-top: 1.6rem; }
.article-body img { border-radius: var(--radius); margin: 1.2rem 0; }
.article-body blockquote {
  margin: 1.2rem 0; padding: 14px 18px; background: #f7f9fa;
  border-inline-start: 4px solid var(--primary); border-radius: var(--radius-sm); color: var(--secondary);
}
.article-body ul, .article-body ol { padding-inline-start: 22px; margin-bottom: 1rem; }
.article-body ul li { list-style: disc; }
.article-body ol li { list-style: decimal; }
.article-body a { color: var(--primary); text-decoration: underline; }
.article-body pre { direction: ltr; text-align: left; background: #0f2a33; color: #e6edf0; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; font-size: .88rem; line-height: 1.8; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .92rem; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: start; }
.article-body th { background: #fafbfc; }
/* کلاس‌هایی که ویرایشگر متن پنل مدیریت تولید می‌کند */
.article-body .ql-align-center { text-align: center; }
.article-body .ql-align-right { text-align: right; }
.article-body .ql-align-left { text-align: left; }
.article-body .ql-align-justify { text-align: justify; }
.article-body .ql-align-center img { margin-inline: auto; }
.article-body .ql-size-small { font-size: .82em; }
.article-body .ql-size-large { font-size: 1.3em; }
.article-body .ql-size-huge { font-size: 1.7em; }
.article-body .ql-indent-1 { padding-inline-start: 2em; }
.article-body .ql-indent-2 { padding-inline-start: 4em; }
.article-body .ql-indent-3 { padding-inline-start: 6em; }
.article-body .ql-indent-4 { padding-inline-start: 8em; }

/* متن اصلی مقاله؛ چینشی که در ویرایشگر برای یک پاراگراف انتخاب شده مقدم است */
.post-body { max-width: none; text-align: justify; text-justify: inter-word; overflow-wrap: break-word; }
.post-body h1, .post-body h2, .post-body h3, .post-body h4, .post-body th, .post-body td { text-align: start; }

/* نظرات وبلاگ */
.comments { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.comment { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.comment > .avatar { width: 44px; height: 44px; font-size: 1rem; background: var(--secondary-soft); color: var(--secondary); }
.comment-main {
  flex: 1; min-width: 0; padding: 14px 16px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); border-start-start-radius: 4px;
}
.comment header { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 6px; }
.comment header strong { color: var(--secondary); font-size: .92rem; }
.comment time { margin-inline-start: auto; color: var(--muted); font-size: .76rem; }
.comment p { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.comment.is-reply { margin-inline-start: 56px; position: relative; }
/* خط اتصال پاسخ به نظر اصلی */
.comment.is-reply::before {
  content: ""; position: absolute; inset-inline-start: -34px; top: -14px; width: 24px; height: 36px;
  border-inline-start: 2px solid var(--border); border-bottom: 2px solid var(--border); border-end-start-radius: 12px;
}
.comment.is-staff > .avatar { background: var(--primary); color: #fff; }
.comment.is-staff .comment-main { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, #fff); }
.comment-form { margin-top: 26px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.comment-form h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.comment-form h3 .icon { color: var(--primary); }
.form-row > .span-all { grid-column: 1 / -1; }

/* ---------------------------------------------------- درباره / تماس */
.page-hero {
  color: #fff; border-radius: var(--radius-lg); padding: 44px 32px; margin: 18px 0 26px; text-align: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .14), transparent 40%),
    linear-gradient(135deg, var(--secondary), color-mix(in srgb, var(--secondary) 76%, #fff));
}
.page-hero h1 { color: #fff; }
.page-hero p { color: rgba(255, 255, 255, .85); max-width: 680px; margin-inline: auto; }
.page-hero .search-box input { background: #fff; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.contact-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.contact-item:last-child { border-bottom: 0; }
.contact-item .ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.contact-item strong { display: block; font-size: .86rem; }
.contact-item span { font-size: .84rem; color: var(--muted); }
.accordion-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.accordion-item > button {
  width: 100%; text-align: start; padding: 15px 18px; border: 0; background: transparent; min-height: 52px;
  font-weight: 700; font-size: .92rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--secondary);
}
.accordion-item > button .icon { transition: transform .25s var(--ease); }
.accordion-item .answer { max-height: 0; overflow: hidden; padding: 0 18px; transition: max-height .3s var(--ease), padding .3s ease; font-size: .9rem; color: var(--muted); }
.accordion-item.open .answer { max-height: 600px; padding: 0 18px 16px; }
.accordion-item.open > button { color: var(--primary); }
.accordion-item.open > button .icon { transform: rotate(180deg); }

/* ---------------------------------------------------- فوتر */
.site-footer { background: var(--secondary); color: rgba(255, 255, 255, .76); margin-top: 48px; }
.footer-top { padding-block: 44px 28px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 28px; }
.site-footer h4 { color: #fff; font-size: .98rem; margin-bottom: 14px; }
.site-footer a { color: rgba(255, 255, 255, .76); font-size: .86rem; }
.site-footer a:hover { color: #fff; }
.footer-links { display: grid; gap: 4px; justify-items: start; font-size: .86rem; }
.footer-links > * { padding-block: 4px; }
.footer-contact > * { display: flex; align-items: flex-start; gap: 8px; }
.footer-contact .icon { margin-top: .3em; color: color-mix(in srgb, var(--primary) 70%, #fff); }
.footer-about p { font-size: .86rem; line-height: 2; }
.social { display: flex; gap: 9px; margin-top: 14px; }
.social a {
  width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .08);
  display: grid; place-items: center; color: #fff; transition: background-color .18s ease;
}
.social a:hover { background: var(--primary); }
.newsletter { display: flex; gap: 8px; margin-top: 12px; }
.newsletter input { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; }
.newsletter input::placeholder { color: rgba(255, 255, 255, .45); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1); padding-block: 16px;
  display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; flex-wrap: wrap;
}

/* ---------------------------------------------------- منوی موبایل پایین */
.bottom-nav {
  display: none; position: fixed; bottom: 0; inset-inline: 0; z-index: var(--z-bottom-nav);
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(16, 50, 60, .08);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav ul { display: grid; grid-template-columns: repeat(5, 1fr); }
.bottom-nav a, .bottom-nav button {
  display: grid; justify-items: center; gap: 2px; padding: 9px 2px 7px; min-height: 58px;
  font-size: .7rem; color: var(--muted); position: relative; font-weight: 700;
}
.bottom-nav a { text-align: center; line-height: 1.6; }
.bottom-nav button { width: 100%; border: 0; background: none; cursor: pointer; line-height: 1.6; }
.bottom-nav li { min-width: 0; }
.bottom-nav a > span:not(.counter), .bottom-nav button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav .icon { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active::before {
  content: ""; position: absolute; top: 0; inset-inline: 28%; height: 3px;
  background: var(--primary); border-radius: 0 0 4px 4px;
}
.bottom-nav .counter {
  position: absolute; top: 4px; inset-inline-start: 52%; min-width: 18px; height: 18px; line-height: 1;
  background: var(--primary); color: #fff; border-radius: 999px; font-size: .64rem;
  display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff;
}

/* نوار خرید چسبان صفحه محصول (فقط موبایل و تبلت، بالای منوی پایین) */
.buy-bar {
  display: none; position: fixed; inset-inline: 0; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); z-index: calc(var(--z-bottom-nav) - 1);
  align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px;
  background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(16, 50, 60, .08);
}
.buy-bar .price-block { line-height: 1.5; }

/* کشوی منوی موبایل */
.drawer-toggle { display: none; }
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(10, 25, 32, .5); z-index: var(--z-backdrop);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer {
  /* سایت راست‌چین است: کشو به لبه راست می‌چسبد و با translateX(100%) کاملاً از صفحه بیرون می‌رود */
  position: fixed; top: 0; right: 0; width: 320px; max-width: 86vw; height: 100%;
  background: #fff; z-index: var(--z-drawer); transform: translateX(100%); visibility: hidden;
  transition: transform .28s var(--ease), visibility .28s;
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
}
.drawer.open { transform: translateX(0); visibility: visible; box-shadow: var(--shadow-lg); }
.drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; color: var(--secondary); font-size: 1.05rem; }
.drawer-body { padding: 10px; display: grid; gap: 2px; }
.drawer-body a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .92rem; font-weight: 700; color: var(--secondary); }
.drawer-body a:hover { background: var(--surface-2); }
.drawer-body a .icon { color: var(--muted); }
.drawer-body .sub { padding-inline-start: 34px; display: grid; }
.drawer-body .sub a { font-weight: 400; font-size: .86rem; color: var(--muted); min-height: 40px; }
.drawer-body .drawer-cta { margin-top: 10px; justify-content: center; background: var(--primary-soft); color: var(--primary-dark); }
.drawer-body .drawer-cta .icon { color: inherit; }

/* ---------------------------------------------------- اسکرول به بالا */
.to-top {
  position: fixed; bottom: 24px; inset-inline-start: 18px; z-index: 50;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--secondary); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s var(--ease), visibility .25s, background-color .18s ease;
}
.to-top:hover { background: var(--primary); }
.to-top.show { opacity: 1; visibility: visible; transform: none; }

/* ---------------------------------------------------- رسپانسیو */
@media (max-width: 1200px) {
  .product-grid, .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .product-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .product-detail { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
  .product-detail .buy-box { grid-column: 1 / -1; position: static; }
}
@media (max-width: 1024px) {
  html { scroll-padding-top: 90px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .hero-card { min-height: 130px; }
  /* minmax(0, 1fr) تا محتوای عریض (مثل چیپ‌های مرتب‌سازی) صفحه را از عرض بیرون نزند */
  .shop-layout, .cart-layout, .dash-layout, .blog-layout, .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .filter-panel, .summary, .dash-menu, .buy-box { position: static; }
  /* منوی حساب کاربری در موبایل/تبلت: نوار افقی قابل اسکرول بالای محتوا */
  .dash-menu { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 6px; }
  .dash-menu::-webkit-scrollbar { display: none; }
  .dash-menu a, .dash-menu button { white-space: nowrap; flex: none; }
  .dash-menu form { border: 0; margin: 0; padding: 0; flex: none; }
  .dash-user { display: none; }
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  .filter-panel { padding: 12px 16px; }
  .filter-details > summary { cursor: pointer; margin-bottom: 0; min-height: 44px; }
  .filter-details[open] > summary { margin-bottom: 14px; }
  .filter-details > summary .chev { display: block; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav, .topbar { display: none; }
  .drawer-toggle { display: grid; }
  /* منوی پایین از تبلت به پایین: از ۱۰۲۴ پیکسل منوی اصلی بالای صفحه پنهان می‌شود */
  body { padding-bottom: calc(var(--bottom-nav-h) + 4px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: block; }
  .to-top { bottom: calc(var(--bottom-nav-h) + 18px + env(safe-area-inset-bottom)); inset-inline-start: 12px; }
  .buy-bar { display: flex; }
  body.has-buy-bar { padding-bottom: calc(var(--bottom-nav-h) + 72px + env(safe-area-inset-bottom)); }
  .has-buy-bar .to-top { bottom: calc(var(--bottom-nav-h) + 82px + env(safe-area-inset-bottom)); }
}
@media (max-width: 768px) {
  /* ۱۶ پیکسل در ورودی‌ها تا iOS هنگام فوکوس زوم نکند */
  input, select, textarea { font-size: 16px; }
  h1 { font-size: 1.3rem; } h2 { font-size: 1.12rem; }
  .hide-mobile { display: none !important; }
  .product-grid, .product-grid.cols-3, .cat-grid, .post-grid, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .header-main { flex-wrap: wrap; min-height: auto; padding-block: 10px; gap: 10px; }
  .brand { font-size: 1.05rem; margin-inline-end: auto; }
  .brand small { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .search-box { order: 3; flex: 1 1 100%; max-width: none; }
  .search-box input { min-height: 44px; }
  .btn-login { padding: 0; width: 46px; }
  .user-chip { padding: 6px; border-radius: 50%; }
  .slider { min-height: 290px; }
  .slide { grid-template-columns: 1fr; padding: 22px 22px 70px; }
  .slide img, .slide-art { display: none; }
  .slider-controls { inset-inline-start: 22px; }
  .hero-side { grid-template-columns: 1fr; gap: 12px; }
  .hero-card { min-height: 0; flex-direction: row; align-items: center; padding: 16px 18px; border-radius: var(--radius); }
  .hero-card .btn { align-self: center; }
  .features { gap: 10px; }
  .feature { padding: 12px; gap: 10px; }
  .feature .ico { width: 40px; height: 40px; flex-basis: 40px; }
  .feature span { display: none; }
  .cat-strip { grid-auto-flow: column; grid-auto-columns: 132px; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .cat-strip::-webkit-scrollbar { display: none; }
  .cat-tile { scroll-snap-align: start; padding: 14px 8px; }
  .product-info { padding: 10px; }
  .product-title { font-size: .84rem; }
  .price-now { font-size: .98rem; }
  .btn-icon { width: 40px; height: 40px; min-height: 40px; }
  .product-detail { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .gallery-main { padding: 14px; }
  .page-hero { padding: 28px 18px; }
  .cart-item { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
  .cart-item .thumb { width: 72px; height: 72px; }
  .cart-item .actions { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; justify-items: start; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .info-list { grid-template-columns: minmax(0, 1fr); }
  .info-list > div:nth-last-child(2) { border-bottom: 1px solid var(--border); }
  .section { padding: 20px 0; }
  .card-body { padding: 16px; }
  .spec-table th { width: 120px; }
  .footer-top { grid-template-columns: 1fr; gap: 22px; padding-top: 32px; }
  .steps { flex-wrap: nowrap; gap: 5px; }
  .step { font-size: .76rem; gap: 5px; white-space: nowrap; }
  .step .num { width: 24px; height: 24px; font-size: .74rem; }
  .step-sep { width: auto; flex: 0 1 18px; }
  .comment { gap: 8px; }
  .comment > .avatar { width: 36px; height: 36px; font-size: .86rem; }
  .comment-main { padding: 12px; }
  .comment.is-reply { margin-inline-start: 24px; }
  .comment.is-reply::before { inset-inline-start: -14px; width: 10px; }
  .comment-form { padding: 16px; }
  .sort-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .sort-chips a { white-space: nowrap; }
  /* جدول‌های stack در موبایل: هر ردیف یک کارت با برچسب ستون */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; }
  table.stack tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px; border: 0; white-space: normal; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
  table.stack td[colspan] { justify-content: center; }
}
@media (max-width: 380px) {
  .header-actions { gap: 6px; }
  .icon-btn, .btn-login { width: 42px; height: 42px; min-height: 42px; }
  .price-now .cur { display: none; }
}

/* ---------------------------------------------------- کاهش حرکت */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------- چاپ */
@media print {
  .site-header, .site-footer, .bottom-nav, .to-top, .btn, .announcement, .topbar, .drawer, .drawer-backdrop, .skip-link { display: none !important; }
  body { background: #fff; padding: 0; }
}
