/* 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 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumbs a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

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

.breadcrumbs .separator {
    color: #d1d5db;
    font-size: 12px;
}

.breadcrumbs .current {
    color: #1f2937;
    font-weight: 500;
}

.breadcrumbs .home-icon {
    width: 16px;
    height: 16px;
}

.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);
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    position: relative;
    z-index: 100;
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    border-bottom: 1px solid transparent;
}

.filters-header:hover {
    background: var(--bg-light);
}

.filters-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.active-filters-count {
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.filters-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-light);
    transition: all 0.3s ease;
}

.filters-toggle svg {
    transition: transform 0.3s ease;
    color: var(--text-light);
}

.filters.expanded .filters-toggle svg {
    transform: rotate(180deg);
}

.filters.expanded .filters-header {
    border-bottom-color: var(--border-light);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 24px;
    padding-bottom: 32px;
    transition: all 0.3s ease;
    opacity: 1;
}

.filters-grid.collapsed {
    display: none;
}

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

.filter-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Hide native select */
.filter-group select {
    display: none;
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    width: 100%;
    z-index: 1;
}

.custom-select.open {
    z-index: 1001;
}

.custom-select-trigger {
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: all 0.25s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    user-select: none;
}

.custom-select-trigger:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.custom-select.open .custom-select-trigger {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select.has-value .custom-select-trigger {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.04);
}

.custom-select-trigger .arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.custom-select.open .custom-select-trigger .arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.custom-select.open .custom-select-options {
    max-height: 280px;
    overflow-y: auto;
    opacity: 1;
}

.custom-select-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-light);
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.custom-select-option.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.custom-select-option.selected:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1e40af);
    color: white;
}

/* Scrollbar for options */
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.filter-actions {
    display: flex;
    align-items: flex-end;
}

.clear-filters {
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    color: var(--text-light);
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.clear-filters:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
    transform: translateY(-1px);
}

.clear-filters:active {
    transform: translateY(0);
}

.clear-filters svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.clear-filters:hover svg {
    transform: scale(1.1);
}

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

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

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

/* Sort wrapper - uses same custom select styles */
.sort-wrapper {
    position: relative;
    min-width: 180px;
    z-index: 50;
}

.sort-wrapper select {
    display: none;
}

.sort-wrapper .custom-select {
    width: 100%;
}

.sort-wrapper .custom-select.open {
    z-index: 51;
}

.sort-wrapper .custom-select-trigger {
    padding: 10px 16px;
    font-size: 14px;
}

.sort-wrapper .custom-select-options {
    min-width: 100%;
    left: auto;
    right: 0;
    z-index: 52;
}

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

.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;
    display: flex;
    flex-direction: column;
}


.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;
}

/* Variants Selector */
.variants-selector {
    padding: 8px 0;
    margin-bottom: 8px;
    min-height: 44px;
}

.variants-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.variants-list::-webkit-scrollbar {
    display: none;
}

.variant-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    color: #64748b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 48px;
    flex-shrink: 0;
    cursor: pointer;
}

.variant-btn:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

.variant-btn.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-color: #0284c7;
    color: white;
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3);
}

.variant-area {
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}

.variant-unit {
    font-weight: 500;
    font-size: 10px;
    opacity: 0.8;
}

.variant-btn.active .variant-area,
.variant-btn.active .variant-unit {
    color: white;
}

/* 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.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-dark);
    line-height: 1.4;
    min-height: 3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.product-image-link {
    position: relative;
    display: block;
}

.product-features {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 2;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feature-badge.highlight {
    background: rgba(220, 252, 231, 0.95);
    color: #166534;
    border-color: #bbf7d0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-specs {
    list-style: none;
    margin-top: auto;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
}

.product-specs li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

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

.product-specs li:first-child {
    padding-top: 0;
}

.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;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: 12px;
    margin-top: auto;
}

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

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

.old-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
}

.discount {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    width: fit-content;
}

.buy-btn {
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}

.buy-btn:hover {
    background: #059669;
}

.buy-btn:active {
    background: #047857;
}

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

/* 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 - disabled */
.animate-on-scroll,
.animate-on-scroll.visible,
.js-enabled .animate-on-scroll,
.js-enabled .animate-on-scroll.visible {
    opacity: 1;
    transform: none;
}

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

    .filter-actions {
        grid-column: span 2;
    }

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

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

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

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

    .filters-header {
        padding: 16px 20px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 16px;
    }

    .sort-wrapper {
        width: 100%;
    }

    .sort-wrapper .custom-select-options {
        left: 0;
        right: 0;
        min-width: 100%;
    }

    .filter-actions {
        grid-column: 1;
    }

    .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;
    }
}
