/* ==========================================================================
   Каталог в раскладке макета (front.tpl-catalog): главная и страницы каталога.
   Базовые элементы (.card, .cats, .check, .seg, .range, .sel, .panelw)
   приходят из spa-tpl.css; здесь — сетка страницы и защита от старых слоёв
   темы, которые красят select/range с !important.
   ========================================================================== */

.tplc { padding: 18px 0 10px; color: var(--mist); }
.tplc h1, .tplc h2 { color: var(--mist); font-weight: 900; margin: 0; }
.tplc a { text-decoration: none; }

/* ---------- Полоса видов массажа ---------- */
.tplc .cats { margin-bottom: 22px; }
.tplc .cat { color: var(--mist); text-align: center; line-height: 1.2; }
.tplc .cat:hover { color: #fff; }
.tplc .cat[aria-pressed="true"] { color: var(--ink); }

/* ---------- Раскладка ---------- */
.tplc .layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.tplc .layout > * { min-width: 0; }

/* ---------- Фильтры ---------- */
.tplc .filters { position: sticky; top: 96px; padding: 22px; display: flex; flex-direction: column; gap: 18px;
    max-height: calc(100vh - 116px); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.tplc .filters form { display: flex; flex-direction: column; gap: 18px; }
.tplc .f-head { display: flex; justify-content: space-between; align-items: center; }
.tplc .f-head h2 { font-size: 22px; }
.tplc .f-head-actions { display: flex; align-items: center; gap: 6px; }
.tplc .f-head a { color: var(--gold); font-size: 14px; font-weight: 800; }
.tplc .f-head a:hover { color: #fff; }
.tplc .f-close { display: none; }
.tplc .f-group { display: flex; flex-direction: column; gap: 6px; }
.tplc .f-group .flabel { margin-bottom: 2px; color: var(--mist); font-size: 15px; font-weight: 900; }
.tplc .check { color: var(--mist); margin: 0; }
.tplc .check-ic { width: 20px; height: 20px; object-fit: contain; margin-right: -3px; }
.tplc .seg { display: flex; width: 100%; }
.tplc .seg button { flex: 1; padding: 0 8px; }
.tplc .f-apply { margin-top: 2px; }
.tplc .f-apply .btn { height: 52px; font-size: 17px; }

.tplc .f-promo { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md);
    background: linear-gradient(180deg, rgba(168, 255, 59, .16), rgba(168, 255, 59, .06)); border: 1px solid var(--line-2); color: var(--mist); }
.tplc .f-promo img { width: 48px; flex-shrink: 0; }
.tplc .f-promo p { margin: 0; flex: 1; }
.tplc .f-promo b { display: block; font-weight: 900; color: var(--gold); }
.tplc .f-promo span { font-size: 13px; color: var(--dim); font-weight: 600; }
.tplc .f-promo-arrow { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; }

/* Город с иконкой-булавкой */
.tplc .sel-pin { position: relative; }
.tplc .sel-pin img { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); pointer-events: none; z-index: 1; }
.tplc .sel-pin .sel { padding-left: 44px !important; }

/* Старые слои (spa-light.css) красят любой select в белый с !important */
body.spa-theme .tplc select.sel {
    height: 48px;
    width: 100%;
    border-radius: 14px !important;
    border: 1.5px solid var(--line-2) !important;
    background-color: rgba(0, 0, 0, .25) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FFC65C' stroke-width='2' fill='none'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    color: var(--mist) !important;
    padding: 0 40px 0 16px;
    font-weight: 700;
    box-shadow: none;
}
body.spa-theme .tplc select.sel option { color: #0B0F14; background: #fff; }

/* Ползунок цены: убираем оформление range из style.css */
.tplc .range input { margin: 0; }
.tplc .range input::-webkit-slider-runnable-track { height: 30px; background: transparent !important; border: 0 !important; box-shadow: none !important; }
.tplc .range input::-webkit-slider-thumb { position: static !important; bottom: auto !important; margin-top: 3px;
    background: radial-gradient(circle at 35% 30%, #F8FAFC, #A8FF3B 55%, #8FE01F) !important; border: 2px solid #fff !important; }
.tplc .range input::-moz-range-track { background: transparent !important; border: 0 !important; }
.tplc .range input::-moz-range-thumb { background: #A8FF3B !important; border: 2px solid #fff !important; }
.tplc .range-vals span { color: var(--dim); }

/* ---------- Шапка результатов ---------- */
.tplc .res-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.tplc .res-head h1 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.15; }
.tplc .res-head h1 span, .tplc .res-count span { color: var(--gold); }
.tplc .res-count { margin: 6px 0 0; color: var(--dim); font-weight: 700; }
.tplc .tools { display: flex; gap: 10px; align-items: center; }
.tplc .sort-pick { display: flex; align-items: center; gap: 10px; margin: 0; }
.tplc .sort-label { color: var(--dim); font-weight: 700; white-space: nowrap; }
body.spa-theme .tplc .tools select.sel { height: 44px; width: auto; border-radius: 999px !important; padding-right: 44px; }
.tplc .view { display: inline-flex; border: 1.5px solid var(--line-2); border-radius: 999px; padding: 3px; background: rgba(0, 0, 0, .25); }
.tplc .view button { width: 40px; height: 36px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--dim); }
.tplc .view button[aria-pressed="true"] { background: var(--goldg); color: #0B0F14; box-shadow: var(--gloss); }
.tplc .view svg { width: 16px; height: 16px; }
.tplc .fbtn { display: none; }

/* ---------- Сетка карточек ---------- */
.tplc .grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.tplc .grid.list { grid-template-columns: 1fr; }
.tplc .card { margin: 0; }
.tplc .card a { color: inherit; }
.tplc .card-name a:hover { color: #3F7A00; }
.tplc .card-meta { line-height: 1.35; }
.tplc .card .about { margin: 0; }
.tplc .tier { height: 32px; }
.tplc .price--ask { font-size: 16px; color: var(--ink-2); }
.tplc .card-foot .btn { gap: 4px; }

/* ---------- Страницы ---------- */
.tplc .pager { display: flex; justify-content: center; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.tplc .pager a, .tplc .pager span { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; display: inline-grid; place-items: center;
    border: 1.5px solid var(--line-2); background: rgba(0, 0, 0, .25); color: var(--mist); font-weight: 800; }
.tplc .pager a:hover { border-color: var(--gold); color: var(--gold); }
.tplc .pager [aria-current] { background: var(--goldg); color: #0B0F14; border: 0; box-shadow: var(--gloss); }
.tplc .pager .gap { border: 0; background: none; min-width: 20px; }

/* ---------- Пусто ---------- */
.tplc .empty { text-align: center; padding: 50px 20px; }
.tplc .empty img { width: 150px; margin: 0 auto 10px; }
.tplc .empty h2 { font-size: 28px; margin-bottom: 6px; }
.tplc .empty p { color: var(--dim); margin-bottom: 22px; font-weight: 600; }

/* ---------- Планшеты и телефоны ---------- */
@media (max-width: 991px) {
    .tplc .layout { grid-template-columns: 1fr; }
    .tplc .filters { position: fixed; inset: auto 0 0 0; top: auto; z-index: 1050; max-height: 88vh; border-radius: 28px 28px 0 0;
        transform: translateY(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -30px 80px rgba(0, 0, 0, .7);
        background: linear-gradient(180deg, #0B0F14, #0B0F14); }
    .tplc .filters.open { transform: none; }
    .tplc .f-close { display: inline-grid; }
    .tplc .fbtn { display: inline-flex; }
    .tplc .f-apply { position: sticky; bottom: -22px; margin: 0 -22px -22px; padding: 16px 22px; background: #0B0F14; border-top: 1px solid var(--line); }
    .tplc .f-promo { display: none; }
}
@media (max-width: 600px) {
    .tplc .tools { width: 100%; }
    .tplc .sort-pick { flex: 1; min-width: 0; }
    .tplc .sort-label { display: none; }
    body.spa-theme .tplc .tools select.sel { width: 100%; }
    /* На телефоне — одна колонка крупных карточек, как в макете */
    .tplc .grid, .tplc .grid.list { grid-template-columns: 1fr; gap: 14px; }
    .tplc .grid.list .card { flex-direction: column; }
    .tplc .grid.list .pic { width: 100%; aspect-ratio: 5 / 4; }
    .tplc .view { display: none; }
    .tplc .cats { margin-left: -4px; margin-right: -4px; }
    .tplc .cat { min-width: 84px; padding: 10px 8px 8px; font-size: 13px; }
    .tplc .cat img { width: 36px; height: 36px; }
    .tplc .filters { max-height: 100vh; height: 100%; border-radius: 0; }
}
