/* Catalog Page Styles */

.catalog-page {
    padding: 40px 0 80px;
    background: var(--bg-light);
    min-height: calc(100vh - 70px);
}

.catalog-header {
    text-align: center;
    margin-bottom: 40px;
}

.catalog-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.catalog-subtitle {
    font-size: 18px;
    color: var(--text-light);
}

/* Catalog Layout */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    max-height: calc(100vh - 240px);
    align-content: start;
}

/* Filters Sidebar */
.filters-sidebar {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.filters-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.filters-reset {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s;
}

.filters-reset:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.filter-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    min-width: 0;
}

.filter-option:hover {
    background: var(--bg-light);
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.filter-option label {
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-option .count {
    font-size: 12px;
    color: var(--text-light);
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.filter-hint {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
    padding: 8px;
}

/* Range Filter */
.range-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.range-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.range-inputs .range-separator {
    display: none;
}

.range-inputs input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    transition: border-color 0.3s;
    pointer-events: auto;
}

.range-inputs input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.range-separator {
    color: var(--text-light);
    font-size: 14px;
}

.filter-range {
    display: none;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    appearance: none;
    outline: none;
}

.filter-range::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 125, 227, 0.3);
    transition: transform 0.2s;
}

.filter-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

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

/* Products Section */
.products-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 260px);
    padding-right: 8px;
    scrollbar-width: thin;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.products-count {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.products-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.3s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-category {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.product-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.no-results svg {
    color: var(--text-light);
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.no-results p {
    font-size: 14px;
    color: var(--text-light);
}

/* Product Modal */
.product-modal-content {
    max-width: 700px;
    padding: 0;
    overflow: hidden;
}

.product-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.product-modal-image {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 300px;
}

.product-modal-image img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.product-modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.product-modal-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.product-modal-category {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.product-modal-specs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
}

.product-modal-specs .spec-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.product-modal-specs .spec-value {
    font-size: 16px;
    color: var(--primary-color);
}

#modalOrderBtn {
    margin-top: auto;
    width: 100%;
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    align-items: center;
    gap: 8px;
}

.mobile-filter-toggle svg {
    width: 18px;
    height: 18px;
}

/* Responsive */
@media (max-width: 1100px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        height: 100vh;
        z-index: 1001;
        border-radius: 0;
        overflow-y: auto;
        transition: left 0.3s ease;
    }

    .filters-sidebar.active {
        left: 0;
    }

    .filters-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .filters-overlay.active {
        display: block;
    }

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

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .product-modal-body {
        grid-template-columns: 1fr;
    }

    .product-modal-image {
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .catalog-title {
        font-size: 32px;
    }

    .products-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-modal-info {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .catalog-page {
        padding: 20px 0 60px;
    }

    .catalog-title {
        font-size: 28px;
    }

    .filters-sidebar {
        width: 280px;
    }
}
