/* Products Page Specific Styles */
.products-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 150px 0 80px;
    margin-top: 70px;
    text-align: center;
    position: relative;
}

.products-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.products-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.products-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.products-content {
    padding: 4rem 0;
    background: var(--bg-light);
}

.products-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
}

/* Sidebar Filters */
.products-sidebar {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-widget {
    padding: 2rem;
}

.filter-widget h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 0.8rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkmark.radio {
    border-radius: 50%;
}

.filter-option:hover .checkmark {
    border-color: var(--primary-color);
}

.filter-option input:checked ~ .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-option input:checked ~ .checkmark:after {
    content: '';
    position: absolute;
    display: block;
}

.filter-option input[type="checkbox"]:checked ~ .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-option input[type="radio"]:checked ~ .checkmark.radio:after {
    left: 4px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

/* Main Content */
.products-main {
    min-height: 100vh;
}

.products-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

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

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-white);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.sort-container {
    min-width: 200px;
}

.sort-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-white);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
}

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

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

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.product-badge.best-value {
    background: linear-gradient(135deg, #059669, #10b981);
}

.product-badge:has-text("Hot Deal") {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.product-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.product-info h3 a {
    text-decoration: none;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.product-info h3 a:hover {
    color: var(--primary-color);
}

.product-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    display: flex;
    gap: 0.1rem;
    color: #fbbf24;
}

.rating-text {
    font-size: 0.8rem;
    color: var(--text-light);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
}

.original-price {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.product-buttons {
    display: flex;
    gap: 0.8rem;
}

.product-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-number:hover,
.page-number.active {
    background: var(--primary-color);
    color: white;
}

.pagination-dots {
    padding: 0 0.5rem;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .products-sidebar {
        position: static;
        order: -1;
    }

    .filter-widget {
        padding: 1.5rem;
    }

    .filter-group {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .products-header {
        padding: 120px 0 60px;
    }

    .products-header h1 {
        font-size: 2.5rem;
    }

    .products-header p {
        font-size: 1rem;
    }

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

    .products-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        min-width: auto;
    }

    .sort-container {
        min-width: auto;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .product-info {
        padding: 1rem;
    }

    .product-buttons {
        flex-direction: column;
    }

    .filter-widget {
        padding: 1rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pagination-numbers {
        order: -1;
    }
}

@media (max-width: 480px) {
    .products-header h1 {
        font-size: 2rem;
    }

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

    .product-image {
        height: 200px;
    }

    .pagination-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .page-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* Loading and Animation States */
.product-card.loading {
    opacity: 0.5;
    pointer-events: none;
}

.product-card.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card.hidden {
    display: none;
}

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

.no-products i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

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

.no-products p {
    font-size: 1rem;
}

/* Filter Active States */
.filter-option.active {
    color: var(--primary-color);
    font-weight: 600;
}

.filter-clear {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.filter-clear:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}