/* ==========================================================================
   Q Clima — shop / category / brand / search listing with filters.
   Desktop ≥1280: sidebar 3 cols + grid 9 cols (3 per row).
   Tablet 768–1279: 2 per row, filters slide out from the left.
   Mobile <768: 2 per row, filters in a bottom sheet with a sticky "Покажи N продукта".
   ========================================================================== */

/* Page head ---------------------------------------------------------------- */
.qc-shop-head { padding-bottom: 24px; }
.qc-shop-head__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.qc-shop-head__count { margin: 0; color: var(--qc-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.qc-shop-head__desc { margin-top: 10px; max-width: 75ch; color: var(--qc-text-2); }
.qc-shop-head__desc p { margin: 0 0 .6em; }
.qc-shop-head__desc p:last-child { margin-bottom: 0; }

/* Quick BTU chips ---------------------------------------------------------- */
.qc-shop-quick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 16px; padding-bottom: 4px; }
.qc-shop-quick__chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--qc-pad) * -1); padding: 2px var(--qc-pad); max-width: calc(100% + var(--qc-pad) * 2); }
.qc-shop-quick__chips::-webkit-scrollbar { display: none; }
.qc-shop-quick__chips .qc-chip { flex: none; height: 40px; font-variant-numeric: tabular-nums; }
.qc-shop-quick__calc { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--qc-text-2); }
.qc-shop-quick__calc .qc-i { color: var(--qc-sky); }
.qc-shop-quick__calc strong { color: var(--qc-sky); text-decoration: underline; text-underline-offset: 3px; }
.qc-shop-quick__calc:hover strong { color: var(--qc-navy); }
@media (min-width: 768px) {
	.qc-shop-quick__chips { margin: 0; padding: 2px 0; max-width: none; }
}

/* Layout ------------------------------------------------------------------- */
.qc-shop { padding-top: 20px; padding-bottom: var(--qc-section); }
.qc-shop__results { min-width: 0; transition: opacity .15s; }
@media (min-width: 1280px) {
	.qc-shop { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: var(--qc-gutter); align-items: start; }
}

/* Loading state */
.qc-shop.is-loading .qc-shop__results { opacity: .5; pointer-events: none; }
.qc-shop.is-loading .qc-filters__body { opacity: .7; }
.qc-shop__results { position: relative; }
.qc-shop.is-loading .qc-shop__results::before { content: ''; position: absolute; top: -10px; left: 0; height: 3px; width: 40%; border-radius: 3px; background: var(--qc-sky); animation: qc-shop-bar 1s ease-in-out infinite; }
@keyframes qc-shop-bar { from { left: 0; width: 10%; } 50% { width: 40%; } to { left: 90%; width: 10%; } }

/* Toolbar ------------------------------------------------------------------ */
.qc-shop__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 16px; }
.qc-shop__filterbtn { position: relative; min-height: 44px; padding: 0 16px; }
.qc-shop__filtern { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--qc-coral); color: #fff; font-size: 12px; line-height: 1; }
.qc-shop__filterbtn:hover .qc-shop__filtern { background: #fff; color: var(--qc-coral); }
.qc-shop__range { margin: 0; color: var(--qc-muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qc-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.qc-sort__label { font-size: 14px; font-weight: 700; color: var(--qc-navy-ink); }
.qc-sort__select { position: relative; display: block; }
.qc-sort__select select { appearance: none; -webkit-appearance: none; min-height: 44px; min-width: 196px; padding: 0 36px 0 14px; text-overflow: ellipsis; border: 1px solid var(--qc-line-strong); border-radius: var(--qc-r); background: #fff; font-size: 14px; font-weight: 600; color: var(--qc-navy-ink); cursor: pointer; }
.qc-sort__select select:focus { outline: 0; border-color: var(--qc-sky); box-shadow: 0 0 0 3px rgba(2, 132, 199, .15); }
.qc-sort__select .qc-i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--qc-navy); }
.qc-js .qc-sort__btn, .qc-js .qc-filters__apply { display: none; }
@media (min-width: 1280px) {
	.qc-shop__filterbtn { display: none; }
}
@media (max-width: 767px) {
	.qc-shop__toolbar { gap: 8px; }
	.qc-shop__filterbtn { flex: 1 1 0; order: 1; }
	.qc-sort { flex: 1 1 0; order: 2; margin: 0; min-width: 0; }
	.qc-sort__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.qc-sort__select { flex: 1; min-width: 0; }
	.qc-sort__select select { width: 100%; min-width: 0; }
	.qc-shop__range { order: 3; width: 100%; font-size: 13px; }
	html:not(.qc-js) .qc-sort { flex-basis: 100%; }
}

/* Active filter chips */
.qc-shop__chips { margin: 0 0 20px; }
.qc-shop__chips ul { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; }
.qc-fchip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px 0 14px; border-radius: var(--qc-r); background: var(--qc-navy); color: #fff; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .15s; }
.qc-fchip:hover, .qc-fchip:focus-visible { background: var(--qc-navy-deep); color: #fff; }
.qc-fchip .qc-i { opacity: .8; }
.qc-fchip:hover .qc-i { opacity: 1; }
.qc-fchip-clear { display: inline-flex; align-items: center; min-height: 36px; padding: 0 6px; font-size: 13.5px; font-weight: 700; color: var(--qc-coral-dark); text-decoration: underline; text-underline-offset: 3px; }
.qc-fchip-clear:hover { color: var(--qc-navy); }

/* Grid --------------------------------------------------------------------- */
/* qc-base.css sets .qc-card__tools { position: relative } after its absolute rule (shared bug, reported); keep the tools in the corner here. */
.qc-shop .qc-card__tools { position: absolute; }
.qc-shop .qc-shop__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1280px) { .qc-shop .qc-shop__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) and (max-width: 1279px) { .qc-shop .qc-shop__grid .qc-card__media { aspect-ratio: 16 / 10; } }

.qc-shop__pager { display: flex; flex-direction: column; align-items: center; gap: 0; margin-top: 32px; }
.qc-shop__more { min-width: min(100%, 320px); }
.qc-shop__more + .qc-shop__pagenav .qc-pages { margin-top: 20px; }
.qc-shop__pagenav .qc-pages { margin-top: 0; }
.qc-pages__gap { border-color: transparent !important; background: transparent !important; min-width: 24px !important; padding: 0 !important; }

/* Empty state */
.qc-shop__empty { padding: 48px 24px; border: 1px dashed var(--qc-line-strong); border-radius: var(--qc-r-lg); background: var(--qc-ice); text-align: center; }
.qc-shop__empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: 50%; background: var(--qc-sky-soft); color: var(--qc-sky); }
.qc-shop__empty h3 { font-size: 24px; margin-bottom: 8px; }
.qc-shop__empty p { max-width: 56ch; margin: 0 auto 24px; color: var(--qc-text-2); }
.qc-shop__empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Filters panel ------------------------------------------------------------ */
.qc-filters__panel { display: flex; flex-direction: column; background: #fff; }
.qc-filters__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qc-filters__title { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.qc-filters__title .qc-i { color: var(--qc-sky); }
.qc-filters__form { display: flex; flex-direction: column; min-height: 0; }
.qc-filters__none { margin: 16px 0; color: var(--qc-muted); font-size: 14px; }
.qc-filters__foot { display: flex; gap: 10px; }
.qc-filters__foot .qc-btn { flex: 1; }
.qc-filters__foot:empty { display: none; }
.qc-filters__backdrop { display: none; }

/* Facets */
.qc-facet { border-bottom: 1px solid var(--qc-line); }
.qc-facet:last-child { border-bottom: 0; }
.qc-facet__title { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 0; list-style: none; cursor: pointer; font: 600 15px/1.25 var(--qc-font-head); letter-spacing: .03em; text-transform: uppercase; color: var(--qc-navy); user-select: none; }
.qc-facet__title::-webkit-details-marker { display: none; }
.qc-facet__title > span:first-child { flex: 1; }
.qc-facet__title:hover { color: var(--qc-sky); }
.qc-facet__badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--qc-sky); color: #fff; font: 700 11px/1 var(--qc-font-body); }
.qc-facet__chev { color: var(--qc-muted); transition: transform .2s; }
.qc-facet[open] > .qc-facet__title .qc-facet__chev { transform: rotate(180deg); }
.qc-facet__body { margin: 0; padding: 0 0 14px; border: 0; min-width: 0; }
.qc-facet__list { display: grid; gap: 0; list-style: none; }
.qc-facet__opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 4px 6px; margin: 0 -6px; width: calc(100% + 12px); border-radius: var(--qc-r-sm); font-size: 14px; color: var(--qc-navy-ink); }
.qc-facet__opt input { margin: 0; }
.qc-facet__opt:hover { background: var(--qc-ice); }
.qc-facet__opt:hover input:not(:checked) { border-color: var(--qc-sky); }
.qc-facet__opt input:focus-visible { outline: 3px solid rgba(2, 132, 199, .45); outline-offset: 2px; }
.qc-facet__label { flex: 1; min-width: 0; }
.qc-facet__opt input:checked ~ .qc-facet__label { font-weight: 700; }
.qc-facet__count { flex: none; min-width: 28px; padding: 1px 6px; border-radius: var(--qc-r-sm); background: var(--qc-subtle); color: var(--qc-muted); font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.qc-facet__opt.is-empty { opacity: .45; }
.qc-facet__more > summary { display: inline-flex; align-items: center; min-height: 36px; list-style: none; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--qc-sky); }
.qc-facet__more > summary::-webkit-details-marker { display: none; }
.qc-facet__more > summary:hover { color: var(--qc-navy); }
.qc-facet__more > .qc-facet__list { margin-bottom: 4px; }
.qc-facet__more[open] .qc-facet__more-show, .qc-facet__more:not([open]) .qc-facet__more-hide { display: none; }

/* Price */
.qc-pricef__inputs { display: flex; align-items: flex-end; gap: 8px; }
.qc-pricef__field { display: grid; gap: 4px; flex: 1; min-width: 0; font-size: 12px; font-weight: 700; color: var(--qc-muted); }
.qc-pricef__field .qc-input { min-height: 44px; padding: 8px 10px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.qc-pricef__field .qc-input::-webkit-outer-spin-button, .qc-pricef__field .qc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qc-pricef__dash { padding-bottom: 12px; color: var(--qc-muted); }
.qc-range { position: relative; height: 32px; margin: 14px 4px 2px; }
.qc-range__track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--qc-line); }
.qc-range__fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--qc-sky); }
.qc-range__in { position: absolute; left: -10px; width: calc(100% + 20px); top: 0; height: 32px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.qc-range__in:focus { outline: 0; }
.qc-range__in::-webkit-slider-runnable-track { background: none; border: 0; height: 32px; }
.qc-range__in::-moz-range-track { background: none; border: 0; }
.qc-range__in::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; margin-top: 5px; border: 2px solid var(--qc-sky); border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .18); cursor: grab; }
.qc-range__in::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border: 2px solid var(--qc-sky); border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .18); cursor: grab; }
.qc-range__in:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(2, 132, 199, .3); }
.qc-range__in:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(2, 132, 199, .3); }

/* Desktop: static sidebar card */
@media (min-width: 1280px) {
	.qc-shop__filters { position: relative; }
	.qc-filters__panel { padding: 20px 22px 8px; border: 1px solid var(--qc-line); border-radius: var(--qc-r-lg); box-shadow: var(--qc-shadow-1); }
	.qc-filters__head { padding-bottom: 8px; border-bottom: 2px solid var(--qc-navy); }
	.qc-filters__close, .qc-filters__show { display: none !important; }
	.qc-filters__foot { padding: 12px 0 12px; border-top: 1px solid var(--qc-line); }
	.qc-js .qc-filters__foot .qc-filters__clear { flex: 1; }
}

/* Tablet + mobile: off-canvas panel */
@media (max-width: 1279px) {
	.qc-shop__filters { position: fixed; inset: 0; z-index: 300; visibility: hidden; pointer-events: none; }
	.qc-shop__filters.is-open, html:not(.qc-js) .qc-shop__filters:target { visibility: visible; pointer-events: auto; }
	.qc-filters__backdrop { display: block; position: absolute; inset: 0; background: rgba(15, 23, 42, .55); opacity: 0; transition: opacity .25s; }
	.qc-shop__filters.is-open .qc-filters__backdrop, html:not(.qc-js) .qc-shop__filters:target .qc-filters__backdrop { opacity: 1; }
	.qc-filters__panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(400px, 88vw); box-shadow: var(--qc-shadow-3); transform: translateX(-100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
	.qc-shop__filters.is-open .qc-filters__panel, html:not(.qc-js) .qc-shop__filters:target .qc-filters__panel { transform: none; }
	.qc-filters__head { flex: none; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--qc-line); }
	.qc-filters__form { flex: 1; }
	.qc-filters__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px; }
	.qc-filters__foot { flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--qc-line); background: #fff; box-shadow: 0 -8px 24px -12px rgba(15, 23, 42, .18); }
	.qc-filters__foot .qc-filters__clear { flex: 0 0 auto; }
	html:not(.qc-js) .qc-filters__show { display: none; }
	.qc-facet__opt { min-height: 44px; }
}
@media (max-width: 767px) {
	.qc-filters__panel { top: auto; left: 0; right: 0; width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: var(--qc-r-lg) var(--qc-r-lg) 0 0; transform: translateY(100%); }
	.qc-filters__head { position: relative; padding-top: 18px; }
	.qc-filters__head::before { content: ''; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--qc-line-strong); }
}
