/* ═══════════════════════════════════════════════════════
   CATALOG — страница категории / каталога:
   шапка, лейаут, сайдбар фильтров, тулбар, сетка, пагинация
   ═══════════════════════════════════════════════════════ */

/* ─── ШАПКА СТРАНИЦЫ КАТЕГОРИИ ─── */
.cat-page-header {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 16px 0 12px;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}
.cat-page-header .container { position: relative; z-index: 1; }
.cat-page-header .cat-page-title { margin-bottom: 6px; }
.cat-page-header::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 50%;
    background-image: url('/static/img/catalog-header.webp');
    background-size: cover;
    background-position: center;
    mask-image: linear-gradient(to right, transparent 0%, black 50%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 50%);
    pointer-events: none;
}
.cat-page-title {
    font-size: 24px;
    font-weight: 900;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

/* ─── ДВУХКОЛОНОЧНЫЙ ЛЕЙАУТ ─── */
.cat-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    padding: 24px 0 40px;
    align-items: start;
}

/* ─── САЙДБАР ФИЛЬТРОВ ─── */
.cat-sidebar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #eee;
    position: sticky;
    top: 16px;
}

.filter-block {
    padding-bottom: 6px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.filter-block:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.filter-block-title {
    font-size: 12px;
    font-weight: 700;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

/* Скелетоны — заглушки до загрузки фильтров */
.filter-stub-range {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.filter-stub-range span { color: #ccc; font-size: 12px; }
.filter-stub-input {
    flex: 1; height: 32px;
    background: #f4f4f4; border-radius: 6px; border: 1px solid #eee;
}
.filter-stub-slider {
    height: 4px;
    background: linear-gradient(to right, #f25e5e 0%, #f25e5e 40%, #eee 40%);
    border-radius: 2px; opacity: 0.35;
}
.filter-stub-check {
    height: 14px; background: #f0f0f0; border-radius: 4px;
    margin-bottom: 8px; width: 85%; opacity: 0.6;
}
.filter-stub-check.short { width: 55%; }
.filter-apply-stub {
    margin-top: 18px; padding: 10px;
    background: #f4f4f4; border-radius: 8px;
    text-align: center; font-size: 13px; font-weight: 700;
    color: #ccc; cursor: not-allowed; border: 1px dashed #e0e0e0;
}

/* ─── СТРОКА ЧЕКБОКСА ─── */
.filter-check-row {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 4px;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s;
}
.filter-check-row:hover { background: #fff5f0; }
.filter-check-row.active { background: #fff0ee; }

.filter-checkbox {
    width: 16px; height: 16px;
    border: 2px solid #ddd; border-radius: 4px;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}
.filter-checkbox.checked {
    border-color: #f25e5e; background: #f25e5e;
}
.filter-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 3px; top: 1px;
    width: 6px; height: 9px;
    border: 2px solid white;
    border-top: none; border-left: none;
    transform: rotate(45deg);
}
.filter-check-label { font-size: 13px; color: #444; line-height: 1.3; }
.filter-check-row.active .filter-check-label { color: #f25e5e; font-weight: 600; }

/* ─── ПРОИЗВОДИТЕЛИ — развернуть / свернуть ─── */
.filter-mfr-hidden { display: none; }
.filter-mfr-more {
    margin-top: 6px;
    background: none; border: none;
    color: #f25e5e; font-size: 13px; font-weight: 600;
    cursor: pointer; padding: 4px 0; transition: color 0.15s;
}
.filter-mfr-more:hover { color: #d11313; }
.filter-mfr-empty { font-size: 12px; color: #bbb; padding: 6px 4px; font-style: italic; }

#mfrFilterBlock { min-height: 20px; transition: opacity 0.15s; }
#mfrFilterBlock.loading { opacity: 0.4; pointer-events: none; }

/* ─── ЦЕНОВОЙ ФИЛЬТР ─── */
.price-filter-inputs {
    display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
}
.price-filter-input {
    width: 0; flex: 1;
    padding: 6px 8px;
    border: 1px solid #e0e0e0; border-radius: 6px;
    font-size: 13px; color: #333; text-align: center;
    -moz-appearance: textfield;
}
.price-filter-input::-webkit-outer-spin-button,
.price-filter-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.price-filter-input:focus { outline: none; border-color: #f25e5e; }
.price-filter-dash { color: #aaa; font-size: 13px; flex-shrink: 0; }

/* Двойной range-слайдер */
.price-slider-wrap { position: relative; height: 20px; margin-bottom: 5px; }
.price-slider-track {
    position: absolute; top: 50%; transform: translateY(-50%);
    left: 0; right: 0; height: 4px;
    background: #e8e8e8; border-radius: 2px;
}
.price-slider-range {
    position: absolute; height: 100%;
    background: #f25e5e; border-radius: 2px;
}
.price-range-input {
    position: absolute; top: 50%; transform: translateY(-50%);
    left: 0; right: 0; width: 100%; height: 4px;
    background: transparent; appearance: none; pointer-events: none;
}
.price-range-input::-webkit-slider-thumb {
    appearance: none; pointer-events: all;
    width: 16px; height: 16px; border-radius: 50%;
    background: white; border: 2px solid #f25e5e;
    cursor: pointer; box-shadow: 0 1px 4px rgba(242,94,94,0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}
.price-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15); box-shadow: 0 2px 8px rgba(242,94,94,0.4);
}
.price-range-input::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: white; border: 2px solid #f25e5e;
    cursor: pointer; box-shadow: 0 1px 4px rgba(242,94,94,0.3);
}
.price-filter-apply {
    width: 100%; padding: 8px;
    background: #f25e5e; color: white; border: none;
    border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.price-filter-apply:hover  { background: #d11313; }
.price-filter-apply:active { transform: scale(0.97); }

/* ─── DEFERRED ФИЛЬТРЫ ─── */
.filter-input-hidden {
    position: absolute; width: 1px; height: 1px;
    opacity: 0; pointer-events: none;
}
.filter-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px;}

.filter-reset-link {
    display: block; text-align: center;
    padding: 7px;
    background: transparent; border: 1px solid #e0e0e0;
    border-radius: 8px; font-size: 12px; font-weight: 600;
    color: #aaa; text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.filter-reset-link:hover {
    border-color: #f25e5e; color: #f25e5e; background: #fff5f0;
}

.filter-apply-btn {
    width: 100%; padding: 10px;
    background: #f25e5e; color: white; border: none;
    border-radius: 8px; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.filter-apply-btn:hover  { background: #d11313; }
.filter-apply-btn:active { transform: scale(0.97); }
.filter-reset-btn {
    display: block; text-align: center;
    padding: 7px;
    background: transparent; border: 1px solid #e0e0e0;
    border-radius: 8px; font-size: 12px; font-weight: 600;
    color: #aaa; text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.filter-reset-btn:hover {
    border-color: #f25e5e; color: #f25e5e; background: #fff5f0;
}

[data-set-sort], [data-set-perpage] { cursor: pointer; }

/* ─── ПОДКАТЕГОРИИ ─── */
.cat-subcats {
    background: white; border: 1px solid #eee;
    border-radius: 12px; padding: 16px 20px; margin-bottom: 16px;
    display: flex; align-items: flex-start; gap: 14px;
}
.cat-subcats-label {
    font-size: 11px; font-weight: 700; color: #aaa;
    text-transform: uppercase; letter-spacing: 0.8px;
    white-space: nowrap; padding-top: 6px; flex-shrink: 0;
}
.cat-subcats-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-subcat-pill {
    padding: 5px 14px;
    background: #fff5f0; border: 1px solid #ffd4c4;
    border-radius: 20px; font-size: 13px; color: #c0441a;
    text-decoration: none; transition: all 0.15s; white-space: nowrap;
}
.cat-subcat-pill:hover { background: #f25e5e; border-color: #f25e5e; color: white; }

/* ─── ТУЛБАР ─── */
.cat-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    background: white; border: 1px solid #eee; border-radius: 12px;
    padding: 12px 20px; margin-bottom: 16px;
    gap: 16px; flex-wrap: wrap;
}
.cat-toolbar-left,
.cat-toolbar-right { display: flex; align-items: center; gap: 10px; }
.cat-toolbar-label { font-size: 12px; color: #aaa; font-weight: 600; white-space: nowrap; }
.cat-sort-links,
.cat-perpage-links { display: flex; gap: 4px; }
.cat-sort-btn,
.cat-perpage-btn {
    padding: 6px 14px; border-radius: 7px;
    font-size: 13px; font-weight: 600; color: #666;
    text-decoration: none; transition: all 0.15s;
    border: 1px solid transparent;
}
.cat-sort-btn:hover,
.cat-perpage-btn:hover { background: #f8f8f8; border-color: #eee; color: #222; }
.cat-sort-btn.active,
.cat-perpage-btn.active { background: #fff0ee; border-color: #f9c4b8; color: #f25e5e; }

/* ─── СЕТКА ТОВАРОВ ─── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

/* ─── ПАГИНАЦИЯ ─── */
.cat-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; padding: 24px 0;
}
.cat-page-btn {
    padding: 10px 24px; background: white;
    border: 1px solid #eee; border-radius: 8px;
    font-size: 14px; font-weight: 600; color: #444;
    text-decoration: none; transition: all 0.15s;
}
.cat-page-btn:hover { border-color: #f25e5e; color: #f25e5e; background: #fff5f0; }
.cat-page-info { font-size: 13px; color: #aaa; }

/* ─── ПУСТАЯ КАТЕГОРИЯ ─── */
.cat-empty {
    display: flex; flex-direction: column; align-items: center;
    padding: 80px 20px;
    background: white; border-radius: 12px; border: 1px solid #eee;
}
.cat-empty-ico  { font-size: 56px; opacity: 0.15; margin-bottom: 16px; }
.cat-empty-text { font-size: 16px; color: #bbb; font-weight: 600; }

.cat-sort-select,
.cat-perpage-select { display: none; }

/* ─── SEO-ТЕКСТ КАТЕГОРИИ ─── */
.cat-seo-text {
    background: white;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 32px 36px;
    margin: 28px 0 0;
    font-size: 14px;
    line-height: 1.8;
    color: #555;
}
.cat-seo-text h2 {
    font-size: 18px;
    font-weight: 800;
    color: #222;
    margin: 0 0 12px;
    line-height: 1.3;
}
.cat-seo-text h3 {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 20px 0 8px;
    line-height: 1.3;
}
.cat-seo-text p {
    margin: 0 0 14px;
}
.cat-seo-text p:last-child {
    margin-bottom: 0;
}
.cat-seo-text ul,
.cat-seo-text ol {
    margin: 0 0 14px;
    padding-left: 20px;
}
.cat-seo-text li {
    margin-bottom: 6px;
}
.cat-seo-text a {
    color: #f25e5e;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}
.cat-seo-text a:hover {
    color: #d11313;
    text-decoration: underline;
}
.cat-seo-text strong {
    color: #333;
    font-weight: 700;
}