/* Product List Page Styles */

.product-list-page {
    padding: 0;
    background-color: #f9f9f9;
    min-height: 100vh;
}

.page-header {
    text-align: center;
    margin-bottom: 0;
    padding: 40px 0;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.page-header h1 {
    font-size: 36px;
    color: #1a365d;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 16px;
    color: #64748b;
}

/* Layout - Full Screen */
.product-list-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    align-items: start;
    max-width: 100%;
    margin: 0;
}

/* Sidebar */
.sidebar {
    background: white;
    padding: 30px 25px;
    height: calc(100vh - 160px);
    position: sticky;
    top: 0;
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
}

.sidebar h3 {
    font-size: 18px;
    color: #1a365d;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 8px;
}

.category-link {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #64748b;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-weight: 500;
}

.category-link:hover,
.category-link.active {
    background-color: #1a365d;
    color: white;
    border-color: #1a365d;
    transform: translateX(5px);
}

/* Main Content - Full Screen */
.main-content {
    background: #f9f9f9;
    padding: 30px 40px;
    min-height: calc(100vh - 160px);
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.results-count {
    font-size: 15px;
    color: #64748b;
    font-weight: 500;
}

.sort-select {
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.sort-select:focus {
    outline: none;
    border-color: #1a365d;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.sort-select:hover {
    border-color: #cbd5e0;
}

/* Product Grid - Full Screen */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    justify-items: center;
}

.product-card {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    width: 100%;
    max-width: 280px;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.product-category {
    font-size: 12px;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.product-stock {
    font-size: 12px;
    color: #10b981;
    margin-top: 8px;
}

.product-stock.out-of-stock {
    color: #ef4444;
}

/* Fix layout for small number of products */
.product-grid:has(.product-card:nth-child(4)):not(:has(.product-card:nth-child(5))) {
    grid-template-columns: repeat(2, 1fr);
    justify-content: center;
}

.product-grid:has(.product-card:nth-child(3)):not(:has(.product-card:nth-child(4))) {
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
}

.product-grid:has(.product-card:nth-child(2)):not(:has(.product-card:nth-child(3))) {
    grid-template-columns: repeat(2, 1fr);
    justify-content: center;
}

.product-grid:has(.product-card:nth-child(1)):not(:has(.product-card:nth-child(2))) {
    grid-template-columns: 1fr;
    justify-content: center;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-list-container {
        grid-template-columns: 250px 1fr;
        gap: 0;
    }
    
    .sidebar {
        padding: 25px 20px;
    }
    
    .main-content {
        padding: 25px 30px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .product-list-container {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .sidebar {
        order: 1;
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        padding: 15px 20px;
        border-radius: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        margin-bottom: 0;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        height: auto;
    }
    
    .main-content {
        order: 2;
        padding: 20px;
        min-height: auto;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        margin-top: 0;
        padding: 15px 20px;
    }
    
    .sort-select {
        min-width: 100%;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .product-name {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .product-list-page {
        padding: 20px 0;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-card {
        display: flex;
        align-items: center;
    }
    
    .product-image {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
    }
    
    .product-info {
        flex: 1;
        padding: 15px;
    }
}