/* ==========================================================================
   تفال ایران — page styles for the catalogue pages
   (listing, PDP, ranges, needs, compare, blog). Shared tokens + classes live in style.css.
   ========================================================================== */

/* ---------- listing head ---------- */
.listing-head { background: var(--ground); }
.listing-intro { margin-top: 6px; }
.listing-intro h1 { font-size: clamp(22px, 3vw, 32px); font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em; }
.listing-intro p { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 90ch; line-height: 1.8; }
.subnav-strip a span { display: block; line-height: 1.4; }
.subnav-strip a small { font-size: 10.5px; font-weight: 600; color: var(--muted-2); }
.listing-banner { position: relative; display: block; margin-top: 18px; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1240 / 260; max-height: 300px; background: var(--ink); color: #fff; isolation: isolate; }
.listing-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform 0.8s var(--ease); }
.listing-banner:hover img { transform: scale(1.03); }
.listing-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.05) 70%); z-index: -1; }
.listing-banner__text { position: absolute; inset-inline-start: clamp(20px, 4vw, 48px); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; max-width: 60%; }
.listing-banner__text .eyebrow { color: #fff; opacity: 0.85; margin: 0; }
.listing-banner__text strong { font-size: clamp(20px, 2.8vw, 34px); font-weight: 900; line-height: 1.3; text-transform: uppercase; }
.listing-banner__text span:last-child { font-size: 13px; opacity: 0.85; }

/* ---------- sidebar filters ---------- */
.filters__head strong { display: flex; align-items: center; gap: 8px; }
.filters__close { display: none; width: 32px; height: 32px; border-radius: 50%; font-size: 22px; line-height: 1; color: #fff; place-items: center; }
.filters__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-inline-start: auto; margin-inline-end: 10px; }
.filters__opt span { flex: 1; min-width: 0; line-height: 1.5; }
.filters__opt.is-off { pointer-events: auto; }
.filters__opt.is-off small { opacity: 0.7; }
.filters__foot { display: none; padding: 14px 16px; border-top: 1px solid var(--line-soft); background: var(--surface); position: sticky; bottom: 0; }
.toolbar__count { display: flex; align-items: center; gap: 12px; }
.toolbar__count strong { color: var(--ink); font-weight: 800; }
.toolbar__sort label { font-weight: 700; color: var(--ink); }
.chips a b { font-weight: 800; opacity: 0.8; }
.chips a small { font-weight: 600; opacity: 0.8; }
.family-group + .family-group { margin-top: 8px; }
.family-band small a { color: #fff; }
.listing-foot .blog-grid .post p { -webkit-line-clamp: 2; }

/* mobile: filters become a drawer */
@media (max-width: 960px) {
  .filters { position: fixed; inset: 0 auto 0 0; width: min(88vw, 380px); z-index: 210; border-radius: 0; border: 0; transform: translateX(-100%); transition: transform 0.35s var(--ease), box-shadow 0.35s; display: flex; flex-direction: column; overflow-y: auto; box-shadow: none; }
  html[dir="rtl"] .filters { inset: 0 0 0 auto; transform: translateX(100%); }
  .filters.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45); }
  .filters__head { position: sticky; top: 0; z-index: 2; }
  .filters__close { display: grid; }
  .filters__foot { display: block; margin-top: auto; }
  .filters details { padding-inline: 18px; }
}

/* ---------- PDP ---------- */
.pdp .crumbs { margin-bottom: 18px; }
.buybox__fam { font-family: var(--font-logo), var(--font); font-weight: 900; font-size: 13px; letter-spacing: 0.04em; color: var(--red) !important; }
.buybox__family > span + span::before { content: "·"; margin-inline-end: 8px; color: var(--line); }
.choice__opt { text-align: start; font-family: inherit; width: 100%; }
.choice__opt span { align-items: flex-start; }
.gallery__main--solo { grid-column: 1 / -1; }
.gallery:has(.gallery__main--solo) { grid-template-columns: 1fr; }
.gallery__main .product-card__tags { position: absolute; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; z-index: 1; }
.buybox__features li { padding: 0; }
.buybox__features li a { display: block; padding: 5px 11px; color: inherit; }
.buybox__features li:hover { border-color: var(--red); color: var(--red); }
.buybox__price .price--big .price__toman { font-size: clamp(24px, 2.6vw, 32px); }
.pdp-section { padding-block: clamp(36px, 5vw, 64px); }
.pdp-desc { max-width: 80ch; margin-inline: auto; line-height: 1.9; }
.ksp { margin-top: 28px; }
.ksp--1 { grid-template-columns: minmax(0, 320px); justify-content: center; }
.ksp--2 { grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; }
.ksp--3 { grid-template-columns: repeat(3, 1fr); }
.dim__note { margin-top: 12px; font-weight: 800; color: var(--red); }
.dim--box h3 { margin-top: 0; }
.spec--compare thead th a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 13px; line-height: 1.4; }
.spec--compare thead th a:hover { color: var(--red); }
.spec--compare thead th small { text-align: center; }
.spec--compare td { text-align: center; }
.spec--compare tbody th { text-align: start; }
.spec--compare .stars { justify-content: center; }
.spec--compare del { color: var(--muted-2); font-weight: 400; font-size: 12px; }
.spec__feats { font-size: 12.5px; color: var(--muted); }
.pdp-section .row-scroll__track > * { flex-basis: min(70vw, 250px); }
.pdp-section .kol__body .stars i { color: var(--gold); }

/* ---------- ranges ---------- */
.range-featured { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 8px; }
.range-hero { position: relative; display: flex; align-items: flex-end; min-height: 260px; border-radius: var(--radius-lg); overflow: hidden; background: var(--ink); color: #fff; isolation: isolate; }
.range-hero--big { grid-column: span 2; grid-row: span 2; min-height: 100%; }
.range-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform 0.8s var(--ease); background: #fff; }
.range-hero:hover img { transform: scale(1.05); }
.range-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.05) 60%); z-index: -1; }
.range-hero__body { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.range-hero__cat { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.range-hero h3 { font-family: var(--font-logo), var(--font); font-size: clamp(20px, 2.2vw, 30px); font-weight: 900; text-align: end; letter-spacing: 0.02em; }
.range-hero--big h3 { font-size: clamp(28px, 3.4vw, 44px); }
.range-hero p { font-size: 13px; opacity: 0.9; line-height: 1.6; }
.range-hero__count { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.18); align-self: flex-start; margin-top: 6px; }
.range-strip--wrap { grid-template-columns: repeat(5, 1fr); }
.range-strip--wrap .range-tile__media { aspect-ratio: 1; padding: 12px; background: #fff; }
.range-strip--wrap .range-tile__media img { object-fit: contain; }
.range-cat { padding-block: clamp(18px, 3vw, 32px); }
.range-cat .family-band { margin-bottom: 16px; }

/* ---------- needs ---------- */
.need-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.need-tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s; }
.need-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.need-tile__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); }
.need-tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.need-tile:hover .need-tile__media img { transform: scale(1.05); }
.need-tile__body { padding: 14px 16px 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.need-tile__body h3 { font-size: 15px; font-weight: 800; }
.need-tile__body span { font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.chips--lg { gap: 10px; margin-bottom: 0; }
.chips--lg a { padding: 10px 16px; font-size: 13.5px; background: var(--surface); }
.material-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.material-tile { display: flex; flex-direction: column; gap: 6px; padding: 22px 20px; border-radius: var(--radius); border: 1px solid var(--line-soft); background: var(--surface); position: relative; overflow: hidden; transition: border-color 0.25s, transform 0.3s var(--ease); }
.material-tile::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 6px; background: var(--red); }
.material-tile--stainless::before { background: linear-gradient(#cfd3d8, #8d949c); }
.material-tile--aluminium::before, .material-tile--cast-aluminium::before { background: linear-gradient(#e2e4e6, #9aa0a6); }
.material-tile--carbon-steel::before { background: #2b2b29; }
.material-tile--glass::before { background: linear-gradient(#dff1ef, #9ccbc6); }
.material-tile--ceramic::before { background: linear-gradient(#f5e6d3, #c9a27a); }
.material-tile--plastic::before { background: var(--blue); }
.material-tile:hover { border-color: var(--red); transform: translateY(-3px); }
.material-tile strong { font-size: 16px; font-weight: 800; }
.material-tile span { font-size: 12.5px; color: var(--muted); }

/* ---------- compare ---------- */
.quiz__picks { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; margin-top: 12px; }
.quiz__pick { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line-soft); background: var(--soft); transition: border-color 0.2s, transform 0.3s var(--ease); }
.quiz__pick:hover { border-color: var(--red); transform: translateY(-2px); }
.quiz__pick--top { background: var(--red-soft); border-color: var(--red); }
.quiz__pick img { width: 96px; height: 96px; flex: none; }
.quiz__pick--top img { width: 140px; height: 140px; }
.quiz__pick h3 { font-size: 15px; font-weight: 800; line-height: 1.4; }
.quiz__pick--top h3 { font-size: 19px; }
.quiz__pick p { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.quiz__rank { display: inline-block; font-size: 11px; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.quiz__more { margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.quiz__more a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.compare-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.compare-note a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
#table .capsule-tabs { flex-wrap: wrap; border-radius: 24px; }
.spec--sticky-head thead th { top: 0; }

/* ---------- blog ---------- */
.blog-cats { margin-top: 16px; margin-bottom: 0; }
.blog-grid--feature .post--featured .post__media { aspect-ratio: 16 / 9; flex: 1; }
.blog-grid--feature .post--featured p { -webkit-line-clamp: 4; font-size: 14.5px; }
.post-page { padding-top: clamp(16px, 3vw, 28px); }
.post-page__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(24px, 4vw, 48px); align-items: start; }
.post-page__main .page-title { font-size: clamp(24px, 3vw, 36px); font-weight: 900; line-height: 1.4; margin-top: 4px; }
.post-page__main .post__media--hero { aspect-ratio: 16 / 8; }
.post-page__main .prose { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 36px); }
.post-page__main .prose h2:first-of-type { margin-top: 12px; }
.post-page__main .prose .lead { font-size: 17px; color: var(--muted); }
.post-toc { padding: 16px 20px; border-radius: var(--radius); background: var(--soft); border: 1px solid var(--line-soft); margin-bottom: 20px; font-size: 14px; }
.post-toc strong { display: block; margin-bottom: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--red); }
.post-toc ol { margin: 0; padding-inline-start: 20px; columns: 2; column-gap: 24px; }
.post-toc li { margin: 2px 0; break-inside: avoid; }
.post-toc a { color: var(--ink); text-decoration: none; }
.post-toc a:hover { color: var(--red); }
.post-cta { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--muted); }
.post-page__side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 16px; }
.post-side { padding: 18px 18px 8px; }
.post-side h3 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; color: var(--red); }
.post-side__list li { border-top: 1px solid var(--line-soft); }
.post-side__list a { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.post-side__list img { width: 56px; height: 56px; object-fit: contain; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); flex: none; }
.post-side__list span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.post-side__list strong { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-side__list em { font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--red); }
.post-side__list a:hover strong { color: var(--red); }
.post-side__links li { border-top: 1px solid var(--line-soft); }
.post-side__links a { display: block; padding: 9px 0; font-size: 13px; line-height: 1.5; }
.post-side__links a:hover { color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .range-featured { grid-template-columns: repeat(3, 1fr); }
  .range-hero--big { grid-column: span 3; grid-row: span 1; min-height: 320px; }
  .range-strip--wrap { grid-template-columns: repeat(4, 1fr); }
  .need-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .listing-banner { aspect-ratio: 16 / 7; }
  .listing-banner__text { max-width: 75%; }
  .range-featured { grid-template-columns: repeat(2, 1fr); }
  .range-hero--big { grid-column: span 2; }
  .range-strip--wrap { grid-template-columns: repeat(3, 1fr); }
  .need-tiles, .material-tiles { grid-template-columns: repeat(2, 1fr); }
  .quiz__picks { grid-template-columns: 1fr; }
  .post-page__grid { grid-template-columns: 1fr; }
  .post-page__side { position: static; }
  .ksp--3 { grid-template-columns: repeat(2, 1fr); }
  .ksp--2 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .listing-banner { aspect-ratio: 4 / 3; max-height: none; }
  .listing-banner__text { max-width: 90%; }
  .toolbar { align-items: stretch; }
  .toolbar__sort { width: 100%; justify-content: space-between; }
  .toolbar__sort select { flex: 1; }
  .range-featured { grid-template-columns: 1fr; }
  .range-hero, .range-hero--big { grid-column: span 1; min-height: 220px; }
  .range-strip--wrap { grid-template-columns: repeat(2, 1fr); }
  .need-tiles, .material-tiles { grid-template-columns: 1fr; }
  .ksp--3, .ksp--2 { grid-template-columns: 1fr; }
  .post-toc ol { columns: 1; }
  .blog-cats { display: none; }
  .quiz__pick img, .quiz__pick--top img { width: 84px; height: 84px; }
}
