/* Products Page Specific Styles */

.page-header {
    background: #ffffff;
    color: #333333;
    padding: 4rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #333333;
}

.page-header p {
    font-size: 1.2rem;
    color: #666666;
}

.product-filters {
    background: #ffffff;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.filters-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
}

.search-container {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

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

.clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.filter-categories,
.filter-price,
.filter-sort {
    min-width: 150px;
}

.filter-categories select,
.filter-price select,
.filter-sort select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

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

.filter-featured {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    gap: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
}

.filter-actions {
    margin-left: auto;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.products-section {
    padding: 3rem 0;
}

#products-count {
    margin-bottom: 2rem;
    color: var(--text-light);
}

#products-count strong {
    color: var(--primary-color);
}

.no-products {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-light);
}

.no-products h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.products-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.products-per-page select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-pricing {
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #007bff;
}

.product-original-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-savings {
    display: block;
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 600;
    margin-top: 0.25rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 3rem 0;
    padding: 2rem 0;
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-number {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    min-width: 2.5rem;
    text-align: center;
}

.page-number:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.page-number.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.page-number.dots {
    cursor: default;
    border: none;
    background: none;
}

.page-number.dots:hover {
    background: none;
    border: none;
}

/* Mobile responsiveness for filters */
@media (max-width: 1024px) {
    .filters-container {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .search-container {
        grid-column: 1 / -1;
    }
    
    .clear-filters {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .search-container,
    .filter-categories,
    .filter-price,
    .filter-sort,
    .filter-featured,
    .filter-actions {
        min-width: auto;
        width: 100%;
    }
    
    .filter-actions {
        margin-left: 0;
    }
    
    .products-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .products-per-page {
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .page-numbers {
        order: -1;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Loading state */
.products-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced product cards for products page */
.products-section .product-card {
    position: relative;
}

.products-section .product-card:hover .product-info {
    transform: translateY(-5px);
}

.products-section .product-card .product-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Filter badges */
.active-filters {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-badge {
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-badge .remove {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

.filter-badge .remove:hover {
    opacity: 0.7;
}
