/* ============================================
   Catalog Pages Styles
   ============================================ */

.catalog-section {
    padding: var(--space-12) 0 var(--space-20);
}

.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-8);
}

/* ============================================
   Filters Sidebar
   ============================================ */
.filters-sidebar {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-gray-200);
}

.filters-header h3 {
    font-size: var(--font-size-xl);
    margin: 0;
}

.filters-close {
    display: none;
    background: none;
    border: none;
    font-size: var(--font-size-3xl);
    color: var(--color-gray-600);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.filter-group {
    margin-bottom: var(--space-8);
}

.filter-group h4 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-4);
}

/* Filter Checkbox */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Price Inputs */
.price-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.price-inputs input[type="number"] {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

#price-slider {
    width: 100%;
    accent-color: var(--color-secondary);
}

/* Sort Select */
.sort-select {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background: var(--color-white);
    cursor: pointer;
}

/* ============================================
   Catalog Main
   ============================================ */
.catalog-main {
    flex: 1;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    padding: var(--space-4);
    background: var(--color-gray-50);
    border-radius: var(--radius-lg);
}

.results-count {
    font-size: var(--font-size-sm);
    color: var(--color-gray-600);
}

.results-count span {
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.filters-toggle {
    display: none;
    padding: var(--space-2) var(--space-4);
    background: var(--color-secondary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filters-toggle:hover {
    background: var(--color-accent);
}

/* ============================================
   Products Grid
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.product-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--color-gray-200);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--color-primary);
}

.product-image {
    position: relative;
    width: 100%;
    height: 280px;
    min-height: 280px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.03) 0%, rgba(167, 139, 250, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--space-4);
}

.product-image:not(:has(img))::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.5'%3E%3Crect x='2' y='3' width='20' height='14' rx='2'/%3E%3Cpath d='M8 21h8M12 17v4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.3;
    pointer-events: none;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.badge {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--gradient-purple);
    color: var(--color-white);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.product-info {
    padding: var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-main-content {
    flex: 0 0 auto;
}

.product-category {
    font-size: var(--font-size-xs);
    color: var(--color-secondary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-2);
}

.product-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-4);
    line-height: 1.4;
    color: var(--color-gray-900);
}

.product-specs {
    list-style: none;
    padding: 0;
    margin-bottom: var(--space-6);
    flex: 1;
}

.product-specs li {
    font-size: var(--font-size-xs);
    color: var(--color-gray-700);
    margin-bottom: var(--space-2);
    padding-left: var(--space-5);
    position: relative;
    line-height: 1.6;
}

.product-specs li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-secondary);
}

/* Components list (Includes section) */
.product-components {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-components li {
    font-size: var(--font-size-xs);
    color: var(--color-gray-700);
    margin-bottom: var(--space-2);
    padding-left: var(--space-5);
    position: relative;
    line-height: 1.6;
}

.product-components li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-secondary);
}

/* Features list (small text at bottom) */
.product-features {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: auto;
    margin-bottom: var(--space-6);
}

.product-features li {
    font-size: var(--font-size-xs);
    color: var(--color-gray-700);
    margin-bottom: var(--space-2);
    padding-left: var(--space-5);
    position: relative;
    line-height: 1.6;
}

.product-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-secondary);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-gray-200);
}

.price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
}

.product-price-old {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-500);
    text-decoration: line-through;
}

.product-price {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-extrabold);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-footer .btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

/* ============================================
   Components Catalog (Tabs)
   ============================================ */
.components-catalog {
    padding: var(--space-12) 0 var(--space-20);
}

.category-tabs {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-12);
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    padding: var(--space-3) var(--space-8);
    background: var(--color-white);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-600);
    cursor: pointer;
    transition: all var(--transition-base);
}

.tab-btn:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.tab-btn.active {
    background: var(--gradient-purple);
    border-color: transparent;
    color: var(--color-white);
    box-shadow: var(--shadow-purple);
}

.components-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--space-8);
    margin: var(--space-4);
    box-shadow: var(--shadow-2xl);
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: none;
    border: none;
    font-size: var(--font-size-3xl);
    color: var(--color-gray-600);
    cursor: pointer;
    width: 40px;
    height: 40px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-primary);
}

/* ============================================
   Responsive Catalog
   ============================================ */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .components-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-image {
        height: 240px;
        min-height: 240px;
    }
    
    .product-image img {
        max-height: 220px;
    }
}

@media (max-width: 768px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 350px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        z-index: 1100;
        overflow-y: auto;
    }
    
    .filters-sidebar.active {
        transform: translateX(0);
    }
    
    .filters-close {
        display: block;
    }
    
    .filters-toggle {
        display: block;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .components-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-image {
        height: 220px;
        min-height: 220px;
        padding: var(--space-3);
    }
    
    .product-image img {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .components-grid {
        grid-template-columns: 1fr;
    }
    
    .category-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .product-image {
        height: 200px;
        min-height: 200px;
        padding: var(--space-2);
    }
    
    .product-image img {
        max-height: 180px;
    }
}

