/* Utility Classes */
.hidden {
    display: none !important;
}

/* Catalog Layout */
.catalog-page {
    background-color: #fff;
    padding: 40px 0;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
}

/* Filters Sidebar */
.filters-sidebar {
    background-color: #fff;
}

.filter-chip span {
    font-size: 13px;
}

/* Filter Search Styling */
.filter-search-container {
    position: relative;
    margin-bottom: 15px;
    padding: 0 5px;
}

.filter-search-input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.filter-search-input:focus {
    border-color: #ff6b00;
}

.filter-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 12px;
}

/* Container Fix */
.container-catalog {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.models-list-container {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for models list */
.models-list-container::-webkit-scrollbar {
    width: 4px;
}

.models-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.models-list-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.models-list-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.filters-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #000;
}

.filter-group {
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 0;
}

.filter-accordion {
    width: 100%;
    background: none;
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.filter-accordion:hover {
    color: #ff6b00;
}

.filter-accordion i {
    font-size: 12px;
    color: #999;
    transition: transform 0.3s;
}

.filter-accordion.active i {
    transform: rotate(180deg);
    color: #ff6b00;
}

.filter-content {
    max-height: 0;
    overflow-y: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s;
    padding-top: 0;
}

.filter-content.show {
    max-height: 300px;
    padding-top: 10px;
    overflow-y: auto;
    /* Custom Scrollbar for Firefox */
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
}

/* Custom Scrollbar for Webkit (Chrome, Safari, Edge) */
.filter-content::-webkit-scrollbar {
    width: 6px;
}

.filter-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover {
    background: #ff6b00;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    transition: color 0.2s;
}

.filter-checkbox:hover {
    color: #ff6b00;
}

/* Product count in filters */
.filter-count {
    color: #999;
    font-size: 12px;
    font-weight: 400;
}

.filter-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.filter-checkbox input[type="checkbox"]:checked {
    background-color: #ff6b00;
    border-color: #ff6b00;
}

.filter-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

.filter-checkbox input[type="checkbox"]:hover {
    border-color: #ff6b00;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-separator {
    color: #999;
    font-weight: 500;
}

.price-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

.price-input:focus {
    outline: none;
    border-color: #ff6b00;
}

/* Products Section */
.products-section {
    min-height: 500px;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.products-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.2;
}

.products-count {
    font-size: 14px;
    color: #666;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: #ff6b00;
}

/* Active Filters */
.active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.filter-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ff6b00;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.filter-chip .remove-filter {
    color: white;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter-chip .remove-filter:hover {
    opacity: 1;
}

.clear-all-filters {
    color: #ff6b00;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    transition: color 0.2s;
}

.clear-all-filters:hover {
    color: #e55e00;
    text-decoration: underline;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    transition: box-shadow 0.3s;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.no-image {
    font-size: 48px;
    color: #ccc;
}

.product-info {
    text-align: left;
}

.product-brand {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin-bottom: 10px;
    min-height: 40px;
}

.product-price {
    margin-bottom: 10px;
}

.price-old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

.price-current {
    font-size: 20px;
    font-weight: 700;
    color: #ff0000;
}

.product-stock {
    margin-bottom: 15px;
}

.stock-status {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stock-status.in-stock {
    color: #00b500;
}

.stock-status.in-stock i {
    color: #00b500;
}

.stock-status.low-stock {
    color: #ff8800;
}

.stock-status.low-stock i {
    color: #ff8800;
}

.stock-status.out-stock {
    color: #ff0000;
}

.stock-status.out-stock i {
    color: #ff0000;
}

.btn-choose {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #ff6b00;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-choose:hover {
    background-color: #e55e00;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    margin-top: 40px;
}

.page-link {
    color: #0052CC;
    text-decoration: none;
    font-weight: 500;
}

.page-link:hover {
    color: #ff6b00;
}

.page-current {
    background-color: #ff6b00;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 600;
}

.page-number {
    color: #333;
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.page-number:hover {
    background-color: #f5f5f5;
    color: #ff6b00;
}

/* Filter Buttons */
.btn-apply-filters {
    width: 100%;
    padding: 12px;
    background-color: #ff6b00;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.btn-apply-filters:hover {
    background-color: #e55e00;
}

.btn-reset-filters {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    margin-top: 10px;
    transition: all 0.3s;
}

.btn-reset-filters:hover {
    background-color: #f5f5f5;
    color: #333;
}

.no-products {
    text-align: center;
    padding: 60px 0;
    color: #999;
    font-size: 16px;
}

/* Hide mobile-specific elements on desktop */
.mobile-filters-toggle,
.mobile-filters-header,
.mobile-filters-backdrop {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .catalog-page {
        padding: 30px 0;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .filters-sidebar {
        order: 2;
        background: #f9f9f9;
        padding: 20px;
        border-radius: 12px;
        margin-top: 20px;
    }

    .products-section {
        order: 1;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .product-card {
        padding: 15px;
    }

    .product-image {
        height: 160px;
    }

    .breadcrumbs {
        padding: 12px 0;
        font-size: 13px;
    }

    .products-header h1 {
        font-size: 28px;
    }

    .sort-container {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .catalog-page {
        padding: 20px 0;
    }

    .container-catalog {
        padding: 0 12px;
    }

    .breadcrumbs {
        padding: 10px 0;
        font-size: 12px;
    }

    .catalog-layout {
        gap: 20px;
    }

    /* Hide sidebar by default on mobile - show with toggle button */
    .filters-sidebar {
        display: none;
    }

    /* Show filters as drawer/modal when opened */
    /* Show filters as drawer/modal when opened */
    .filters-sidebar.mobile-open {
        display: block;
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        height: 85vh;
        z-index: 1000;
        background: #fff;
        padding: 20px 20px 80px 20px; /* Extra bottom padding for safe area */
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideInUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    /* Mobile filter toggle button */
    .mobile-filters-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 12px 20px;
        background-color: #ff6b00;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 20px;
        transition: background-color 0.3s;
    }

    .mobile-filters-toggle:hover {
        background-color: #e55e00;
    }

    .mobile-filters-toggle i {
        font-size: 16px;
    }

    /* Mobile filter header with close button */
    .mobile-filters-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 2px solid #e5e5e5;
    }

    .mobile-filters-header h3 {
        font-size: 18px;
        font-weight: 700;
        margin: 0;
    }

    .mobile-filters-close {
        background: none;
        border: none;
        font-size: 24px;
        color: #666;
        cursor: pointer;
        padding: 5px;
        line-height: 1;
    }

    /* Backdrop overlay */
    .mobile-filters-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .mobile-filters-backdrop.active {
        display: block;
    }

    /* Show mobile filter button on mobile */
    .mobile-filters-toggle {
        display: flex;
    }

    /* Hide desktop filters title on mobile (we use mobile header instead) */
    .filters-sidebar .filters-title {
        display: none;
    }

    .filters-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .filter-group {
        padding: 0;
        border-bottom: 1px solid #eee;
    }

    .filter-accordion {
        font-size: 14px;
        padding: 10px 0;
        line-height: 1.4;
        min-height: 40px;
    }

    .filter-content.show {
        padding-top: 4px;
        padding-bottom: 10px;
        max-height: 2000px; /* Allow full expansion on mobile */
    }

    .filter-checkbox {
        font-size: 14px;
        margin-bottom: 0;
        gap: 10px;
        padding: 6px 0;
        line-height: 1.4;
        min-height: 32px;
        display: flex;
        align-items: center;
    }

    .filter-checkbox input[type="checkbox"] {
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        min-height: 20px !important;
        flex-shrink: 0;
        border-radius: 4px;
        margin-top: 0;
    } 
    
    .filter-count {
        font-size: 12px;
    }

    .price-input {
        padding: 8px 10px;
        font-size: 13px;
    }

    .btn-apply-filters,
    .btn-reset-filters {
        font-size: 13px;
        padding: 10px;
    }

    /* Products */
    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 20px;
    }

    .products-header h1 {
        font-size: 24px;
        margin-bottom: 5px;
    }

    .products-count {
        font-size: 13px;
    }

    .sort-container {
        width: 100%;
        font-size: 13px;
    }

    .sort-select {
        flex: 1;
        padding: 8px 10px;
        font-size: 13px;
    }

    /* Single column on mobile */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .product-card {
        padding: 12px;
        border-radius: 12px;
    }

    .product-image {
        height: 200px;
        margin-bottom: 12px;
    }

    .product-brand {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .product-title {
        font-size: 15px;
        min-height: auto;
        margin-bottom: 8px;
    }

    .price-old {
        font-size: 13px;
    }

    .price-current {
        font-size: 18px;
    }

    .stock-status {
        font-size: 12px;
    }

    .btn-choose {
        padding: 10px;
        font-size: 13px;
    }

    /* Active filters */
    .active-filters {
        padding: 10px;
        gap: 8px;
        margin-bottom: 15px;
    }

    .filter-label {
        font-size: 13px;
    }

    .filter-chip {
        font-size: 12px;
        padding: 5px 10px;
    }

    .clear-all-filters {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* Pagination */
    .pagination-container {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-link,
    .pagination-current {
        font-size: 13px;
        padding: 6px 10px;
        min-width: 36px;
    }

    .pagination-nav {
        padding: 6px 10px;
    }

    /* No products message */
    .no-products {
        font-size: 14px;
        padding: 40px 0;
    }
}

/* Large Screens (2K) */
@media (min-width: 1921px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
    }

    .container-catalog {
        max-width: 1400px;
    }
}