/* صفحه‌های عمومی کاتالوگ (خانه، لیست، خانواده، جزئیات، مقایسه)
   همه‌ی کلاس‌ها با cp- شروع می‌شوند تا با base.css، home، product-card.css و products.css تداخل نکنند.
   رنگ‌ها از متغیرهای base.css می‌آیند، پس تم تیره هم خودکار کار می‌کند. */

.cp-sku { direction: ltr; unicode-bidi: plaintext; font-weight: 600 }
.cp-rfq { color: var(--muted); font-weight: 500; font-size: 14px }
.cp-empty { text-align: center; color: var(--muted); padding: 34px 16px }
.cp-note { background: var(--pri-soft); border-color: transparent; margin-bottom: 14px }
.cp-sub { color: var(--muted); margin: -4px 0 12px }
[hidden] { display: none !important }

/* ── جای خالی تصویر ── */
.cp-ph { font-size: 62px; opacity: .55 }
.cp-ph.big { font-size: 110px }

/* ── کارت خانواده ── */
.cp-fcard { color: inherit }
.cp-fcard .img { overflow: hidden; background: #fff }
.cp-fcard .img img { width: 100%; height: 100%; object-fit: contain; padding: 8px }
.cp-fcard .cp-ex {
    margin: 0; font-size: 13px; color: var(--muted); line-height: 1.8;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: right
}
.cp-fcard .price, .cp-fcard .cp-rfq { margin-top: auto }

/* ── صفحه اصلی ── */
.cp-hero-search { display: flex; gap: 8px; max-width: 560px; margin: 20px 0 14px }
.cp-hero-search input { margin: 0; border: 0; padding: 12px 16px; border-radius: 10px }
.cat i.cp-mono {
    width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 10px;
    display: grid; place-items: center; font-size: 26px; font-weight: 700; font-style: normal;
    background: var(--pri-soft); color: var(--pri)
}
.cat:hover i.cp-mono { background: var(--pri); color: #fff }
.cp-cnt { display: block; font-size: 12px; font-weight: 400; color: var(--muted) }

/* ── لیست محصولات ── */
.cp-shop { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start }
.cp-side { position: sticky; top: 90px }
.cp-side h4 { margin-top: 0 }
.cp-side a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 10px; border-radius: 8px }
.cp-side a:hover { background: var(--pri-soft) }
.cp-side a.on { background: var(--pri); color: #fff }
.cp-side a.on small { color: #fff; opacity: .85 }
.cp-side small { color: var(--muted) }
.cp-tree { list-style: none; margin: 0; padding: 0 }
.cp-tree .cp-tree { padding-right: 14px; border-right: 1px dashed var(--line); margin-right: 8px }
.cp-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.cp-toolbar input, .cp-toolbar select { margin: 0; width: auto; flex: 1; min-width: 160px }
.cp-toolbar select { flex: 0 0 200px }
.cp-count { color: var(--muted); margin: 10px 0 0 }
.cp-pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 24px 0 }
.cp-pager a {
    min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--card)
}
.cp-pager a:hover { border-color: var(--pri); color: var(--pri) }
.cp-pager a.on { background: var(--pri); border-color: var(--pri); color: #fff }

/* ── صفحه‌ی خانواده ── */
.cp-fhead h1 { margin-bottom: 8px }
.cp-fhead p { color: var(--muted); max-width: 900px }
.cp-bullets { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px }
.cp-bullets li { position: relative; padding-right: 26px }
.cp-bullets li:before {
    content: "✓"; position: absolute; right: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--pri-soft); color: var(--pri); font-size: 11px; display: grid; place-items: center
}
.cp-group { margin-top: 16px }
.cp-group-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 14px }
.cp-group-head img { width: 150px; max-height: 130px; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: 6px }
.cp-group-head h3 { margin-bottom: 4px }
.cp-group-head p { margin: 0 0 6px; color: var(--muted) }
.cp-content { overflow: auto }
.cp-content img { max-width: 100% }
.cp-files { display: flex; gap: 10px; flex-wrap: wrap }

/* ── جدول مدل‌ها ── */
.cp-tbl td { padding: 9px 14px }
.cp-tbl .price { font-size: 14px }
.cp-tbl tr.cur td { background: var(--pri-soft) }
.cp-tbl td.acts { text-align: left }
.cp-chk { width: 44px; text-align: center }
.cp-chk input { width: 18px; height: 18px; margin: 0; accent-color: var(--pri); cursor: pointer }
.cp-av {
    display: inline-block; padding: 0 10px; border-radius: 12px; font-size: 12px; line-height: 22px; white-space: nowrap
}
.cp-av.ok { background: rgba(22, 163, 74, .14); color: var(--ok) }
.cp-av.warn { background: rgba(245, 158, 11, .18); color: var(--warn) }
.cp-av.muted { background: var(--bg); color: var(--muted) }

/* ── جزئیات محصول ── */
.cp-detail { display: grid; grid-template-columns: minmax(280px, 5fr) 6fr; gap: 28px; align-items: start; margin-bottom: 10px }
.cp-gallery {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r); min-height: 340px;
    display: grid; place-items: center; padding: 18px
}
.cp-gallery img { max-width: 100%; max-height: 360px; object-fit: contain }
.cp-info h1 { margin: 2px 0 4px; font-size: 30px; text-align: left }
.cp-pricebox { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 14px 0; background: var(--card); box-shadow: var(--sh) }
.cp-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.price.big, .cp-rfq.big { font-size: 28px }
.cp-tiers { margin: 12px 0; font-size: 13px }
.cp-tiers th, .cp-tiers td { padding: 4px 10px }
.cp-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px }
.cp-cmp-btn { cursor: pointer; margin: 0 }
.cp-cmp-btn input { width: 16px; height: 16px; margin: 0; accent-color: var(--pri) }
.cp-spec th { width: 34%; text-align: right; background: var(--bg) }
.cp-spec td { direction: ltr; text-align: left }

/* ── مقایسه ── */
.cp-cmp-tools { display: flex; gap: 14px; align-items: center; margin-bottom: 12px }
.cp-cmp-tools .chk { display: inline-flex; gap: 6px; align-items: center; color: var(--text); cursor: pointer; margin: 0 }
.cp-cmp-wrap { max-height: 78vh }
.cp-cmp { min-width: 560px }
.cp-cmp th { text-align: right }
.cp-cmp tbody th { position: sticky; right: 0; background: var(--bg); min-width: 170px; z-index: 1 }
.cp-cmp thead th { position: sticky; top: 0; background: var(--card); z-index: 2; text-align: center; white-space: normal; min-width: 190px; vertical-align: top }
.cp-cmp thead th.cp-corner { right: 0; z-index: 3; background: var(--bg) }
.cp-cmp td { text-align: center }
.cp-cmp tr.diff td { background: var(--pri-soft); font-weight: 500 }
.cp-cmp.only-diff tr.same { display: none }
.cp-ph-head { position: relative }
.cp-ph-head .mini { position: absolute; top: 6px; left: 6px }
.cp-ph-head small { display: block; font-weight: 400; color: var(--muted) }
.cp-thumb { height: 96px; display: grid; place-items: center; background: #fff; border-radius: 8px; margin-bottom: 6px }
.cp-thumb img { max-height: 90px; object-fit: contain }
.mini { width: 26px; height: 26px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 6px; cursor: pointer; line-height: 1; padding: 0 }
.mini:hover { border-color: var(--pri); color: var(--pri) }

/* ── نوار مقایسه (پایین صفحه) ── */
.cp-bar {
    position: fixed; right: 0; left: 0; bottom: 0; z-index: 60; background: var(--dark); color: #fff;
    padding: 10px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .25)
}
.cp-bar .chips { display: flex; gap: 6px; flex-wrap: wrap }
.cp-bar .chip { background: rgba(255, 255, 255, .12); border-radius: 16px; padding: 0 10px; display: inline-flex; gap: 6px; align-items: center; direction: ltr }
.cp-bar .chip button { background: none; border: 0; color: #fff; cursor: pointer; opacity: .7 }
.cp-bar .chip button:hover { opacity: 1 }
.cp-bar .btn.disabled { opacity: .45; pointer-events: none }
.cp-bar .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .3) }
body.has-cp-bar { padding-bottom: 66px }
.toast.cp-warn { background: var(--warn) }

@media (max-width: 900px) {
    .cp-shop { grid-template-columns: 1fr }
    .cp-side { position: static }
    .cp-detail { grid-template-columns: 1fr }
    .cp-group-head { flex-direction: column }
}
@media (max-width: 700px) {
    .cp-hero-search { flex-direction: column }
    .cp-info h1 { font-size: 24px }
}
@media print {
    .cp-bar, .cp-cmp-tools, header, footer, nav { display: none !important }
}
