/* ============================================
   STACKHOLD - PRODUCTS PAGE
   Luxury Server Showcase
============================================ */

:root {
    /* Product Page Variables */
    --product-bg: rgba(15, 15, 25, 0.85);
    --product-border: rgba(255, 255, 255, 0.1);
    --product-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    --popular-color: #f59e0b;
    --enterprise-color: #10b981;
    --performance-color: #8b5cf6;
}

/* ========== PRODUCTS HERO ========== */
.products-hero {
    padding: 10rem 5% 6rem;
    text-align: center;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.products-hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, 
        var(--text-primary) 0%, 
        var(--accent-blue) 50%, 
        var(--accent-purple) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.products-hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem;
    font-weight: 300;
}

/* ========== FILTER CONTROLS ========== */
.filter-section {
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.filter-container {
    background: var(--product-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--product-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--product-shadow);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 600;
}

.filter-count {
    color: var(--text-secondary);
    font-size: 1rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

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

.filter-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label i {
    color: var(--accent-purple);
}

.filter-select {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' 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 1rem center;
    background-size: 1rem;
    padding-right: 3rem;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    align-self: flex-end;
}

.btn-filter {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filter:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--accent-purple);
}

.btn-filter.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* ========== PRODUCTS GRID ========== */
.products-section {
    padding: 4rem 5% 8rem;
    max-width: 1400px;
    margin: 0 auto;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.category-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    color: var(--text-primary);
    font-weight: 700;
    position: relative;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 0;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
    border-radius: 2px;
}

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

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2.5rem;
    margin-bottom: 6rem;
}

/* Last grid no margin */
.products-grid:last-child {
    margin-bottom: 0;
}

/* ========== LUXURY PRODUCT CARD ========== */
.product-card {
    background: var(--product-bg);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--product-border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
}

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

/* Product Badges */
.product-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.badge-popular {
    background: linear-gradient(135deg, var(--popular-color), #d97706);
    color: white;
}

.badge-recommended {
    background: linear-gradient(135deg, var(--enterprise-color), #059669);
    color: white;
}

.badge-performance {
    background: linear-gradient(135deg, var(--performance-color), var(--accent-purple));
    color: white;
}

.badge-enterprise {
    background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
    color: white;
}

/* Product Header */
.product-header {
    margin-bottom: 2rem;
}

.product-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Product Price */
.product-price {
    margin: 1.5rem 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.price-period {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.price-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Product Specs */
.product-specs {
    flex: 1;
    margin: 2rem 0;
}

.specs-list {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.spec-icon {
    color: var(--accent-purple);
    width: 20px;
    text-align: center;
}

.spec-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

/* Product Actions */
.product-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-order {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--transition);
}

.btn-order:hover {
    transform: translateY(-3px);
}

.btn-details {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-details:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--accent-purple);
}

/* ========== COMPARISON TABLE ========== */
.comparison-section {
    padding: 6rem 5%;
    background: rgba(10, 10, 20, 0.5);
    border-radius: var(--radius-lg);
    margin: 6rem 5%;
    border: 1px solid var(--border-color);
}

.comparison-section h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-primary);
    font-weight: 700;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--product-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.comparison-table th,
.comparison-table td {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.comparison-table thead {
    background: rgba(168, 85, 247, 0.1);
}

.comparison-table th {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.comparison-table td {
    color: var(--text-secondary);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table .feature-name {
    font-weight: 500;
    color: var(--text-primary);
    width: 200px;
}

.comparison-table .feature-value {
    text-align: center;
}

.feature-check {
    color: var(--enterprise-color);
    font-size: 1.2rem;
}

.feature-unavailable {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* ========== CTA SECTION ========== */
.products-cta {
    padding: 6rem 5%;
    text-align: center;
    background: rgba(20, 20, 30, 0.7);
    border-radius: var(--radius-lg);
    margin: 6rem 5%;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.products-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, 
        rgba(168, 85, 247, 0.1) 0%, 
        transparent 50%
    );
    z-index: -1;
}

.products-cta h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.products-cta p {
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem;
    font-size: 1.2rem;
    line-height: 1.7;
}

.products-cta .btn {
    padding: 1.3rem 4rem;
    font-size: 1.2rem;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 992px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .products-hero {
        padding: 8rem 5% 4rem;
    }
    
    .products-hero h1 {
        font-size: 2.5rem;
    }
    
    .products-hero p {
        font-size: 1.1rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .product-card {
        padding: 2rem;
    }
    
    .category-title {
        font-size: 2rem;
    }
    
    .price-amount {
        font-size: 2.5rem;
    }
    
    .comparison-section {
        margin: 4rem 1rem;
        padding: 4rem 1.5rem;
    }
    
    .comparison-section h2 {
        font-size: 2rem;
    }
    
    .products-cta {
        margin: 4rem 1rem;
        padding: 4rem 1.5rem;
    }
    
    .products-cta h2 {
        font-size: 2rem;
    }
    
    .products-cta p {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .products-hero h1 {
        font-size: 2rem;
    }
    
    .category-title {
        font-size: 1.8rem;
    }
    
    .price-amount {
        font-size: 2rem;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .spec-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: slideIn 0.6s ease forwards;
}

/* Stagger animations */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }
.product-card:nth-child(9) { animation-delay: 0.9s; }

/* ========== PRODUCT MODAL ========== */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--product-bg);
    border-radius: var(--radius-lg);
    padding: 3rem;
    border: 1px solid var(--product-border);
    box-shadow: var(--product-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 2;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.product-modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

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