/* Products Page Specific Styles */

/* Color Palette - Blue/Teal Theme */
:root {
    --product-primary: #2C5F7F;
    --product-secondary: #1A4A63;
    --product-accent: #5B9BC4;
    --product-light: #D9E9F5;
    --product-dark: #3A5C7C;
    --product-gradient: linear-gradient(135deg, #2C5F7F 0%, #1A4A63 100%);
    --product-glow: rgba(44, 95, 127, 0.3);
}

/* Products Hero Section */
.products-hero {
    background: linear-gradient(135deg, #f4f8ff 0%, #d9e9ff 100%);
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}

.products-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(44, 95, 127, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.products-hero .hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.products-hero .hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.products-hero .hero-text {
    z-index: 2;
}

.products-hero .hero-title {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: 24px;
    color: var(--product-secondary);
}

.title-luxury {
    display: block;
    background: var(--product-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-products {
    display: block;
    color: var(--product-dark);
}

.products-hero .hero-subtitle {
    font-size: 1.8rem;
    color: var(--product-primary);
    margin-bottom: 16px;
    font-weight: 600;
}

.products-hero .hero-description {
    font-size: 1.1rem;
    color: var(--product-dark);
    line-height: 1.6;
    max-width: 500px;
}

/* Product Showcase Animation */
.hero-image {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-showcase {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcase-item {
    position: absolute;
    width: 80px;
    height: 120px;
    background: var(--product-gradient);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--product-glow);
    animation: float 6s ease-in-out infinite;
}

.showcase-item::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.item-1 {
    transform: translateX(-100px) scale(1.1);
    animation-delay: 0s;
    border-radius: 15px;
}

.item-2 {
    transform: translateX(0) scale(1.3);
    animation-delay: -2s;
    z-index: 2;
    border-radius: 20px;
}

.item-3 {
    transform: translateX(100px) scale(0.9);
    animation-delay: -4s;
    border-radius: 10px;
}

.item-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    border-radius: inherit;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(var(--scale, 1)); }
    50% { transform: translateY(-20px) scale(var(--scale, 1)); }
}

@keyframes shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Filter Section */
.filter-section {
    background: #fff;
    padding: 40px 0;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 50px;
    margin-top: -10px;
    z-index: 100;
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.filter-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--product-secondary);
    margin: 0;
}

.results-count {
    font-size: 1rem;
    color: var(--product-primary);
    font-weight: 500;
}

.filter-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--product-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.search-input:focus {
    outline: none;
    border-color: var(--product-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 95, 127, 0.1);
}

.search-button {
    position: absolute;
    right: 23px;
    background: var(--product-gradient);
    border: none;
    padding: 8px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--product-glow);
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 25px;
    font-size: 1rem;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--product-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 95, 127, 0.1);
}

.clear-filters-btn {
    background: #f8fafc;
    border: 2px solid #e0e6ed;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-filters-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.view-toggle {
    display: flex;
    gap: 8px;
    justify-self: end;
}

.view-btn {
    padding: 12px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.view-btn:hover,
.view-btn.active {
    background: var(--product-gradient);
    border-color: var(--product-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--product-glow);
}

/* Products Section */
.products-section {
    padding: 60px 0;
    background: linear-gradient(to bottom, #fff 0%, #f8fafc 100%);
}

.products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e6ed;
    border-top: 4px solid var(--product-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

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

/* List View Styles */
.products-grid.list-view {
    grid-template-columns: 1fr;
    gap: 20px;
}

.products-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 0;
    height: auto;
}

.products-grid.list-view .product-image {
    height: 100%;
    border-radius: 20px 0 0 20px;
}

.products-grid.list-view .product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.products-grid.list-view .product-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.products-grid.list-view .product-description {
    font-size: 0.85rem;
    margin-bottom: 12px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.products-grid.list-view .product-details {
    margin-bottom: 12px;
    padding: 8px;
}

.products-grid.list-view .product-actions {
    gap: 8px;
}

.products-grid.list-view .add-to-cart-btn,
.products-grid.list-view .view-details-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.product-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(44, 95, 127, 0.15);
    border-color: var(--product-accent);
}

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

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

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

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--product-gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px var(--product-glow);
}

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

.product-badge.low-stock {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.product-info {
    padding: 24px;
}

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

.product-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--product-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--product-secondary);
}

.original-price {
    font-size: 1rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.discount-percent {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stars {
    display: flex;
    gap: 1px;
}

.star {
    width: 14px;
    height: 14px;
    fill: #fbbf24;
}

.star.empty {
    fill: #e5e7eb;
}

.rating-text {
    font-size: 0.85rem;
    color: #64748b;
    margin-left: 4px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.product-brand {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.product-stock {
    font-size: 0.85rem;
    font-weight: 600;
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
}

.product-stock.low {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
}

.product-stock.out {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.product-actions {
    display: flex;
    gap: 12px;
}

.add-to-cart-btn {
    flex: 1;
    padding: 12px 20px;
    background: var(--product-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--product-glow);
}

.add-to-cart-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.view-details-btn {
    padding: 12px 20px;
    background: transparent;
    color: var(--product-primary);
    border: 2px solid var(--product-primary);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.view-details-btn:hover {
    background: var(--product-primary);
    color: white;
    transform: translateY(-2px);
}

/* Error and No Results States */
.error-message,
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results-content svg {
    color: #94a3b8;
    margin-bottom: 20px;
}

.no-results h3,
.error-message h3 {
    font-size: 1.5rem;
    color: var(--product-secondary);
    margin-bottom: 12px;
}

.no-results p,
.error-message p {
    color: #64748b;
    margin-bottom: 20px;
}

.try-again-btn,
.retry-btn {
    background: var(--product-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.try-again-btn:hover,
.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--product-glow);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    background: transparent;
    color: var(--product-primary);
    border: 2px solid var(--product-primary);
    padding: 16px 32px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.load-more-btn:hover {
    background: var(--product-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--product-glow);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Dark Mode Styles */
[data-theme="dark"] .products-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .products-hero .hero-title {
    color: #e2e8f0;
}

[data-theme="dark"] .title-luxury {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .products-hero .hero-subtitle {
    color: #60a5fa;
}

[data-theme="dark"] .products-hero .hero-description {
    color: #cbd5e1;
}

[data-theme="dark"] .filter-section {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .filter-header h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .results-count {
    color: #60a5fa;
}

[data-theme="dark"] .filter-group label {
    color: #cbd5e1;
}

[data-theme="dark"] .search-input,
[data-theme="dark"] .filter-select {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .search-input:focus,
[data-theme="dark"] .filter-select:focus {
    border-color: #3b82f6;
    background: #475569;
}

[data-theme="dark"] .clear-filters-btn {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .view-btn {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .products-section {
    background: linear-gradient(to bottom, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .product-card {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .product-title {
    color: #e2e8f0;
}

[data-theme="dark"] .current-price {
    color: #e2e8f0;
}

[data-theme="dark"] .product-details {
    background: #475569;
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-hero .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .products-hero .hero-title {
        font-size: 3rem;
    }

    .filter-controls {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .view-toggle {
        justify-self: center;
    }

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

    .products-grid.list-view .product-card {
        grid-template-columns: 1fr;
        height: auto;
    }

    .products-grid.list-view .product-image {
        height: 200px;
        border-radius: 20px 20px 0 0;
    }

    .product-actions {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .products-hero .hero-title {
        font-size: 2.5rem;
    }

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

    .filter-container,
    .products-container {
        padding: 0 16px;
    }
}
