/* =====================================================================
   TRADE DESIGN — catalog & product pages
   ===================================================================== */

/* ---------- shared page chrome ---------- */
.breadcrumbs { padding: 18px 0 0; }
.breadcrumbs .container { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.breadcrumbs a { color: var(--ink-3); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--ink-4); }
.breadcrumbs .cur { color: var(--ink); font-weight: 500; }

.page-head { padding: 18px 0 4px; }
.page-head .container { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -0.03em; }
.page-head .ph-count { font-size: 14px; color: var(--ink-3); margin-top: 8px; }
.page-head .ph-count b { color: var(--ink); }

/* sub-category chips under the title */
.subcats { padding: 22px 0 0; }
.subcats .container { display: flex; flex-wrap: wrap; gap: 10px; }
.subcat {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: all .15s var(--ease);
}
.subcat:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.subcat.active { background: var(--ink); color: #fff; box-shadow: none; }
.subcat .n { font-size: 12px; opacity: .6; }
body[data-sharp="1"] .subcat { border-radius: 0; }

/* ---------- catalog layout ---------- */
.catalog { padding: 26px 0 var(--sec-y); }
.catalog .container { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }

/* filters sidebar */
.filters { position: sticky; top: 96px; }
.filters .f-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.filters .f-head h3 { font-size: 17px; }
.filters .f-reset { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.f-group { border-top: 1px solid var(--line); padding: 18px 0; }
.f-group:first-of-type { border-top: 0; }
.f-group > h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.f-group > h4 .tg { width: 18px; height: 18px; color: var(--ink-3); transition: transform .2s var(--ease); }
.f-group.collapsed > h4 .tg { transform: rotate(-90deg); }
.f-group.collapsed .f-body { display: none; }
.f-body { display: flex; flex-direction: column; gap: 11px; }
.chk { display: flex; align-items: center; gap: 11px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk .box { width: 19px; height: 19px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--line); flex-shrink: 0; display: grid; place-items: center; transition: all .15s; }
.chk .box svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.chk input:checked + .box { background: var(--accent); box-shadow: none; }
.chk input:checked + .box svg { opacity: 1; }
.chk:hover { color: var(--ink); }
.chk .cnt { margin-left: auto; font-size: 12px; color: var(--ink-4); }
body[data-sharp="1"] .chk .box { border-radius: 0; }

/* price range */
.price-row { display: flex; gap: 10px; margin-bottom: 14px; }
.price-row input { width: 50%; height: 42px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); padding: 0 12px; font-size: 14px; border: 0; outline: 0; }
.price-row input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.range { position: relative; height: 28px; }
.range .track { position: absolute; top: 12px; left: 0; right: 0; height: 4px; background: var(--line); border-radius: 4px; }
.range .fill { position: absolute; top: 12px; height: 4px; background: var(--accent); border-radius: 4px; }
.range input[type=range] { position: absolute; top: 0; left: 0; width: 100%; -webkit-appearance: none; appearance: none; background: none; pointer-events: none; height: 28px; margin: 0; }
.range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--accent), var(--shadow-1); cursor: pointer; margin-top: 0; }
.range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--accent), var(--shadow-1); cursor: pointer; }

.f-apply { width: 100%; margin-top: 4px; }
.filters-promo { margin-top: 22px; border-radius: var(--r); overflow: hidden; background: var(--ink); color: #fff; padding: 22px; }
.filters-promo b { font-size: 15px; display: block; margin-bottom: 6px; }
.filters-promo p { font-size: 13px; color: rgba(255,255,255,.7); margin: 0 0 14px; }

/* toolbar */
.cat-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cat-toolbar .applied { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.applied-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 13px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font-size: 13px; font-weight: 500; }
.applied-chip button { width: 17px; height: 17px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; line-height: 1; }
.applied-chip button svg { width: 9px; height: 9px; }
body[data-sharp="1"] .applied-chip, body[data-sharp="1"] .applied-chip button { border-radius: 0; }
.tb-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.sort-wrap { position: relative; }
.sort-btn { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 16px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; font-weight: 500; }
.sort-btn:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.sort-btn .lbl-pre { color: var(--ink-3); }
.sort-btn svg { width: 14px; height: 14px; color: var(--ink-3); }
.sort-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 6px; min-width: 220px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s var(--ease); }
.sort-pop.open { opacity: 1; visibility: visible; transform: translateY(0); }
.sort-pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink); }
.sort-pop button:hover { background: var(--surface-3); }
.sort-pop button.active { color: var(--accent); font-weight: 600; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--surface-3); }
.view-toggle button { width: 38px; height: 38px; border-radius: calc(var(--r-sm) - 2px); display: grid; place-items: center; color: var(--ink-3); }
.view-toggle button svg { width: 18px; height: 18px; }
.view-toggle button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-1); }

/* mobile filter button */
.f-close { display: none; }
.filter-mob { display: none; height: 44px; padding: 0 16px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; font-weight: 600; align-items: center; gap: 8px; }
.filter-mob svg { width: 16px; height: 16px; }

/* product grid (catalog uses 3 cols) */
#catGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
#catGrid.list { grid-template-columns: 1fr; }
#catGrid.list .product { flex-direction: row; }
#catGrid.list .prod-media { aspect-ratio: auto; width: 260px; flex-shrink: 0; }
#catGrid.list .prod-body { padding: 24px; }
#catGrid.list .prod-name { font-size: 17px; -webkit-line-clamp: 2; min-height: 0; }
#catGrid.list .prod-foot { margin-top: 18px; }
#catGrid .product.out-stock { opacity: .92; }
.prod-badge.out { background: var(--ink-3); }

/* pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 40px; }
.pager button, .pager a { min-width: 44px; height: 44px; padding: 0 12px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); transition: all .15s; }
.pager button:hover, .pager a:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.pager .active { background: var(--ink); color: #fff; box-shadow: none; }
.pager .nav svg { width: 16px; height: 16px; }

/* SEO text block */
.seo-text { background: var(--surface-2); }
.seo-text .container { max-width: 980px; }
.seo-text h2 { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.02em; margin-bottom: 16px; }
.seo-text h3 { font-size: 18px; margin: 26px 0 10px; }
.seo-text p { color: var(--ink-2); font-size: 15px; line-height: 1.7; margin: 0 0 14px; max-width: 80ch; }
.seo-text ul.dotted { margin: 0 0 16px; display: flex; flex-direction: column; gap: 9px; }
.seo-text ul.dotted li { position: relative; padding-left: 26px; color: var(--ink-2); font-size: 15px; }
.seo-text ul.dotted li::before { content: ''; position: absolute; left: 4px; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.seo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }

/* =====================================================================
   PRODUCT PAGE
   ===================================================================== */
.pdp { padding: 26px 0 0; }
.pdp .container { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 300px; gap: 40px; align-items: start; }

/* right rail: accessories / related */
.pdp-aside { min-width: 0; }
.acc-box { position: sticky; top: 96px; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); padding: 16px; }
.acc-title { display: flex; align-items: center; gap: 10px; font-size: 16px; letter-spacing: -0.02em; padding: 4px 6px 10px; }
.acc-title .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.acc-title .ic svg { width: 17px; height: 17px; }
body[data-sharp="1"] .acc-title .ic { border-radius: 0; }
.acc-item { position: relative; display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: var(--r); transition: background .16s var(--ease); }
.acc-item:hover { background: var(--surface-2); }
.acc-thumb { position: relative; width: 62px; height: 62px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3); flex-shrink: 0; transition: transform .2s var(--ease); }
.acc-item:hover .acc-thumb { transform: scale(1.04); }
.acc-thumb image-slot { position: absolute; inset: 0; width: 100%; height: 100%; }
.acc-info { min-width: 0; padding-right: 26px; }
.acc-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--ink); transition: color .15s; }
.acc-item:hover .acc-name { color: var(--accent); }
.acc-price { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; white-space: nowrap; }
.acc-add { position: absolute; right: 10px; bottom: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; transition: all .15s var(--ease); }
.acc-add:hover { background: var(--accent); color: #fff; transform: scale(1.08); }
.acc-add:active { transform: scale(.92); }
.acc-add svg { width: 16px; height: 16px; }
body[data-sharp="1"] .acc-add { border-radius: 0; }
.acc-all { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 8px; padding: 13px; border-radius: var(--r); background: var(--accent-tint); transition: background .15s; }
.acc-all:hover { background: var(--accent-soft); }
.acc-all svg { width: 14px; height: 14px; }

/* gallery */
.gallery { position: sticky; top: 96px; }
.gal-main { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); aspect-ratio: 4 / 3; }
.gal-main image-slot { position: absolute; inset: 0; width: 100%; height: 100%; }
.gal-badges { position: absolute; top: 16px; left: 16px; z-index: 3; display: flex; gap: 8px; }
.gal-fav { position: absolute; top: 16px; right: 16px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink-2); display: grid; place-items: center; }
.gal-fav:hover { color: var(--accent); }
.gal-fav.on { background: var(--accent); color: #fff; }
.gal-fav svg { width: 20px; height: 20px; }
body[data-sharp="1"] .gal-fav { border-radius: 0; }
.gal-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 12px; }
.gal-thumb { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; }
.gal-thumb image-slot { position: absolute; inset: 0; width: 100%; height: 100%; }
.gal-thumb.active { box-shadow: inset 0 0 0 2px var(--accent); }

/* summary */
.pdp-sum .pdp-brand { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }
.pdp-sum .pdp-brand b { color: var(--ink); font-weight: 700; }
.pdp-sum .pdp-brand .art { margin-left: auto; }
.pdp-sum h1 { font-family: var(--font-display); font-size: clamp(24px, 2.8vw, 34px); letter-spacing: -0.03em; line-height: 1.1; }
.pdp-meta { display: flex; align-items: center; gap: 18px; margin: 16px 0 22px; flex-wrap: wrap; }
.pdp-meta .stars { display: inline-flex; gap: 1px; }
.pdp-meta .stars svg { width: 16px; height: 16px; }
.pdp-meta .m-link { font-size: 13.5px; color: var(--ink-3); }
.pdp-meta .m-link:hover { color: var(--accent); }
.pdp-meta .in-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: #1f8a4d; }
.pdp-meta .in-stock svg { width: 15px; height: 15px; }

.buybox { border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); padding: 24px; margin-bottom: 22px; background: var(--surface); }
.buybox .price-now { font-family: var(--font-display); font-size: 36px; font-weight: 800; letter-spacing: -0.03em; }
.buybox .price-old { font-size: 17px; color: var(--ink-3); text-decoration: line-through; margin-left: 10px; }
.buybox .price-save { display: inline-block; margin-left: 10px; background: var(--accent-tint); color: var(--accent); font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; vertical-align: middle; }
body[data-sharp="1"] .buybox .price-save { border-radius: 0; }
.buybox .kaspi-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 20px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 14px; }
.buybox .kaspi-row .k-logo { font-weight: 800; color: var(--accent); }
.buybox .kaspi-row b { font-weight: 700; }
.buy-actions { display: flex; gap: 12px; }
.qty { display: inline-flex; align-items: center; border-radius: var(--r); box-shadow: inset 0 0 0 1.5px var(--line); height: 52px; }
.qty button { width: 46px; height: 100%; display: grid; place-items: center; color: var(--ink-2); font-size: 20px; }
.qty button:hover { color: var(--accent); }
.qty input { width: 46px; height: 100%; text-align: center; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 700; }
.buy-actions .btn-primary { flex: 1; }
.buy-secondary { display: flex; gap: 10px; margin-top: 12px; }
.buy-secondary button { flex: 1; height: 46px; border-radius: var(--r); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.buy-secondary button:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.buy-secondary button svg { width: 17px; height: 17px; }

/* quick specs + perks */
.pdp-perks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.perk { display: flex; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--surface-2); }
.perk .ic { width: 30px; height: 30px; color: var(--accent); flex-shrink: 0; }
.perk .ic svg { width: 100%; height: 100%; }
.perk b { font-size: 13.5px; display: block; }
.perk span { font-size: 12px; color: var(--ink-3); }

.key-specs { margin: 22px 0; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.key-specs .ks-row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 18px; font-size: 14px; border-top: 1px solid var(--line-2); }
.key-specs .ks-row:first-child { border-top: 0; }
.key-specs .ks-row span { color: var(--ink-3); }
.key-specs .ks-row b { font-weight: 600; text-align: right; }

/* tabs */
.pdp-tabs { margin: var(--sec-y) 0 0; }
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 30px; overflow-x: auto; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button { padding: 14px 20px; font-size: 15px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s; }
.tabbar button:hover { color: var(--ink); }
.tabbar button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel.desc { max-width: 820px; }
.tab-panel.desc p { font-size: 15.5px; line-height: 1.75; color: var(--ink-2); margin: 0 0 16px; }
.tab-panel.desc h3 { font-size: 19px; margin: 28px 0 10px; }

/* full specs table */
.spec-table { max-width: 820px; }
.spec-sec { margin-bottom: 30px; }
.spec-sec h4 { font-size: 16px; margin-bottom: 8px; }
.spec-table .sr { display: grid; grid-template-columns: 280px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.spec-table .sr:first-of-type { border-top: 0; }
.spec-table .sr .k { color: var(--ink-3); }
.spec-table .sr .v { color: var(--ink); font-weight: 500; }

/* reviews tab */
.rev-summary { display: grid; grid-template-columns: 220px 1fr; gap: 40px; margin-bottom: 34px; align-items: center; }
.rev-score { text-align: center; }
.rev-score .big { font-family: var(--font-display); font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.rev-score .stars { display: inline-flex; gap: 2px; margin: 10px 0 6px; }
.rev-score .stars svg { width: 17px; height: 17px; }
.rev-score .total { font-size: 13px; color: var(--ink-3); }
.rev-bars { display: flex; flex-direction: column; gap: 8px; }
.rev-bar { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.rev-bar .lbl { width: 12px; color: var(--ink-3); }
.rev-bar .bar { flex: 1; height: 7px; border-radius: 7px; background: var(--line); overflow: hidden; }
.rev-bar .bar i { display: block; height: 100%; background: var(--yellow); border-radius: 7px; }
.rev-bar .pct { width: 36px; text-align: right; color: var(--ink-3); }

/* sticky add-to-cart bar (mobile) */
.pdp-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 350; background: var(--surface); box-shadow: 0 -1px 0 var(--line), 0 -10px 30px -18px rgba(0,0,0,.3); padding: 12px 0; transform: translateY(120%); transition: transform .3s var(--ease); }
.pdp-sticky.show { transform: translateY(0); }
.pdp-sticky .container { display: flex; align-items: center; gap: 16px; }
.pdp-sticky .ps-name { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdp-sticky .ps-price { font-size: 18px; font-weight: 800; white-space: nowrap; }
.pdp-sticky .btn { flex-shrink: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .catalog .container { grid-template-columns: 1fr; }
  .filters { display: none; position: fixed; inset: 0; z-index: 600; top: 0; background: var(--surface); padding: 24px; overflow-y: auto; box-shadow: var(--shadow-3); }
  .filters.open { display: block; }
  .f-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
  .f-close svg { width: 18px; height: 18px; }
  .filter-mob { display: inline-flex; }
  #catGrid { grid-template-columns: repeat(2, 1fr); }
  .pdp .container { grid-template-columns: 1fr; gap: 28px; }
  .gallery { position: static; }
  .pdp-tabs { margin-top: 40px; }
  .acc-box { position: static; }
  #accList { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
}
@media (max-width: 560px) {
  .cat-toolbar { gap: 12px; }
  .cat-toolbar .applied { order: 2; width: 100%; }
  .tb-right { width: 100%; margin-left: 0; }
  .sort-wrap { flex: 1; }
  .sort-btn { width: 100%; justify-content: space-between; }
  .sort-btn .lbl-pre { display: none; }
}
@media (max-width: 680px) {
  #catGrid, #catGrid.list { grid-template-columns: 1fr 1fr; }
  #catGrid.list .product { flex-direction: column; }
  #catGrid.list .prod-media { width: auto; aspect-ratio: 1; }
  .seo-cols { grid-template-columns: 1fr; gap: 0; }
  .rev-summary { grid-template-columns: 1fr; gap: 20px; }
  .pdp-perks { grid-template-columns: 1fr; }
  .gal-thumbs { grid-template-columns: repeat(4, 1fr); }
  .pdp-sticky { display: block; }
  #accList { grid-template-columns: 1fr; }
  .spec-table .sr { grid-template-columns: 1fr; gap: 2px; }
  .spec-table .sr .v { text-align: left; min-width: 0; overflow-wrap: anywhere; }
}
