
:root {
    --primary-color: #6366f1;
    --primary-hover: #5b5df0;
    --secondary-color: #f8fafc;
    --accent-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --border-hover: #d1d5db;
    --background: #ffffff;
    --background-alt: #f9fafb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-modal: 0 25px 50px rgba(0, 0, 0, 0.25);
    --border-radius: 12px;
    --border-radius-small: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 1200px;
}


@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #7c3aed;
        --primary-hover: #8b5cf6;
        --secondary-color: #1f2937;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --border-color: #374151;
        --border-hover: #4b5563;
        --background: #111827;
        --background-alt: #1f2937;
    }
}


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

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--background);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}


.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>') repeat;
    opacity: 0.1;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
}


.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}


.filters-section {
    background: var(--background-alt);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filters-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.clear-filters {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
}

.clear-filters:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.search-input,
.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    background: var(--background);
    color: var(--text-primary);
    transition: var(--transition);
    width: 100%;
}

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

.price-slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
    
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


.products-section {
    margin-top: 2rem;
}

.products-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}


.product-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-hover);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: var(--background-alt);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.product-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    flex: 1;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--background);
    border-radius: var(--border-radius);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-image-section {
    background: var(--background-alt);
    display: flex;
    flex-direction: column;
}

.modal-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.image-gallery {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: var(--primary-color);
}

.modal-info-section {
    padding: 2rem;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.modal-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.modal-category {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: var(--transition);
}

.loading-spinner.hidden {
    opacity: 0;
    visibility: hidden;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .header {
        padding: 2rem 0;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .filters-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filters-section {
        padding: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .modal-image {
        height: 300px;
    }
    
    .modal-info-section {
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-price {
        font-size: 2rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .filters-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .product-image-container {
        height: 200px;
    }
}


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

/
.product-card:focus,
.btn:focus,
.search-input:focus,
.filter-select:focus,
.price-slider:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}


@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}