/* Catalog Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-light: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

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

/* Catalog Section */
.catalog {
    padding: 40px 0 80px;
}

.page-header {
    background: var(--bg-white);
    padding: 32px;
    margin-bottom: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
}

/* Filters */
.filters {
    background: var(--bg-white);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.filters-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.filters-title:hover {
    color: var(--primary-color);
}

.filters-toggle {
    margin-left: auto;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.filters-grid.collapsed {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
}

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

.filter-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.filter-group select {
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

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

.clear-filters {
    background: none;
    border: 2px solid var(--text-dark);
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-filters:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

/* Products Grid */
.products-section {
    margin-bottom: 60px;
}

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

.products-count {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 500;
}

.sort-dropdown {
    padding: 8px 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-white);
    font-size: 14px;
    color: var(--text-dark);
}

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

.product-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.4s ease;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(37, 99, 235, 0.2);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-color);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-badge.hit {
    background: #dc2626;
}


.product-badge.econom {
    background: #f59e0b;
}

.product-badge.premium {
    background: #8b5cf6;
}

/* Mobile Responsive Styles for Badges and Brand */
@media (max-width: 768px) {
    .product-image {
        overflow: visible;
        margin: 16px 0 20px 0;
    }


}

.product-image {
    width: 100%;
    height: 320px;
    background: linear-gradient(135deg, var(--bg-light), #e5e7eb);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.product-brand {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
    line-height: 1.3;
}

.product-features {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.feature-badge {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-light);
}

.feature-badge.highlight {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.product-specs {
    list-style: none;
    margin-bottom: 20px;
}

.product-specs li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.product-specs li:last-child {
    border-bottom: none;
}

.spec-label {
    color: #6b7280 !important;
    font-weight: 500;
}

.spec-value {
    font-weight: 700;
    color: #1f2937 !important;
}

.product-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.price-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.old-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.discount {
    background: #dc2626;
    color: white;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    width: fit-content;
}

.buy-btn {
    background: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
}

.buy-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

.buy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.load-more-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.load-more-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.load-more-btn:active {
    transform: translateY(0);
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animation Classes */
/* Visible by default to avoid blank page if JS fails */
.animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: all 0.6s ease;
}

/* When JS is enabled, we add .js-enabled to body to re-enable animations */
.js-enabled .animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
}

.js-enabled .animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
    }

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

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .page-header {
        padding: 32px 24px;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .filters {
        padding: 20px;
    }

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

    .products-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

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

    .product-card {
        padding: 20px;
    }

    .load-more-container {
        margin-top: 32px;
    }

    .load-more-btn {
        padding: 14px 28px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 32px 20px;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .product-image {
        height: 300px;
        font-size: 40px;
    }

    .product-badge {
        top: 8px;
        right: 10px;
        padding: 6px 12px;
        font-size: 11px;
        border-radius: 20px;
    }

    .product-brand {
        top: 8px;
        left: 10px;
        padding: 6px 12px;
        font-size: 11px;
        border-radius: 20px;
    }

    .product-title {
        font-size: 1.1rem;
    }

    .price {
        font-size: 1.3rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-light: #000000;
        --text-light: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
