/* ====================================
   PRODUCTS PAGE - Custom CSS
   ==================================== */

/* Page Header */
.page-header {
    background: url('https://images.pexels.com/photos/3806252/pexels-photo-3806252.jpeg?w=1920&h=400&fit=crop') center/cover no-repeat;
    background-blend-mode: overlay;
    padding: 150px 0 80px;
    margin-top: 76px;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(220, 20, 60, 0.3) 100%);
}

.page-header h1,
.page-header p {
    position: relative;
    z-index: 1;
}

/* Search Box */
.search-box {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.search-box .input-group-text {
    border: none;
    padding: 1rem;
}

.search-box .form-control {
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
}

.search-box .form-control:focus {
    box-shadow: none;
}

/* Filters Sidebar */
.filters-sidebar {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 10px;
}

.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-content {
    padding-left: 0.25rem;
}

.form-check {
    margin-bottom: 0.75rem;
}

.form-check-input {
    cursor: pointer;
    border-width: 2px;
}

.form-check-input:checked {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

.form-check-input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 0.25rem rgba(220, 20, 60, 0.25);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Price Slider */
#priceSlider {
    margin: 1.5rem 0.5rem 1rem;
}

.ui-slider-horizontal {
    height: 6px;
    background: #e0e0e0;
    border: none;
    border-radius: 3px;
}

.ui-slider-horizontal .ui-slider-handle {
    width: 18px;
    height: 18px;
    background: var(--primary-red);
    border: 3px solid #ffffff;
    border-radius: 50%;
    top: -7px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(220, 20, 60, 0.3);
    transition: var(--transition);
}

.ui-slider-horizontal .ui-slider-handle:hover,
.ui-slider-horizontal .ui-slider-handle:focus {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(220, 20, 60, 0.5);
}

.ui-slider-horizontal .ui-slider-range {
    background: var(--primary-red);
    border-radius: 3px;
}

/* Results Header */
.results-header {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.results-count {
    color: var(--dark-gray);
    font-size: 1rem;
}

.sort-options .form-select {
    border: 2px solid #e0e0e0;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    cursor: pointer;
    min-width: 200px;
}

.sort-options .form-select:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 0.2rem rgba(220, 20, 60, 0.25);
}

/* Product Cards */
.product-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #28a745;
    color: #ffffff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.product-badge.badge-warning {
    background-color: #ffc107;
    color: #000000;
}

.product-badge.badge-danger {
    background-color: var(--primary-red);
    color: #ffffff;
}

.product-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-red);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 0.75rem;
    min-height: 52px;
}

.product-details {
    flex-grow: 1;
}

.product-size {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.product-type {
    margin-bottom: 1rem;
}

.product-type .badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
}

.badge.type-all-season {
    background-color: #6c757d;
}

.badge.type-winter {
    background-color: #17a2b8;
}

.badge.type-summer {
    background-color: #ffc107;
    color: #000;
}

.badge.type-performance {
    background-color: var(--primary-red);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-red);
}

.product-price small {
    font-size: 0.7rem;
    color: #666;
    font-weight: 400;
}

/* Pagination */
.pagination {
    gap: 0.5rem;
}

.pagination .page-item .page-link {
    border: 2px solid #e0e0e0;
    color: var(--primary-black);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: #ffffff;
}

.pagination .page-item .page-link:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: #ffffff;
    transform: translateY(-2px);
}

.pagination .page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #e0e0e0;
    color: #999;
}

/* Loading State */
#loadingSpinner {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* No Results */
#noResults {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Mobile Filters Toggle */
@media (max-width: 991px) {
    .filters-sidebar {
        position: fixed;
        top: 76px;
        left: -100%;
        width: 300px;
        height: calc(100vh - 76px);
        z-index: 1050;
        transition: left 0.3s ease;
        max-height: none;
    }

    .filters-sidebar.show {
        left: 0;
    }

    .filters-overlay {
        position: fixed;
        top: 76px;
        left: 0;
        width: 100%;
        height: calc(100vh - 76px);
        background: rgba(0, 0, 0, 0.5);
        z-index: 1049;
        display: none;
    }

    .filters-overlay.show {
        display: block;
    }
}

@media (max-width: 767px) {
    .page-header {
        padding: 120px 0 60px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .results-header {
        padding: 1rem;
    }

    .results-header .d-flex {
        flex-direction: column;
    }

    .sort-options {
        width: 100%;
    }

    .sort-options .form-select {
        width: 100%;
        min-width: auto;
    }

    .product-image {
        height: 200px;
    }

    .product-body {
        padding: 1.25rem;
    }

    .product-title {
        min-height: auto;
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.25rem;
    }
}

/* Responsive Grid */
@media (min-width: 768px) {
    #productsContainer {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 992px) {
    #productsContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Clear Filters Button */
#clearFilters {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

#clearFilters:hover {
    background-color: var(--primary-red);
    color: #ffffff;
}
