/* ============================================================
   دانش بوک — استایل اصلی (RTL)
   ============================================================ */

/* فونت وزیرمتن — میزبانی محلی (سریع، بدون درخواست شبکه) */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/VazirmatnVar.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand-900: #072E23;
  --brand-800: #0B4A37;
  --brand-700: #0F6B4E;
  --brand-600: #159469;
  --brand-500: #1FBF85;
  --accent: #F4A825;
  --accent-dark: #DE8B12;
  --accent-soft: #FFF4E2;
  --ink: #0A1F17;
  --body: #39493F;
  --muted: #67786F;
  --bg: #F2F5F3;
  --surface: #FFFFFF;
  --border: #E2E9E5;
  --danger: #DC2626;
  --success: #16A34A;
  --warn: #D97706;
  --info: #2563EB;
  --grad-brand: linear-gradient(135deg, #0B4A37 0%, #159469 100%);
  --grad-accent: linear-gradient(135deg, #F4A825 0%, #E87A0D 100%);
  --grad-hero: linear-gradient(130deg, #072E23 0%, #0B4A37 45%, #0F6B4E 100%);
  --grad-line: linear-gradient(90deg, #159469, #F4A825, #159469);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 8px rgba(7, 46, 35, .06);
  --shadow-md: 0 10px 30px rgba(7, 46, 35, .10);
  --shadow-lg: 0 22px 50px rgba(7, 46, 35, .16);
  --shadow-glow: 0 12px 34px rgba(21, 148, 105, .22);
  --font: "Vazirmatn", "IRANSansX", "Shabnam", Tahoma, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--body);
  line-height: 1.95;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-800); text-decoration: none; }
strong, b { font-weight: 800; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.5; margin: 0 0 .5em; }
h1 { font-size: 1.95rem; font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; font-weight: 900; }
h3 { font-size: 1.12rem; font-weight: 800; }
p { margin: .35em 0; }
img { max-width: 100%; }
.container { width: min(1180px, 94%); margin-inline: auto; }
.narrow-page { max-width: 900px; }
.muted { color: var(--muted); font-size: .92em; }
.free { color: var(--success); font-weight: 700; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid transparent; border-radius: 12px;
  padding: 10px 20px; font-family: inherit; font-size: .97rem; font-weight: 700;
  cursor: pointer; transition: .18s; text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background-image: var(--grad-brand); background-color: #0F6B4E; color: #fff; box-shadow: var(--shadow-glow); position: relative; overflow: hidden; }
.btn-primary:hover { filter: brightness(1.1); color: #fff; box-shadow: 0 16px 40px rgba(21, 148, 105, .32); }
.btn-accent { background-image: var(--grad-accent); background-color: #F4A825; color: #3A2708; box-shadow: 0 10px 26px rgba(244, 168, 37, .35); position: relative; overflow: hidden; }
.btn-accent:hover { filter: brightness(1.06); color: #3A2708; }
/* درخشش عبوری روی دکمه‌های اصلی */
.btn-primary::after, .btn-accent::after {
  content: ""; position: absolute; top: -40%; bottom: -40%; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-160%) rotate(12deg); transition: transform .7s ease;
}
.btn-primary:hover::after, .btn-accent:hover::after { transform: translateX(360%) rotate(12deg); }
.btn-ghost { background: transparent; color: var(--brand-800); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand-700); background: #fff; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: 0; color: var(--brand-700); font-family: inherit; cursor: pointer; font-size: .88rem; font-weight: 600; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

.input, input[type="search"], input[type="text"], input[type="email"],
input[type="tel"], input[type="number"], select, textarea {
  width: 100%; font-family: inherit; font-size: .97rem;
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 11px;
  background: #fff; color: var(--ink); transition: .15s;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(26, 147, 104, .14);
}

/* ---------------- topbar / header ---------------- */
.topbar { background: var(--grad-brand); background-color: #0B4A37; color: #D6EFE4; font-size: .86rem; }
.topbar-inner { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; flex-wrap: wrap; }
.topbar a { color: #fff; font-weight: 700; }

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--border); transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner { display: flex; align-items: center; gap: 18px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 1.12rem; color: var(--brand-900); font-weight: 900; }
.brand-text small { color: var(--muted); font-size: .74rem; }

.header-search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 4px 8px 4px 6px; max-width: 420px; color: var(--muted);
}
.header-search input { border: 0; background: transparent; padding: 8px 6px; }
.header-search input:focus { box-shadow: none; border: 0; }

.main-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav-link {
  padding: 9px 13px; border-radius: 10px; font-weight: 700;
  color: var(--body); font-size: .95rem; transition: .15s;
}
.nav-link:hover { background: var(--bg); color: var(--brand-800); }
.nav-link.active { background: #E8F5EF; color: var(--brand-800); }

.cart-btn {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg); border: 1.5px solid var(--border); color: var(--brand-800);
}
.cart-btn:hover { border-color: var(--brand-600); }
.cart-badge {
  position: absolute; top: -7px; inset-inline-start: -7px;
  background: var(--accent); color: #3A2708; font-size: .72rem; font-weight: 800;
  min-width: 21px; height: 21px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 5px;
  border: 2px solid #fff;
}
.menu-toggle { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; }

.ref-banner { background: var(--accent-soft); color: #6B4A08; font-size: .9rem; border-bottom: 1px solid #F5E0BC; padding: 9px 0; }

/* ---------------- messages ---------------- */
.messages-wrap { padding-top: 16px; }
.alert {
  position: relative; display: flex; align-items: center; gap: 10px;
  border-radius: 12px; padding: 13px 46px 13px 16px; margin-bottom: 10px;
  font-weight: 600; font-size: .95rem; border: 1px solid transparent;
  animation: slideDown .25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }
.alert-success { background: #ECFDF3; color: #14532D; border-color: #BBE7CC; }
.alert-error { background: #FEF2F2; color: #7F1D1D; border-color: #FECACA; }
.alert-warning { background: #FFFBEB; color: #78350F; border-color: #FDE68A; }
.alert-info { background: #EFF6FF; color: #1E3A8A; border-color: #BFDBFE; }
.alert-close {
  position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: inherit; opacity: .6;
}
.alert-close:hover { opacity: 1; }

/* ---------------- hero ---------------- */
.hero {
  background-image:
    radial-gradient(900px 400px at 85% -10%, rgba(244, 168, 37, .20), transparent 60%),
    radial-gradient(700px 420px at 10% 110%, rgba(31, 191, 133, .28), transparent 60%),
    var(--grad-hero);
  background-color: #0A3B2C; /* تیره بودن هیرو همیشه تضمین می‌شود */
  color: #EAF6F1; overflow: hidden; position: relative;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 26px 26px; pointer-events: none;
}
.hero-inner { display: grid; grid-template-columns: 1.25fr .9fr; gap: 30px; align-items: center; padding: 58px 0; position: relative; z-index: 1; }
.hero-compact .hero-inner { padding: 44px 0; }
.hero-kicker {
  display: inline-block; background: rgba(242, 169, 59, .16); color: var(--accent);
  border: 1px solid rgba(242, 169, 59, .4); border-radius: 999px;
  padding: 6px 15px; font-size: .86rem; font-weight: 700; margin-bottom: 14px;
}
.hero h1 { color: #fff; font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 900; line-height: 1.6; margin-bottom: 12px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { color: #C7E3D7; font-size: 1.03rem; max-width: 560px; }
.hero-search {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border-radius: 14px; padding: 7px 10px; max-width: 540px; margin-top: 22px;
  box-shadow: var(--shadow-lg); color: var(--muted);
}
.hero-search input { flex: 1; border: 0; background: transparent; padding: 10px 6px; }
.hero-search input:focus { box-shadow: none; }
.hero-stats { display: flex; gap: 30px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { color: #fff; font-size: 1.35rem; font-weight: 900; }
.hero-stats span { color: #9CC8B5; font-size: .82rem; }

.hero-art { position: relative; height: 340px; }
.hero-book {
  position: absolute; width: 150px; height: 210px; border-radius: 8px 14px 14px 8px;
  box-shadow: var(--shadow-lg); display: grid; place-items: center; text-align: center;
  color: #fff; font-weight: 800; font-size: .95rem; padding: 14px;
  border-inline-start: 6px solid rgba(0, 0, 0, .25);
  animation: float 6s ease-in-out infinite;
}
.hero-book span { text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hero-book { transform: rotate(var(--r, 0deg)) translate3d(var(--px, 0px), var(--py, 0px), 0); }
.hero-book.b1 { --r: -8deg; background: linear-gradient(150deg, #1D4ED8, #172554); top: 10px; right: 40px; }
.hero-book.b2 { --r: 5deg; background: linear-gradient(150deg, #B45309, #451A03); top: 60px; right: 200px; animation-delay: 1.2s; z-index: 2; }
.hero-book.b3 { --r: -3deg; background: linear-gradient(150deg, #7E22CE, #2E1065); top: 130px; right: 90px; animation-delay: 2.1s; }
.hero-book.b4 { --r: 9deg; background: linear-gradient(150deg, #0E7490, #083344); top: 30px; right: 330px; animation-delay: .6s; }
@keyframes float { 0%,100% { translate: 0 0; } 50% { translate: 0 -14px; } }
.teacher-art .b2 { background: linear-gradient(150deg, #15803D, #052E16); }
.teacher-art .b3 { background: linear-gradient(150deg, #C2410C, #431407); }
.teacher-art .b4 { background: linear-gradient(150deg, #7E22CE, #2E1065); }
.publisher-art .b1 { background: linear-gradient(150deg, #0F766E, #042F2E); }
.publisher-art .b3 { background: linear-gradient(150deg, #0369A1, #082F49); }
.publisher-art .b4 { background: linear-gradient(150deg, #4D7C0F, #1A2E05); }

/* ---------------- sections ---------------- */
.section { padding: 54px 0; }
.section-tight { padding: 26px 0 6px; }
.section-soft { background: #EEF3F0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head.center { justify-content: center; text-align: center; }
.section-sub { color: var(--muted); margin: 0; }
.page-title { margin-bottom: 4px; }
.page-head { padding-top: 34px; padding-bottom: 8px; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumb span { margin: 0 6px; opacity: .5; }

/* chips */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 999px;
  padding: 8px 15px; font-size: .9rem; font-weight: 600; color: var(--body);
  transition: .15s;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip em { font-style: normal; background: var(--bg); border-radius: 999px; padding: 1px 8px; font-size: .78rem; color: var(--muted); }
.chip:hover { border-color: var(--brand-600); color: var(--brand-800); transform: translateY(-1px); }
.chip-all { background: var(--brand-800); color: #fff; border-color: var(--brand-800); }
.chip-all em { background: rgba(255,255,255,.18); color: #fff; }
.chip.active { background: var(--brand-800); color: #fff; border-color: var(--brand-800); }

/* ---------------- book card / cover ---------------- */
.books-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
}
.book-card {
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(140deg, rgba(21, 148, 105, .6), rgba(244, 168, 37, .5), rgba(21, 148, 105, .25)) border-box;
  border: 1.5px solid transparent; border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s;
}
.book-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.book-card-cover { display: block; position: relative; overflow: hidden; }
/* درخشش مورب هنگام هاور روی جلد */
.book-card-cover::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .38) 48%, transparent 62%);
  transform: translateX(-140%); transition: transform .75s ease;
}
.book-card:hover .book-card-cover::after { transform: translateX(140%); }
.book-card:hover .cover { transform: scale(1.06); }
.discount-tag {
  position: absolute; top: 12px; inset-inline-start: 12px;
  background: var(--danger); color: #fff; font-size: .78rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; box-shadow: var(--shadow-sm); z-index: 3;
}
.discount-tag.big { position: static; display: inline-block; margin-top: 14px; font-size: .95rem; padding: 7px 16px; }

.cover {
  position: relative; aspect-ratio: 3 / 4; padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff; overflow: hidden;
  transition: transform .55s cubic-bezier(.16, 1, .3, 1);
}
.cover::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(115deg, transparent 40%, rgba(255,255,255,.10) 41%, transparent 43%),
    radial-gradient(circle at 80% 15%, rgba(255,255,255,.14), transparent 45%);
  pointer-events: none;
}
.cover::after {
  content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 0;
  width: 10px; background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,.05));
}
.cover-badge {
  align-self: flex-end; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px; font-size: .72rem; padding: 3px 10px; font-weight: 700;
  z-index: 2;
}
.cover-body { z-index: 2; display: flex; flex-direction: column; gap: 8px; margin-block: auto; padding-block: 12px; }
.cover-title { font-size: 1.18rem; font-weight: 900; line-height: 1.7; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.cover-author { font-size: .8rem; opacity: .85; }
.cover-publisher { font-size: .72rem; opacity: .8; z-index: 2; }
.cover-out {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(10, 20, 16, .68); color: #fff; font-weight: 900; font-size: 1.1rem;
  letter-spacing: 1px; z-index: 4;
}
.cover-lg { border-radius: 14px; box-shadow: var(--shadow-md); }
.cover-lg .cover-title { font-size: 1.5rem; }
.cover-xs { border-radius: 8px; padding: 9px; }
.cover-xs .cover-title { font-size: .8rem; }
.cover-xs .cover-author, .cover-xs .cover-publisher { display: none; }
.cover-xs .cover-badge { display: none; }

.book-card-body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.course-pill {
  align-self: flex-start; background: #E8F5EF; color: var(--brand-800);
  font-size: .76rem; font-weight: 700; border-radius: 7px; padding: 3px 9px;
}
.book-card-title { font-size: 1.02rem; font-weight: 800; margin: 0; line-height: 1.7; }
.book-card-title a { color: var(--ink); }
.book-card-title a:hover { color: var(--brand-700); }
.book-card-author { color: var(--muted); font-size: .84rem; margin: 0; min-height: 2.4em; }
.book-card-meta { display: flex; gap: 6px; color: var(--muted); font-size: .78rem; flex-wrap: wrap; }
.book-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); }
.price-box { display: flex; flex-direction: column; line-height: 1.5; }
.price { font-weight: 900; color: var(--brand-900); font-size: 1.02rem; }
.price.big { font-size: 1.6rem; color: var(--brand-800); }
.old-price { color: var(--muted); text-decoration: line-through; font-size: .8rem; }
.btn-add {
  background: var(--brand-800); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 14px; font-family: inherit; font-weight: 700; font-size: .87rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: .15s;
}
.btn-add:hover { background: var(--brand-700); }
.btn-add:disabled { background: #9CA9A3; }

/* ---------------- features / cta / steps ---------------- */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.features-grid.three { grid-template-columns: repeat(3, 1fr); }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: .2s;
}
.feature:hover { box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.section-soft .feature { background: #fff; }
.feature-icon {
  width: 56px; height: 56px; display: grid; place-items: center;
  font-size: 1.55rem; margin-bottom: 14px; border-radius: 16px;
  background: linear-gradient(140deg, var(--accent-soft), #FFE9C2);
  box-shadow: inset 0 0 0 1px rgba(244, 168, 37, .3), 0 6px 16px rgba(244, 168, 37, .16);
}
.feature h4 { margin-bottom: 6px; font-size: 1.02rem; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }

.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cta-card {
  display: flex; gap: 18px; align-items: flex-start; padding: 30px;
  border-radius: 20px; color: #fff; transition: .2s; box-shadow: var(--shadow-md);
}
.cta-card h3 { color: #fff; font-size: 1.3rem; margin-bottom: 8px; }
.cta-card p { margin: 0 0 12px; opacity: .92; font-size: .95rem; }
.cta-card:hover { transform: translateY(-4px); color: #fff; }
.cta-teacher { background: linear-gradient(135deg, #0F5C43, #1A9368); }
.cta-publisher { background: linear-gradient(135deg, #7C3A12, #D98E1F); }
.cta-emoji { font-size: 2.2rem; }
.cta-link { font-weight: 800; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step {
  background: var(--surface); border-radius: var(--radius); padding: 26px;
  text-align: center; border: 1px solid var(--border);
}
.step span {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  background-image: var(--grad-brand); background-color: #0B4A37; color: #fff;
  font-weight: 900; font-size: 1.2rem; border-radius: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-glow);
}
.step h4 { margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------------- footer ---------------- */
.site-footer { background: linear-gradient(180deg, #0B3B2E 0%, #062119 100%); color: #B9D8CB; margin-top: 40px; position: relative; }
.site-footer::before {
  content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px;
  background-image: var(--grad-line);
  background-color: #159469;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; padding: 46px 0 34px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 8px; }
.footer-col a, .footer-col span { color: #B9D8CB; font-size: .9rem; }
.footer-col a:hover { color: var(--accent); }
.footer-brand strong { color: #fff; font-size: 1.15rem; }
.footer-brand { margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0; font-size: .85rem; text-align: center; color: #8FB6A4; }
.footer-bottom strong { color: #FFFFFF; font-weight: 800; }
.footer-dev { display: inline-block; margin-inline-start: 4px; }

/* ---------------- list page ---------------- */
.list-layout { display: grid; grid-template-columns: 275px 1fr; gap: 26px; padding-top: 20px; align-items: start; }
.filters-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; position: sticky; top: 92px;
}
.filters-box summary {
  font-weight: 800; color: var(--ink); cursor: pointer; font-size: 1.05rem;
  list-style: none; margin-bottom: 6px;
}
.filters-box summary::-webkit-details-marker { display: none; }
.filters-box summary::after { content: "▾"; margin-inline-start: 8px; color: var(--muted); }
.filter-group { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.filter-group > label { display: block; font-weight: 700; color: var(--ink); font-size: .92rem; margin-bottom: 9px; }
.radio-list { display: flex; flex-direction: column; gap: 7px; max-height: 300px; overflow: auto; }
.radio-row { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; color: var(--body); }
.radio-row input { accent-color: var(--brand-700); }
.radio-row span { display: inline-flex; align-items: center; gap: 7px; flex: 1; }
.radio-row span i { width: 9px; height: 9px; border-radius: 50%; }
.radio-row em { font-style: normal; font-size: .76rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: .92rem; }
.checkbox-row input { accent-color: var(--brand-700); width: 17px; height: 17px; }
.seg { display: flex; gap: 8px; }
.seg a {
  flex: 1; text-align: center; padding: 8px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: .9rem; font-weight: 700; color: var(--body);
}
.seg a.active { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.filter-form .btn-block { margin-top: 14px; }
.filter-form .btn-ghost { margin-top: 8px; }
.list-results { min-width: 0; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 34px; }
.page-link { background: #fff; border: 1.5px solid var(--border); border-radius: 10px; padding: 9px 20px; font-weight: 700; }
.page-link:hover { border-color: var(--brand-600); }
.page-current { color: var(--muted); font-size: .92rem; }

.empty-state {
  background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 54px 26px; text-align: center; grid-column: 1 / -1;
}
.empty-state span { font-size: 2.6rem; display: block; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 18px; }
.empty-state.slim { padding: 30px 20px; }

/* ---------------- detail page ---------------- */
.detail-layout { display: grid; grid-template-columns: 340px 1fr; gap: 40px; padding-top: 18px; align-items: start; }
.detail-cover { position: sticky; top: 100px; display: flex; flex-direction: column; align-items: center; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tag {
  background: var(--tag-color, var(--brand-800)); color: #fff;
  font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 5px 14px;
}
.tag-soft { background: #EEF3F0; color: var(--body); }
.detail-info h1 { font-size: 2rem; margin-bottom: 8px; }
.detail-course { color: var(--brand-700); font-size: 1rem; }
.detail-author { color: var(--muted); margin-bottom: 18px; }
.spec-list {
  list-style: none; padding: 0; margin: 0 0 22px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px;
}
.spec-list li {
  display: flex; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; font-size: .9rem;
}
.spec-list span { color: var(--muted); }
.in-stock { color: var(--success); }
.out-stock { color: var(--danger); }
.buy-box {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 18px; padding: 22px; box-shadow: var(--shadow-sm);
}
.buy-price { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.buy-form { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.qty-stepper {
  display: inline-flex; align-items: center; border: 1.5px solid var(--border);
  border-radius: 12px; overflow: hidden; background: #fff;
}
.qty-btn {
  width: 42px; height: 100%; border: 0; background: var(--bg);
  font-size: 1.25rem; font-weight: 800; color: var(--brand-800); cursor: pointer;
}
.qty-btn:hover { background: #E4EDE9; }
.qty-input {
  width: 54px; border: 0; text-align: center; font-weight: 800;
  font-size: 1.02rem; padding: 11px 4px; -moz-appearance: textfield; appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { box-shadow: none; }
.buy-notes { list-style: none; padding: 16px 0 0; margin: 16px 0 0; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 7px; font-size: .89rem; color: var(--muted); }
.detail-desc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 30px; }
.detail-desc p { color: var(--body); }
.desc-note { background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; margin-top: 14px; color: #6B4A08; font-size: .93rem; }

/* ---------------- cart ---------------- */
.cart-layout { display: grid; grid-template-columns: 1fr 330px; gap: 24px; align-items: start; padding-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.cart-items { padding: 8px 20px; }
.cart-row {
  display: grid; grid-template-columns: 74px 1fr auto auto auto;
  gap: 16px; align-items: center; padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.cart-row:last-child { border-bottom: 0; }
.cart-cover { width: 74px; }
.cart-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-title { font-weight: 800; color: var(--ink); }
.cart-title:hover { color: var(--brand-700); }
.cart-meta { color: var(--muted); font-size: .82rem; }
.cart-unit { color: var(--muted); font-size: .85rem; }
.cart-qty { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.cart-line-total { font-weight: 900; color: var(--brand-900); white-space: nowrap; }
.remove-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--border);
  background: #fff; color: var(--danger); cursor: pointer; font-size: 1rem;
}
.remove-btn:hover { background: #FEF2F2; border-color: #FECACA; }
.summary { position: sticky; top: 92px; }
.summary h3 { margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; font-size: .95rem; }
.summary-row.grand {
  border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 14px;
  font-size: 1.06rem; font-weight: 900; color: var(--ink);
}
.summary .btn-block { margin-top: 12px; }
.summary-hint { background: var(--accent-soft); color: #6B4A08; border-radius: 10px; padding: 10px 12px; font-size: .86rem; margin: 10px 0 0; }
.summary-items { list-style: none; padding: 0 0 10px; margin: 0 0 8px; border-bottom: 1px dashed var(--border); display: flex; flex-direction: column; gap: 9px; }
.summary-items li { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.si-title { color: var(--body); }
.si-title em { color: var(--muted); font-style: normal; font-size: .82rem; }
.ref-note { background: var(--accent-soft); border: 1px solid #F5E0BC; color: #6B4A08; border-radius: 10px; padding: 11px 14px; font-size: .88rem; margin-top: 14px; }

/* ---------------- checkout ---------------- */
.checkout-layout { display: grid; grid-template-columns: 1.35fr .9fr; gap: 26px; align-items: start; padding-top: 16px; padding-bottom: 40px; }
.form-section-title {
  font-size: 1.02rem; margin: 26px 0 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--bg); position: relative;
}
.form-section-title::after { content: ""; position: absolute; bottom: -2px; right: 0; width: 54px; height: 2px; background: var(--brand-700); }
.checkout-form .form-section-title:first-of-type { margin-top: 6px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: .9rem; color: var(--ink); }
.errorlist { list-style: none; padding: 0; margin: 0; color: var(--danger); font-size: .84rem; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.pay-card {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 14px; padding: 15px;
  transition: .15s; background: #fff;
}
.pay-card:has(input:checked) { border-color: var(--brand-700); background: #F1F9F5; box-shadow: 0 0 0 3px rgba(20, 122, 87, .12); }
.pay-card input { accent-color: var(--brand-700); margin-top: 5px; }
.pay-body { display: flex; flex-direction: column; gap: 3px; }
.pay-body strong { color: var(--ink); font-size: .96rem; }
.pay-body small { color: var(--muted); line-height: 1.7; }
.form-hint { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 14px; }
.sticky-summary { position: sticky; top: 92px; }

/* ---------------- order ---------------- */
.success-hero { text-align: center; padding: 40px 24px; margin-top: 26px; }
.success-icon { font-size: 3rem; display: block; margin-bottom: 6px; }
.success-hero h1 { font-size: 1.6rem; }
.order-code {
  display: inline-block; background: var(--brand-900); color: var(--accent);
  font-size: 1.7rem; font-weight: 900; letter-spacing: 4px;
  border-radius: 14px; padding: 10px 30px; margin: 12px 0;
}
.status-pill {
  display: inline-block; font-size: .8rem; font-weight: 800;
  border-radius: 999px; padding: 5px 14px;
}
.status-registered { background: #EFF6FF; color: var(--info); }
.status-preparing { background: #FFFBEB; color: var(--warn); }
.status-sent { background: #F5F3FF; color: #6D28D9; }
.status-delivered { background: #ECFDF3; color: var(--success); }
.status-canceled { background: #FEF2F2; color: var(--danger); }
.order-card { margin-top: 22px; }
.order-card h3 { margin-bottom: 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.data-table th {
  text-align: right; background: var(--bg); color: var(--ink);
  padding: 11px 14px; font-size: .85rem; font-weight: 800;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.data-table tfoot td { font-weight: 700; }
.data-table .grand-row td { background: var(--accent-soft); color: #6B4A08; font-weight: 900; font-size: 1rem; }
.data-table .discount-row td { color: var(--success); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 20px; }
.info-grid div { background: var(--bg); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; }
.info-grid span { color: var(--muted); font-size: .8rem; }
.info-grid strong { color: var(--ink); }
.address-box { margin-top: 14px; background: var(--bg); border-radius: 10px; padding: 13px 16px; font-size: .93rem; }
.address-box span { color: var(--muted); font-weight: 700; }
.pay-guide { margin-top: 22px; }
.card-number {
  display: inline-block; background: var(--brand-900); color: #fff;
  font-size: 1.25rem; font-weight: 800; letter-spacing: 2px;
  border-radius: 12px; padding: 12px 22px; margin: 10px 0 6px;
}
.order-actions { display: flex; gap: 12px; justify-content: center; margin: 26px 0 44px; }

/* ---------------- forms / contact ---------------- */
.form-card { padding: 28px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; padding-top: 16px; }
.contact-card { text-align: center; display: flex; flex-direction: column; gap: 4px; padding: 26px 18px; transition: .2s; }
.contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.contact-card span { font-size: 1.9rem; }
.contact-card h3 { margin: 6px 0 2px; font-size: .95rem; color: var(--muted); font-weight: 700; }
.contact-card strong { color: var(--brand-900); font-size: 1.05rem; }
.contact-card strong.small-strong { font-size: .9rem; line-height: 1.8; }
.contact-card small { color: var(--muted); }
.info-banner { margin-top: 22px; margin-bottom: 44px; }
.info-banner ul { padding-inline-start: 0; padding-inline-end: 18px; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------------- partners ---------------- */
.join-layout { display: grid; grid-template-columns: 1fr 1.05fr; gap: 34px; align-items: start; }
.join-info h2 { margin-bottom: 10px; }
.check-list { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 11px; }
.check-list li { position: relative; padding-inline-start: 30px; color: var(--body); }
.check-list li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 4px;
  width: 21px; height: 21px; background: var(--brand-800); color: #fff;
  border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 900;
}
.join-tip { background: var(--accent-soft); border: 1px solid #F5E0BC; color: #6B4A08; border-radius: 12px; padding: 14px 18px; font-size: .9rem; }
.faq { max-width: 820px; }
.faq h2 { margin-bottom: 18px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 15px 20px; margin-bottom: 10px;
}
.faq summary { font-weight: 800; color: var(--ink); cursor: pointer; }
.faq p { color: var(--muted); margin-top: 10px; font-size: .93rem; }

/* dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding-top: 30px; flex-wrap: wrap; }
.dash-head h1 { margin-bottom: 6px; }
.link-cards { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-top: 22px; }
.link-card h3 { margin-bottom: 12px; }
.copy-row { display: flex; gap: 10px; }
.copy-row .input { background: var(--bg); font-weight: 700; }
.code-input { font-size: 1.35rem; letter-spacing: 3px; text-align: center; color: var(--brand-800); }
.link-card .muted { margin-top: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.stat-card { text-align: center; padding: 24px 12px; display: flex; flex-direction: column; gap: 6px; }
.stat-card.accent { background: linear-gradient(140deg, #0F5C43, #1A9368); border-color: transparent; }
.stat-card.accent .stat-num { color: var(--accent); }
.stat-card.accent .stat-label { color: #CDEBDD; }
.stat-num { font-size: 1.45rem; font-weight: 900; color: var(--brand-900); line-height: 1.6; }
.stat-label { color: var(--muted); font-size: .85rem; }
.table-card { margin-top: 22px; margin-bottom: 46px; overflow-x: auto; }
.commission-cell { color: var(--success); font-weight: 800; }
.dash-note { margin-top: 16px; background: var(--bg); border-radius: 10px; padding: 12px 16px; }
.pub-stats {
  display: flex; justify-content: center; gap: 60px; flex-wrap: wrap;
  margin-top: 34px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.pub-stats div { text-align: center; }
.pub-stats strong { display: block; font-size: 1.8rem; color: var(--brand-800); font-weight: 900; }
.pub-stats span { color: var(--muted); font-size: .9rem; }

/* toast */
.toast {
  position: fixed; bottom: 26px; right: 50%; transform: translateX(50%) translateY(80px);
  background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 999px;
  font-weight: 700; font-size: .92rem; opacity: 0; pointer-events: none;
  transition: .3s; z-index: 200; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

/* ---------------- responsive ---------------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .features-grid, .features-grid.three { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 280px 1fr; gap: 26px; }
}

@media (max-width: 860px) {
  .header-search { display: none; }
  .menu-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    background: #fff; flex-direction: column; padding: 12px 5%;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .list-layout { grid-template-columns: 1fr; }
  .filters-box { position: static; }
  .cart-layout, .checkout-layout, .join-layout { grid-template-columns: 1fr; }
  .link-cards { grid-template-columns: 1fr; }
  .cta-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-cover { position: static; max-width: 300px; margin-inline: auto; }
  .spec-list { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 64px 1fr auto; grid-auto-rows: auto; }
  .cart-qty { grid-column: 2; flex-direction: row; }
  .cart-line-total { grid-column: 3; grid-row: 1; }
  .cart-row form:last-child { grid-column: 3; grid-row: 2; justify-self: end; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  h1 { font-size: 1.5rem; }
  .features-grid, .features-grid.three, .form-grid-2, .pay-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 13px; }
  .book-card-body { padding: 11px; }
  .book-card-footer { flex-direction: column; align-items: stretch; }
  .btn-add { justify-content: center; }
  .hero-inner { padding: 38px 0; }
  .hero-stats { gap: 18px; }
  .topbar-inner { justify-content: center; text-align: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-num { font-size: 1.1rem; }
  .order-code { font-size: 1.25rem; letter-spacing: 2px; }
  .data-table { font-size: .84rem; }
  .data-table th, .data-table td { padding: 9px 8px; }
}

/* ============================================================
   ★ لایه زیبایی: کرسر سفارشی، انیمیشن‌ها و جزئیات پرمیوم
   ============================================================ */

/* --- انتخاب متن و اسکرول‌بار --- */
::selection { background: var(--accent); color: #3A2708; }
html { scroll-padding-top: 96px; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #E9EFEC; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--brand-700), var(--brand-500)); border-radius: 99px; border: 2.5px solid #E9EFEC; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-600); }

/* --- ورود نرم محتوای اصلی --- */
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
main { animation: pageIn .55s cubic-bezier(.16, 1, .3, 1) both; }

/* --- ورود پلکانی عناصر هیرو --- */
@keyframes rise { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
.hero .hero-kicker { animation: rise .8s cubic-bezier(.16, 1, .3, 1) .05s both; }
.hero h1 { animation: rise .8s cubic-bezier(.16, 1, .3, 1) .16s both; }
.hero p { animation: rise .8s cubic-bezier(.16, 1, .3, 1) .27s both; }
.hero .hero-search { animation: rise .8s cubic-bezier(.16, 1, .3, 1) .38s both; }
.hero .hero-stats { animation: rise .8s cubic-bezier(.16, 1, .3, 1) .5s both; }
.hero .btn { animation: rise .8s cubic-bezier(.16, 1, .3, 1) .4s both; }

/* --- اورب‌های نور (ایستا و سبک — بدون انیمیشن دائمی) --- */
.hero-orb {
  position: absolute; border-radius: 50%; filter: blur(72px);
  z-index: 0; pointer-events: none;
}
.hero-orb.o1 { width: 360px; height: 360px; background: rgba(244, 168, 37, .55); top: -110px; left: -70px; }
.hero-orb.o2 { width: 320px; height: 320px; background: rgba(31, 191, 133, .5); bottom: -120px; right: 8%; }
.hero-orb.o3 { width: 230px; height: 230px; background: rgba(94, 234, 212, .35); top: 28%; right: 34%; }

/* --- ظاهر شمارنده‌های هیرو --- */
.hero-stats strong {
  background: linear-gradient(120deg, #FFFFFF, #B9F0D8 70%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* --- تیتر بخش‌ها با خط گرادیانی --- */
.section-head h2 { position: relative; padding-bottom: 12px; display: inline-block; }
.section-head h2::after {
  content: ""; position: absolute; bottom: 0; right: 0;
  width: 58px; height: 4px; border-radius: 99px;
  background-color: #F4A825;
  background-image: var(--grad-accent);
  transition: width .5s cubic-bezier(.16, 1, .3, 1);
}
.section-head:hover h2::after { width: 100%; }
.page-title { position: relative; }

/* --- هدر جامد (بدون بلور سنگین برای سرعت) --- */
.site-header { background: rgba(255, 255, 255, .97); }

/* --- چیپ‌ها و تگ‌ها --- */
.chip { transition: .2s cubic-bezier(.16, 1, .3, 1); }
.chip:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(7, 46, 35, .12); }
.chip-all, .chip.active { background-image: var(--grad-brand); background-color: #0B4A37; border-color: transparent; box-shadow: var(--shadow-glow); }
.tag { background-image: var(--grad-brand) !important; background-color: #0B4A37 !important; }

/* --- کارت‌ها و باکس‌های قیمت --- */
.card { transition: box-shadow .35s ease, transform .35s cubic-bezier(.16, 1, .3, 1); }
.buy-box { position: relative; overflow: hidden; }
.buy-box::before {
  content: ""; position: absolute; top: 0; right: 0; left: 0; height: 4px;
  background-color: #F4A825;
  background-image: var(--grad-accent);
}
.price.big { color: var(--brand-800); }
.discount-tag { background: linear-gradient(135deg, #EF4444, #B91C1C); box-shadow: 0 6px 16px rgba(185, 28, 28, .35); }

/* --- بدجی سبد خرید: پرش --- */
@keyframes badgePop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.cart-badge.bump { animation: badgePop .55s cubic-bezier(.16, 1, .3, 1); }

/* --- کارت‌های تماس و CTA --- */
.contact-card span, .cta-emoji { transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
.contact-card:hover span { transform: scale(1.18) rotate(-6deg); }
.cta-card { position: relative; overflow: hidden; }
.cta-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 180px at var(--mx, 70%) var(--my, 20%), rgba(255, 255, 255, .22), transparent 65%);
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.cta-card:hover::after { opacity: 1; }

/* --- باز شدن نرم جزئیات (FAQ) --- */
.faq details[open] summary { color: var(--brand-800); }
.faq details summary::marker { color: var(--brand-600); }

/* --- کرسر سفارشی --- */
.cursor-dot, .cursor-ring { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.js body, html.js body *, html.js body *::before, html.js body *::after { cursor: none !important; }
  html.js input, html.js textarea, html.js [contenteditable] { cursor: text !important; }

  .cursor-dot {
    display: block; position: fixed; top: 0; left: 0; z-index: 10001;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2.5px rgba(255, 255, 255, .8), 0 2px 10px rgba(222, 139, 18, .5);
    pointer-events: none; opacity: 0; transition: opacity .25s, transform .18s ease;
    will-change: transform;
  }
  .cursor-ring {
    display: block; position: fixed; top: 0; left: 0; z-index: 10000;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1.6px solid rgba(11, 74, 55, .55);
    background: rgba(21, 148, 105, .05);
    pointer-events: none; opacity: 0;
    transition: opacity .25s, width .28s cubic-bezier(.16, 1, .3, 1), height .28s cubic-bezier(.16, 1, .3, 1),
                background .28s, border-color .28s;
    will-change: transform;
  }
  .cursor-on .cursor-dot, .cursor-on .cursor-ring { opacity: 1; }
  .cursor-ring.is-hover {
    width: 66px; height: 66px;
    background: rgba(244, 168, 37, .16);
    border-color: rgba(244, 168, 37, .9);
  }
  .cursor-dot.is-down { width: 5px; height: 5px; }
  .cursor-ring.is-down { width: 24px; height: 24px; }
  .cursor-off .cursor-dot, .cursor-off .cursor-ring { opacity: 0; }
}

/* --- ظاهر شدن هنگام اسکرول (Reveal) --- */
html.js .reveal {
  opacity: 0; transform: translateY(30px) scale(.98); pointer-events: none;
  transition: opacity .75s cubic-bezier(.16, 1, .3, 1) var(--rd, 0s),
              transform .75s cubic-bezier(.16, 1, .3, 1) var(--rd, 0s);
}
html.js .reveal.is-in { opacity: 1; transform: none; pointer-events: auto; }

/* --- تیلت سه‌بعدی کارت‌های کتاب --- */
html.js .tilting { transition: box-shadow .25s ease; will-change: transform; }

/* --- کپی موفق لینک‌ها --- */
.copy-row .btn:active { transform: scale(.96); }

/* --- احترام به ترجیح کاهش حرکت --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html.js .reveal { opacity: 1 !important; transform: none !important; }
  html.js body, html.js body * { cursor: auto !important; }
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* --- موبایل: کرسر لمسی حذف شود --- */
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* --- جلد عکسی (آپلودشده از پنل ادمین) --- */
.cover-photo { padding: 0; background: #0A3B2C; }
.cover-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.cover-photo .cover-badge {
  position: absolute; top: 10px; z-index: 3;
  background: rgba(7, 46, 35, .72); border-color: rgba(255, 255, 255, .4);
}

/* صفت hidden همیشه غالب است (رفع باگ بسته‌نشدن چت و ...) */
[hidden] { display: none !important; }

/* ================= حساب کاربری و ورود OTP ================= */
.auth-wrap { max-width: 480px; margin: 48px auto 64px; }
.auth-card { padding: 32px 28px; text-align: center; }
.auth-icon { font-size: 2.4rem; margin-bottom: 6px; }
.auth-form { margin-top: 18px; text-align: right; }
.auth-form .btn { margin-top: 10px; }
.auth-benefits { list-style: none; margin: 20px 0 6px; padding: 14px; background: var(--accent-soft); border-radius: var(--radius-sm); text-align: right; font-size: .88rem; }
.auth-benefits li { padding: 4px 0; }
.auth-alt { font-size: .84rem; color: var(--muted); margin-top: 14px; }
.dev-code { text-align: center; font-size: 1rem; }
.dev-code strong { font-size: 1.3rem; letter-spacing: 3px; }
.dev-code small { display: block; opacity: .75; font-size: .74rem; margin-top: 4px; }
.input-ltr { direction: ltr; text-align: center; font-size: 1.15rem; letter-spacing: 4px; }
.otp-input { font-weight: 800; }

.account-wrap { max-width: 980px; margin: 36px auto 72px; }
.account-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; margin-top: 10px; }
.account-card { padding: 22px; }
.account-card h3 { margin-bottom: 14px; }
.account-phone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 16px; }
.badge-ok { background: #DCFCE7; color: var(--success); font-size: .76rem; padding: 3px 9px; border-radius: 99px; font-weight: 700; }
.logout-form { margin-top: 16px; }
.my-orders { list-style: none; padding: 0; margin: 0; }
.my-orders li a {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; color: inherit; text-decoration: none; transition: .2s;
}
.my-orders li a:hover { border-color: var(--brand-600); background: var(--bg); }
.mo-code { font-weight: 800; color: var(--brand-700); }
.mo-date, .mo-total { font-size: .86rem; color: var(--muted); }
.mo-status { font-size: .76rem; padding: 3px 10px; border-radius: 99px; background: var(--bg); font-weight: 700; }
.st-registered { background: #E0F2FE; color: #0369A1; }
.st-preparing { background: #FEF3C7; color: #B45309; }
.st-sent { background: #EDE9FE; color: #6D28D9; }
.st-delivered { background: #DCFCE7; color: var(--success); }
.st-canceled { background: #FEE2E2; color: var(--danger); }

/* ================= دکمه حساب در هدر ================= */
.account-btn {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 12px;
  color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 700; transition: .2s;
}
.account-btn:hover { background: var(--bg); color: var(--brand-700); }
@media (max-width: 900px) { .account-label { display: none; } }

/* ================= ویارد «کتاب‌های ترم من» ================= */
.wizard { padding: 24px; }
.wizard-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.wstep label { display: block; font-size: .84rem; font-weight: 800; margin-bottom: 6px; color: var(--brand-800); }
.wstep[data-step="4"] { grid-column: 1 / -1; }
.wplaceholder { color: var(--muted); font-size: .9rem; padding: 14px; background: var(--bg); border-radius: var(--radius-sm); text-align: center; }
.wresult { display: grid; gap: 10px; }
.wcourse { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--bg); }
.wcourse h4 { font-size: .95rem; margin-bottom: 8px; color: var(--brand-800); }
.wbook { display: flex; align-items: center; gap: 10px; padding: 7px 4px; font-size: .9rem; cursor: pointer; border-radius: 8px; }
.wbook:hover { background: rgba(15, 107, 78, .06); }
.wbook input { accent-color: var(--brand-600); width: 17px; height: 17px; }
.wbook-title { flex: 1; }
.wbook-price { color: var(--brand-700); font-weight: 800; font-size: .84rem; }
.wbook.off { opacity: .55; cursor: not-allowed; }
.wbook.off .wbook-price { color: var(--danger); }
.wizard-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
@media (max-width: 760px) { .wizard-steps { grid-template-columns: 1fr; } }

/* ================= فیلترهای پیشرفته ================= */
.filter-hint { display: block; font-size: .74rem; color: var(--muted); margin-top: 5px; }
.price-range { display: flex; align-items: center; gap: 8px; }
.price-range .input { width: 100%; }
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.active-chip { background: var(--brand-700); color: #fff; font-size: .8rem; padding: 5px 12px; border-radius: 99px; text-decoration: none; font-weight: 700; }
.active-chip:hover { background: var(--brand-800); }

/* ================= شیوه ارسال در تسویه ================= */
.ship-grid { display: grid; gap: 10px; margin-bottom: 6px; }
.ship-card .ship-cost { display: block; margin-top: 5px; color: var(--brand-700); font-weight: 800; font-size: .84rem; font-style: normal; }
.summary-note { font-size: .8rem; color: var(--brand-700); min-height: 1.1em; margin-top: 6px; }

/* ================= نظرات و امتیاز ================= */
.reviews-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.review-form-card { padding: 20px; }
.review-form-card h3 { margin-bottom: 12px; }
.star-picker { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; direction: ltr; justify-content: flex-end; }
.star-label { margin-left: auto; direction: rtl; font-size: .88rem; font-weight: 700; }
.star { position: relative; cursor: pointer; font-size: 1.7rem; color: #D1D5DB; transition: color .15s, transform .15s; }
.star input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.star span { pointer-events: none; display: inline-block; transition: transform .15s; }
.star.on, .star.preview { color: var(--accent); }
.star.preview span { transform: scale(1.15); }
.reviews-list { display: grid; gap: 12px; }
.review-card { padding: 16px 18px; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-head strong { display: block; font-size: .92rem; }
.review-head small { color: var(--muted); font-size: .76rem; }
.review-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--grad-brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
}
.review-stars { margin-right: auto; color: var(--accent); letter-spacing: 2px; font-size: 1.05rem; }
.review-card p { font-size: .92rem; line-height: 1.9; color: var(--body); }
@media (max-width: 860px) { .reviews-layout { grid-template-columns: 1fr; } }

/* ================= صفحه قوانین ================= */
.rules-wrap { max-width: 980px; margin: 32px auto 72px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.rule-card { padding: 22px; }
.rule-card h3 { margin-bottom: 12px; }
.rule-card ul { padding-right: 1.2rem; display: grid; gap: 9px; font-size: .92rem; line-height: 1.9; }
.rule-card a { color: var(--brand-700); font-weight: 700; }
.rule-card details { border-top: 1px dashed var(--border); padding: 10px 0; }
.rule-card details:first-of-type { border-top: 0; }
.rule-card summary { cursor: pointer; font-weight: 800; font-size: .92rem; color: var(--brand-800); }
.rule-card details p { font-size: .88rem; margin-top: 8px; color: var(--body); line-height: 1.9; }
.rules-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px; margin-top: 16px; flex-wrap: wrap; }
.rules-cta h3 { margin-bottom: 4px; }
.rules-cta p { color: var(--muted); font-size: .9rem; }
.rules-cta-btns { display: flex; gap: 10px; }
@media (max-width: 760px) { .rules-grid { grid-template-columns: 1fr; } }

/* ================= چت پشتیبانی ================= */
.chat-fab {
  position: fixed; bottom: 22px; left: 22px; z-index: 960;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--grad-brand); color: #fff; display: grid; place-items: center;
  cursor: pointer; box-shadow: 0 12px 30px rgba(7, 46, 35, .35);
  transition: transform .2s;
}
.chat-fab:hover { transform: scale(1.07); }
.chat-fab.active { background: var(--accent); color: var(--ink); }
.chat-fab-badge {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff;
  font-size: .7rem; font-weight: 800; min-width: 20px; height: 20px; border-radius: 99px;
  display: grid; place-items: center; padding: 0 5px; animation: chatPulse 1.4s infinite;
}
@keyframes chatPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.chat-panel {
  position: fixed; bottom: 90px; left: 22px; z-index: 961;
  width: min(360px, calc(100vw - 32px)); height: 460px; max-height: calc(100vh - 130px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(7, 46, 35, .25); display: flex; flex-direction: column; overflow: hidden;
}
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; background: var(--grad-brand); color: #fff; }
.chat-head strong { display: block; font-size: .95rem; }
.chat-head small { font-size: .74rem; opacity: .85; }
.chat-close { background: rgba(255,255,255,.15); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.chat-empty { text-align: center; color: var(--muted); font-size: .88rem; line-height: 2; margin: auto; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: .88rem; line-height: 1.8; position: relative; }
.bubble.mine { align-self: flex-start; background: var(--brand-700); color: #fff; border-bottom-left-radius: 5px; }
.bubble.staff { align-self: flex-end; background: #fff; border: 1px solid var(--border); border-bottom-right-radius: 5px; }
.btime { display: block; font-size: .66rem; opacity: .7; margin-top: 3px; text-align: left; direction: ltr; }
.chat-inputs { padding: 10px; border-top: 1px solid var(--border); background: var(--surface); display: grid; gap: 8px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row .input { flex: 1; }
.chat-input-row .btn { min-width: 46px; }
@media (max-width: 560px) {
  .chat-panel { left: 8px; right: 8px; width: auto; }
  .chat-fab { bottom: 16px; left: 14px; }
}
