:root {
    --bg-color: #0d0f17;
    --card-bg: rgba(26, 30, 44, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #06b6d4;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --star-color: #fbbf24;
    --glass-bg: rgba(13, 15, 23, 0.85);
    --glass-border: rgba(255, 255, 255, 0.05);
    --danger: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.15), transparent 25%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Typography & Utilities */
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}
.logo i {
    color: var(--primary-color);
    font-size: 1.8rem;
}
.search-container {
    flex: 1;
    max-width: 500px;
    position: relative;
    margin: 0 2rem;
    display: flex;
}
.search-container input {
    width: 100%;
    padding: 12px 20px;
    padding-right: 50px;
    border-radius: 30px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}
.search-container input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.search-container button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}
.search-container button:hover {
    color: var(--primary-color);
}
.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid var(--card-border);
}
.icon-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}
.mobile-menu-btn {
    display: none;
    color: var(--text-primary);
    font-size: 1.5rem;
}
.mobile-search-container {
    display: none;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
}
.mobile-search-container input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

/* Layout */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
}

/* Sidebar */
.sidebar-filters {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
    backdrop-filter: blur(10px);
}
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}
.filter-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}
.close-filters-btn {
    display: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
}
.filter-section {
    margin-bottom: 2rem;
}
.filter-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    user-select: none;
    transition: color 0.2s ease;
}
.custom-checkbox:hover {
    color: var(--text-primary);
}
.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    transition: all 0.2s ease;
}
.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--primary-color);
}
.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}
.custom-checkbox .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.price-range {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.price-inputs input {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}
.apply-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 6px;
    transition: all 0.3s ease;
}
.apply-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}
.reset-btn {
    width: 100%;
    padding: 12px;
    margin-top: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px dashed var(--text-muted);
    border-radius: 8px;
    transition: all 0.3s ease;
}
.reset-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Catalog Area */
.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.catalog-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.catalog-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.mobile-filter-btn {
    display: none;
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.sort-container select {
    padding: 8px 30px 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    cursor: pointer;
}
.sort-container select option {
    background: var(--bg-color);
    color: var(--text-primary);
}
.products-status {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(99, 102, 241, 0.4);
}
.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.3);
    z-index: 10;
    backdrop-filter: blur(4px);
}
.product-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background: #ffffff;
    overflow: hidden;
}
.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.5s ease;
}
.product-card:hover .product-img-wrapper img {
    transform: scale(1.08);
}
.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-brand {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
    font-weight: 600;
}
.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.product-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.product-rating .fa-star {
    color: var(--star-color);
}
.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.product-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-color);
}
.product-add-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid var(--card-border);
}
.product-card:hover .product-add-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px dashed var(--card-border);
}
.no-results i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.no-results h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.no-results p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10;
    transition: all 0.2s;
}
.modal-close:hover {
    background: var(--danger);
    transform: rotate(90deg);
}
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.modal-image-col {
    background: #ffffff;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-image-col img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}
.modal-info-col {
    padding: 3rem;
    display: flex;
    flex-direction: column;
}
.modal-category {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}
.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}
.modal-brand {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}
.modal-price-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}
.modal-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}
.modal-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.05);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.95rem;
}
.modal-rating i { color: var(--star-color); }
.modal-specs h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.modal-specs-list {
    list-style: none;
    margin-bottom: 2.5rem;
}
.modal-specs-list li {
    display: grid;
    grid-template-columns: 120px 1fr;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.spec-label {
    color: var(--text-muted);
    font-weight: 500;
}
.spec-value {
    color: var(--text-primary);
}
.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .sidebar-filters {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        z-index: 1000;
        border-radius: 0;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    .sidebar-filters.active {
        left: 0;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
    .close-filters-btn {
        display: block;
    }
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .modal-grid {
        grid-template-columns: 1fr;
    }
    .modal-image-col {
        padding: 2rem;
    }
    .modal-image-col img {
        max-height: 300px;
    }
    .modal-info-col {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    .search-container {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    .mobile-search-container {
        display: block;
    }
    .catalog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .catalog-controls {
        width: 100%;
        justify-content: space-between;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    .product-img-wrapper {
        padding: 0.5rem;
    }
    .product-info {
        padding: 0.8rem;
    }
    .product-name {
        font-size: 0.95rem;
    }
    .product-price {
        font-size: 1.1rem;
    }
    .modal-title {
        font-size: 1.5rem;
    }
    .modal-price {
        font-size: 2rem;
    }
}
