/* Category Page Styles */
.category-hero {
    background: linear-gradient(135deg, #ee4d2d 0%, #ff6b47 50%, #ffa726 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 3rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.category-hero::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="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.category-hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.category-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.category-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.6;
}

.category-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Products Section */
.products-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.products-info h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.products-info p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.products-sort {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-select {
    padding: 0.8rem 1.2rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
}

.sort-select:focus {
    outline: none;
    border-color: #ee4d2d;
    box-shadow: 0 0 0 3px rgba(238, 77, 45, 0.1);
}

/* Enhanced Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Enhanced Product Card */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.product-card a {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8rem;
    color: #333;
}

.product-price {
    color: #ee4d2d;
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.product-original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 1rem;
    margin-left: 0.5rem;
    font-weight: normal;
}

.product-discount {
    background: linear-gradient(45deg, #ee4d2d, #ff6b47);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    position: absolute;
    top: 1rem;
    right: 1rem;
    box-shadow: 0 2px 8px rgba(238, 77, 45, 0.4);
    z-index: 2;
}

.product-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars .star {
    font-size: 0.9rem;
    margin-right: 1px;
}

.rating-stars .star.filled {
    color: #ffa500;
}

.rating-number {
    font-weight: 600;
    color: #333;
    margin-left: 0.3rem;
}

.sold-count {
    font-size: 0.85rem;
    color: #666;
}

/* Product Quick Actions */
.product-quick-actions {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.quick-buy-btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: #ee4d2d;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.quick-buy-btn:hover {
    background: #d73211;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.3);
}

/* No Products */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-products-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-products h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.back-home-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: #ee4d2d;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.2s;
}

.back-home-btn:hover {
    background: #d73211;
    color: white;
    transform: translateY(-2px);
}

/* Enhanced Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-link {
    padding: 1rem 1.3rem;
    border: 2px solid #dee2e6;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 48px;
    text-align: center;
    font-weight: 500;
    background: white;
}

.pagination-link:hover {
    background: #ee4d2d;
    color: white;
    border-color: #ee4d2d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.3);
}

.pagination-link.current {
    background: #ee4d2d;
    color: white;
    border-color: #ee4d2d;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.3);
}

.pagination-ellipsis {
    padding: 1rem 0.5rem;
    color: #666;
    font-weight: 500;
}

.prev-link, .next-link {
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* Responsive Category */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .category-stats {
        gap: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .category-hero {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }

    .category-hero h1 {
        font-size: 2.5rem;
    }

    .category-description {
        font-size: 1.1rem;
    }

    .category-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: rgba(255,255,255,0.1);
        padding: 1rem;
        border-radius: 8px;
    }

    .stat-number, .stat-label {
        display: inline;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .products-section {
        padding: 2rem 1.5rem;
    }

    .products-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .products-info {
        text-align: center;
    }

    .products-sort {
        justify-content: center;
    }

    .sort-select {
        min-width: auto;
        width: 100%;
        max-width: 300px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .product-image {
        height: 200px;
    }

    .product-info {
        padding: 1rem;
    }

    .product-name {
        font-size: 1rem;
        height: 2.4rem;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .pagination-link {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        min-width: 44px;
    }

    .prev-link, .next-link {
        padding: 0.8rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .category-hero h1 {
        font-size: 2rem;
    }

    .category-hero-content {
        padding: 0 1rem;
    }

    .products-section {
        padding: 1.5rem 1rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-image {
        height: 250px;
    }

    .pagination-link {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
        min-width: 40px;
    }

    .pagination {
        gap: 0.3rem;
    }

    .category-stats {
        gap: 0.5rem;
    }
}

/* Animation for sorting */
.products-grid {
    transition: opacity 0.3s ease;
}

.products-grid.sorting {
    opacity: 0.7;
}

/* Hover effects */
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(238, 77, 45, 0.1), rgba(255, 107, 71, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-card:hover::before {
    opacity: 1;
}

/* Loading animation for images */
.product-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.product-image[src] {
    animation: none;
    background: none;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}