/* ===== КАТАЛОГ, ФИЛЬТРЫ, КАРТОЧКИ ===== */
.main-layout {
    display: flex;
    gap: 32px;
    margin-bottom: 48px;
}

.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid #eef2f8;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-group {
    margin-bottom: 28px;
}

.filter-group h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f2b3d;
}

.brand-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.brand-checkboxes label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    cursor: pointer;
}

.series-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.series-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.price-range,
.area-range,
.btu-range {
    display: flex;
    gap: 12px;
    align-items: center;
}

.price-range input,
.area-range input,
.btu-range input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dce3ec;
    border-radius: 14px;
    font-size: 0.85rem;
    background: #fff;
}

.type-checkboxes {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.type-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.reset-filters {
    background: #f1f5f9;
    border: none;
    padding: 10px 0;
    width: 100%;
    border-radius: 40px;
    font-weight: 500;
    color: #1e4a6e;
    cursor: pointer;
    margin-top: 8px;
}

.reset-filters:hover {
    background: #e2e8f0;
}

.stock-filter {
    margin-bottom: 20px;
}

.stock-filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.catalog-header-static {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
    background: transparent;
}

.search-box {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 200px;
    background: white;
    border: 1px solid #dce3ec;
    border-radius: 40px;
    padding: 6px 16px;
}

.search-box i {
    color: #8ba0bc;
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    background: transparent;
}

.sort-select {
    padding: 8px 16px;
    border-radius: 40px;
    border: 1px solid #dce3ec;
    background: white;
    font-weight: 500;
    cursor: pointer;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    flex: 1;
}

.product-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid #eef2f8;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -12px rgba(0, 0, 0, 0.1);
    border-color: #cbdde9;
}

.product-img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
}

.card-content {
    padding: 18px;
    flex: 1;
}

.product-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-brand {
    color: #5b6e8c;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-series {
    font-size: 0.8rem;
    color: #2c7da0;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-weight: 700;
    font-size: 1.3rem;
    color: #1f5e3a;
    margin: 10px 0 6px;
}

.product-area {
    font-size: 0.8rem;
    background: #f0f4fa;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    color: #2c3e66;
    margin-right: 8px;
}

/* ===== КАЛЬКУЛЯТОР ===== */
.calculator-section {
    background: white;
    border-radius: 28px;
    padding: 28px 32px;
    margin: 40px 0 48px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid #eef2f8;
}

.calc-form {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 20px 0;
    align-items: flex-end;
}

.calc-field {
    flex: 1;
    min-width: 130px;
}

.calc-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.calc-field input,
.calc-field select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid #dce3ec;
    background: #fff;
}

.calc-btn {
    background: #1e4a6e;
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
}

.calc-result {
    background: #eef2fc;
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
}

.recommendations-container {
    margin-top: 16px;
}

.matching-models {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 4px 12px 4px;
}

.match-badge {
    background: white;
    padding: 6px 16px;
    border-radius: 40px;
    border: 1px solid #cbdde9;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.match-badge:hover {
    background: #eef2fa;
    border-color: #1e4a6e;
}

.load-more-btn {
    background: #f0f4fa;
    border: 1px solid #cbdde9;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e4a6e;
    cursor: pointer;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.load-more-btn:hover {
    background: #e2e8f0;
}

.load-more-btn.hidden {
    display: none;
}

/* ===== МОБИЛЬНЫЕ ФИЛЬТРЫ И МОДАЛЬНОЕ ОКНО ===== */
.mobile-filters-toggle {
    display: none;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 60px;
    font-weight: 500;
    margin-bottom: 20px;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.mobile-filter-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #dce3ec;
    border-radius: 40px;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    touch-action: manipulation;
}

.mobile-filter-btn i {
    color: #2c7da0;
    touch-action: manipulation;
}

.mobile-filter-btn:hover {
    background: #f8fafd;
    touch-action: manipulation;
}

.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    touch-action: manipulation;
}

.filter-modal.active {
    display: block;
}

.filter-modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.filter-modal-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 90vh;
    background: white;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eef2f8;
}

.filter-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f2b3d;
}

.filter-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #5b6e8c;
    padding: 0 8px;
}

.filter-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.filter-modal-body .filters-sidebar {
    display: block !important;
    width: 100%;
    position: static;
    max-height: none;
    overflow-y: visible;
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
}

.filter-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #eef2f8;
}

.filter-modal-sort {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eef2f8;
}
.filter-modal-sort label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #0f2b3d;
}
.modal-sort-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #dce3ec;
    border-radius: 16px;
    font-size: 1rem;
    background: white;
}

.apply-filters-btn {
    width: 100%;
    padding: 16px;
    background: #1e4a6e;
    color: white;
    border: none;
    border-radius: 60px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.apply-filters-btn:hover {
    background: #0f3a56;
}

button,
.product-card {
    cursor: pointer;
}

/* ===== АДАПТАЦИЯ КАТАЛОГА, КАРТОЧЕК, ФИЛЬТРОВ, КАЛЬКУЛЯТОРА (≤768px) ===== */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        gap: 16px;
    }

    .filters-sidebar {
        width: 100%;
        position: static;
        display: none;
        margin-bottom: 20px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .filters-sidebar.open {
        display: block;
    }

    .mobile-filters-toggle {
        display: flex;
    }

    .catalog-header-static {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-box {
        width: 100%;
    }

    .sort-select {
        width: 100%;
        text-align: center;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-img {
        height: 160px;
    }

    .card-content {
        padding: 14px;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .calc-link {
        margin-top: 8px;
    }

    .calc-form {
        flex-direction: column;
        align-items: stretch;
    }

    .calc-field {
        width: 100%;
    }

    .calc-btn {
        width: 100%;
        margin-top: 8px;
    }

    .brand-checkboxes label,
    .series-checkboxes label {
        padding: 8px 0;
    }

    .price-range input,
    .area-range input,
    .btu-range input {
        font-size: 1rem;
        padding: 10px 12px;
    }

    .reset-filters {
        padding: 12px 0;
        font-size: 1rem;
    }

    .filters-sidebar {
        display: none !important;
    }

    .mobile-filter-btn {
        display: flex;
    }

    .mobile-filters-toggle {
        display: none !important;
    }

    .catalog-header-static {
        flex-wrap: wrap;
        gap: 12px;
    }

    .catalog-header-static .search-box {
        flex: 1 1 100%;
        order: 1;
    }

    .catalog-header-static .mobile-filter-btn {
        order: 2;
        flex: 0 0 auto;
    }

    .catalog-header-static .sort-select {
        display: none !important;
    }
}