/* ============================================================
   کتابفروشی — سیستم طراحی «قفسه و جلد پارچه‌ای» (تأییدشده)
   ============================================================ */

:root {
  --ink: #20241c;
  --paper: #e7decb;
  --paper-soft: #f4efe2;
  --paper-card: #fbf8ef;
  --cloth: #2f4a3e;
  --cloth-deep: #1f3229;
  --cloth-tint: #dde6df;
  --rust: #b5622f;
  --rust-tint: #f0ded0;
  --brass: #a8823d;
  --stone: #6b6555;
  --line: rgba(32, 36, 28, 0.16);
  --line-strong: rgba(32, 36, 28, 0.28);
  --shadow: 0 1px 2px rgba(32, 24, 12, 0.06), 0 8px 24px rgba(32, 24, 12, 0.08);
  --good: #3d7a4f;
}

* { box-sizing: border-box; }

.num { font-variant-numeric: tabular-nums; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; direction: rtl; }
@media (max-width: 640px) { .wrap { padding: 0 18px; } }

.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon.solid { fill: currentColor; stroke: none; }

/* ---------- Header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(231, 222, 202, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-row { display: flex; align-items: center; gap: 22px; padding: 12px 0; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; flex-shrink: 0; text-decoration: none; color: var(--ink); }
.brand .mark { width: 42px; height: 42px; object-fit: contain; }
.brand .word { letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }

nav.links { display: flex; align-items: center; gap: 22px; font-size: 14.5px; color: var(--stone); }
nav.links a, nav.links .nav-link { text-decoration: none; white-space: nowrap; color: var(--stone); padding: 0; background: none; border: none; }
nav.links a:hover, nav.links .nav-link:hover { color: var(--ink); }
nav.links .dropdown-toggle::after { margin-right: 4px; }

.search-shell {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  max-width: 380px;
  color: var(--stone);
  font-size: 14px;
}
.search-shell input { border: none; outline: none; background: transparent; color: var(--ink); font-family: inherit; font-size: 14px; width: 100%; }
.search-shell input::placeholder { color: var(--stone); }
.search-shell button { border: none; background: none; padding: 0; display: flex; color: var(--stone); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); color: var(--ink); background: var(--paper-card);
  flex-shrink: 0; position: relative; text-decoration: none;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn i { font-size: 16px; }

.badge-dot {
  position: absolute; top: -5px; left: -5px;
  background: var(--rust); color: #fff; font-size: 10px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--paper);
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 700;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn-cloth { background: var(--cloth); color: var(--paper-soft); }
.btn-cloth:hover { background: var(--cloth-deep); color: var(--paper); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn:focus-visible { outline: 2px solid var(--cloth); outline-offset: 2px; }

@media (max-width: 1100px) { nav.links, .search-shell { display: none; } }

/* dropdowns triggered from the header (cart / notifications / category / account) */
.nav-actions .dropdown-menu,
nav.links .dropdown-menu {
  background: var(--paper-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 14px;
  padding: 8px;
  direction: rtl;
}
.nav-actions .dropdown-menu .dropdown-item,
nav.links .dropdown-menu .dropdown-item {
  border-radius: 9px;
  color: var(--ink);
}
.nav-actions .dropdown-menu .dropdown-item:hover,
nav.links .dropdown-menu .dropdown-item:hover {
  background: var(--cloth-tint);
  color: var(--cloth);
}

/* ---------- Hero ---------- */
.hero {
  padding: 76px 0 88px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  color: #fff;
  background-image: linear-gradient(115deg, rgba(12, 16, 12, 0.86) 0%, rgba(18, 22, 16, 0.66) 55%, rgba(12, 16, 12, 0.82) 100%), url('/images/home/library.jpg');
  background-size: cover;
  background-position: center 30%;
}
.hero-grid { display: flex; align-items: flex-end; gap: 56px; flex-wrap: wrap; }
.hero-grid > *:first-child { flex: 1.05 1 420px; min-width: 300px; max-width: 640px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; letter-spacing: 0.06em;
  color: var(--cloth); font-weight: 700; background: var(--cloth-tint); padding: 6px 14px; border-radius: 999px;
  margin-bottom: 20px;
}
.eyebrow .icon { width: 13px; height: 13px; }
.hero .eyebrow { background: rgba(255, 255, 255, 0.14); color: #fff; }

.hero h1 { font-size: clamp(31px, 4vw, 48px); line-height: 1.32; letter-spacing: -0.01em; margin: 0; font-weight: 700; text-wrap: balance; color: #fff; }
.hero h1 em { font-style: normal; color: var(--brass); }

.hero-sub { margin-top: 18px; font-size: 16.5px; color: var(--stone); max-width: 46ch; }
.hero .hero-sub { color: rgba(255, 255, 255, 0.88); }

.hero-search {
  margin-top: 28px; display: flex; gap: 8px; background: var(--paper-card);
  border: 1px solid var(--line-strong); border-radius: 16px; padding: 8px;
  box-shadow: var(--shadow); max-width: 520px;
}
.hero-search input { flex: 1; border: none; outline: none; background: transparent; font-family: inherit; font-size: 15px; color: var(--ink); padding: 10px 14px; }
.hero-search .btn-cloth { display: flex; align-items: center; gap: 6px; }

.hero-trustline { margin-top: 14px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--stone); }
.hero-trustline .icon { width: 14px; height: 14px; color: var(--good); }
.hero .hero-trustline { color: rgba(255, 255, 255, 0.85); }
.hero .hero-trustline .icon { color: #a9dab8; }

.hero-stats { margin-top: 34px; display: flex; gap: 34px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 25px; color: var(--ink); }
.hero-stats .stat span { font-size: 12.5px; color: var(--stone); }
.hero .hero-stats .stat b { color: #fff; }
.hero .hero-stats .stat span { color: rgba(255, 255, 255, 0.75); }

.seal {
  position: absolute; top: 32px; left: 32px; width: 100px; height: 100px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #f4ead8; font-size: 11px; font-weight: 700; line-height: 1.35;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}
.seal svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.seal .txt { position: relative; z-index: 1; padding: 0 14px; }

@media (max-width: 900px) { .seal { width: 80px; height: 80px; font-size: 9px; top: 18px; left: 18px; } }

/* ---------- Trust strip ---------- */
.trust { padding: 26px 0; border-bottom: 1px solid var(--line); background: var(--paper-soft); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
.trust-item { display: flex; align-items: center; gap: 12px; }
.trust-item .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--cloth-tint); color: var(--cloth); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.trust-item .ic .icon { width: 21px; height: 21px; }
.trust-item b { display: block; font-size: 14.5px; }
.trust-item span { font-size: 12.5px; color: var(--stone); }

/* ---------- Section ---------- */
.kf-section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.section-head .label { font-size: 12.5px; letter-spacing: 0.07em; color: var(--brass); font-weight: 700; margin-bottom: 10px; display: block; }
.section-head h2 { font-size: clamp(23px, 2.5vw, 31px); margin: 0; font-weight: 700; }
.section-head p { color: var(--stone); margin-top: 10px; max-width: 52ch; }
.see-all { font-size: 14px; font-weight: 700; color: var(--cloth); text-decoration: none; white-space: nowrap; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.see-all:hover { color: var(--cloth-deep); }

/* ---------- Categories ---------- */
.cat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 900px) { .cat-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .cat-row { grid-template-columns: repeat(2, 1fr); } }
.cat-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; text-align: center; text-decoration: none; color: var(--ink); transition: transform 0.15s ease, border-color 0.15s ease; }
.cat-card .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--cloth-tint); color: var(--cloth); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.cat-card .ic .icon { width: 19px; height: 19px; }
.cat-card b { display: block; font-size: 13.5px; }
.cat-card span { font-size: 11.5px; color: var(--stone); }
.cat-card:hover { transform: translateY(-3px); border-color: var(--line-strong); color: var(--ink); }

/* ---------- Book grid ---------- */
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 980px) { .book-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .book-grid { grid-template-columns: 1fr; } }
.book-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.cover { aspect-ratio: 3/4; position: relative; display: flex; align-items: flex-end; padding: 16px; color: #fff; overflow: hidden; background-size: cover; background-position: center; }
.cover::before { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 14%; background: rgba(0,0,0,0.16); }
.cover .title { font-size: 15.5px; font-weight: 700; line-height: 1.4; position: relative; z-index: 1; }
.cover .author { font-size: 12px; opacity: 0.85; margin-top: 6px; position: relative; z-index: 1; }
.cover .catno { position: absolute; top: 12px; left: 12px; font-size: 10.5px; background: rgba(0,0,0,0.28); padding: 3px 8px; border-radius: 999px; z-index: 1; letter-spacing: 0.02em; }
.book-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.book-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--stone); }
.seller-rating { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--stone); }
.seller-rating .stars { display: flex; gap: 1px; color: var(--line-strong); }
.seller-rating .stars .icon { width: 13px; height: 13px; }
.seller-rating .stars .icon.filled { color: var(--brass); }
.seller-rating .count { color: var(--stone); }
.seller-rating.no-rating { color: var(--stone); opacity: 0.75; }
.price-row { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.price { font-weight: 700; font-size: 16.5px; color: var(--cloth); }
.add-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.add-btn .icon { width: 16px; height: 16px; }
.add-btn:hover { background: var(--cloth); border-color: var(--cloth); color: #fff; }

/* ---------- Transparency / receipt ---------- */
.transparency { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .transparency { grid-template-columns: 1fr; } }
.fact-list { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; }
.fact { display: flex; gap: 14px; }
.fact .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--cloth-tint); color: var(--cloth); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fact .ic .icon { width: 18px; height: 18px; }
.fact b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.fact p { font-size: 13.5px; color: var(--stone); margin: 0; }

.receipt { background: var(--paper-card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.receipt-head { padding: 20px 24px; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; align-items: center; }
.receipt-head b { font-size: 14.5px; }
.receipt-head span { font-size: 11.5px; color: var(--stone); }
.receipt-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 13px; }
.receipt-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--stone); }
.receipt-row.total { color: var(--ink); font-weight: 700; font-size: 17px; padding-top: 14px; border-top: 1px solid var(--line-strong); margin-top: 3px; }
.receipt-foot { padding: 14px 24px; background: var(--cloth-tint); display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cloth); }
.receipt-foot .icon { width: 14px; height: 14px; }

/* ---------- How it works ---------- */
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 900px) { .how-grid { grid-template-columns: 1fr; } }
.how-col { background: var(--paper-card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.how-col-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.how-col-head .ic { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.how-col-head .ic .icon { width: 22px; height: 22px; }
.how-col.buyer .ic { background: var(--cloth-tint); color: var(--cloth); }
.how-col.seller .ic { background: var(--rust-tint); color: var(--rust); }
.how-col-head h3 { font-size: 18px; margin: 0; }
.how-col-head span { font-size: 12.5px; color: var(--stone); }
.step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px dashed var(--line); }
.step:first-of-type { border-top: none; padding-top: 0; }
.step .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--paper-soft); color: var(--stone); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step .ic .icon { width: 15px; height: 15px; }
.step b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.step p { font-size: 13.5px; color: var(--stone); margin: 0; }

.tracker { display: flex; align-items: center; margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--line); }
.tr-node { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; position: relative; }
.tr-node .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--cloth); z-index: 1; }
.tr-node.pending .dot { background: var(--line-strong); }
.tr-node span { font-size: 10.5px; color: var(--stone); text-align: center; }
.tr-node::before { content: ""; position: absolute; top: 5px; right: 50%; width: 100%; height: 2px; background: var(--cloth); z-index: 0; }
.tr-node:first-child::before { display: none; }
.tr-node.pending::before { background: var(--line-strong); }

/* ---------- Sell CTA ---------- */
.sell-cta { background: var(--cloth); color: var(--paper-soft); border-radius: 24px; padding: 50px; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .sell-cta { grid-template-columns: 1fr; padding: 34px 26px; } }
.sell-cta .eyebrow { background: rgba(255,255,255,0.12); color: var(--brass); }
.sell-cta h2 { color: #fff; font-size: clamp(23px, 3vw, 33px); margin: 0; }
.sell-cta p.desc { color: rgba(244, 239, 226, 0.82); margin-top: 14px; max-width: 48ch; }
.sell-cta .btn-cloth { background: var(--paper-soft); color: var(--cloth-deep); margin-top: 22px; }
.sell-cta .btn-cloth:hover { background: #fff; }
.sell-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sell-fig { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); border-radius: 14px; padding: 16px 18px; }
.sell-fig .icon { width: 18px; height: 18px; color: var(--brass); margin-bottom: 8px; }
.sell-fig b { display: block; font-size: 20px; color: #fff; }
.sell-fig span { font-size: 11.5px; color: rgba(244, 239, 226, 0.78); }

/* ---------- Quick links ---------- */
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .quick-row { grid-template-columns: 1fr; } }
.quick-card { display: flex; align-items: center; gap: 16px; background: var(--paper-card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.quick-card .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--cloth-tint); color: var(--cloth); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-card b { display: block; font-size: 15px; }
.quick-card span { font-size: 12.5px; color: var(--stone); }

/* ---------- Testimonials (سخن روز) ---------- */
.quote-row { display: grid; grid-template-columns: 1fr; gap: 20px; }
.quote-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: 14px; padding: 26px; position: relative; display: flex; gap: 20px; align-items: center; }
.quote-card .mark { color: var(--cloth-tint); flex-shrink: 0; }
.quote-card .mark .icon { width: 34px; height: 34px; }
.quote-card p.q { font-size: 17px; position: relative; z-index: 1; margin: 0; }
.quote-who { margin-top: 12px; }
.quote-who b { display: block; font-size: 13px; }

/* ---------- Footer ---------- */
footer.site { background: var(--paper-soft); border-top: 1px solid var(--line); padding: 52px 0 26px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 32px; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-grid h5 { font-size: 13px; letter-spacing: 0.03em; margin-bottom: 16px; color: var(--stone); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Legal pages (Impressum / Datenschutz / Cookie-Richtlinie) ----------
   متن این صفحات کاملاً آلمانی و LTR است؛ فونت فارسی سایت اعداد لاتین را با گلیف فارسی
   نمایش می‌دهد، پس باید فونت را مستقیماً روی همه‌ی المان‌های فرزند override کنیم،
   چون یک قانون مستقیم (مثل body { p { font-family: iransansweb } }) همیشه بر ارث‌بری
   از والد برنده می‌شود، حتی اگر آن قانون important نداشته باشد. */
.bj_privacy_policy .page-area,
.bj_privacy_policy .page-area * {
  font-family: Arial, sans-serif !important;
}
.foot-grid a { text-decoration: none; font-size: 14px; color: var(--ink); }
.foot-grid a:hover { color: var(--cloth); }
.foot-bottom { border-top: 1px solid var(--line); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--stone); flex-wrap: wrap; gap: 12px; }
.foot-bottom .legal-name { color: var(--ink); font-weight: 700; }

/* ---------- Profile ---------- */
.account_dashboard_content {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.account_dashboard_content_header {
  background: var(--cloth-tint);
  color: var(--cloth);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.account_dashboard_sidebar_profile {
  border-radius: 16px;
  background: var(--paper-card);
  box-shadow: var(--shadow);
}
.sidebar_widget_menu {
  background: var(--paper-card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sidebar_widget_menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar_widget_menu li a.active,
.sidebar_widget_menu li a:hover {
  color: var(--cloth);
  background: var(--cloth-tint);
}
