/* SURGE PROTECTOR / ENERTIA - CORE DESIGN SYSTEM 2026
   Aesthetic: Industrial Luxury & Technical Precision
*/

:root {
    /* Brand Colors */
    --primary-black: #000000;
    --luxury-gold: #D4AF37;
    --deep-gold: #996515;
    --bg-white: #FFFFFF;
    --slate-light: #f8fafc;
    --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #996515 100%);
    
    /* Functional Colors */
    --text-main: #1a1a1a;
    --text-muted: #64748b;
    --glass-white: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(212, 175, 55, 0.2);
    
    /* Layout Constants */
    --radius-lg: 40px;
    --radius-sm: 15px;
    --transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --gold-glow: 0 10px 40px rgba(212, 175, 55, 0.15);
}

/* ================= RESET & SMOOTHING ================= */
* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }
html { scroll-behavior: smooth; }
body { 
    font-family: 'Inter', sans-serif; 
    color: var(--text-main); 
    background: var(--bg-white); 
    line-height: 1.6; 
    overflow-x: hidden; 
}

/* ================= PERFECT CENTERING OVERLAY ================= */
#loading-overlay {
    position: fixed; inset: 0; background: #fff;
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 0.8s ease;
}
.overlay-content { display: flex; flex-direction: column; align-items: center; }
.loading-logo { width: 100px; margin-bottom: 25px; animation: breathe 2s infinite ease-in-out; }
.overlay-label {
    font-size: 1.1rem; color: var(--luxury-gold); text-transform: uppercase;
    letter-spacing: 12px; text-indent: 12px; /* Mathematically centers the text */
    font-weight: 600;
}

@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ================= NAVIGATION (Glassmorphism) ================= */
.nav {
    position: fixed; width: 100%; top: 0; padding: 25px 8%;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(20px);
    z-index: 1000; border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: var(--transition);
}
.nav.shrink { padding: 15px 8%; box-shadow: 0 10px 40px rgba(0,0,0,0.05); }

.logo { 
    display: flex; align-items: center; font-size: 1.1rem; font-weight: 800; 
    color: var(--primary-black); text-decoration: none; letter-spacing: 2px;
}
.logo-icon { width: 32px; margin-right: 12px; }

.nav-actions { display: flex; align-items: center; gap: 30px; }
.nav-actions a { 
    text-decoration: none; color: var(--primary-black); 
    font-weight: 600; font-size: 0.85rem; transition: 0.3s; 
}
.nav-actions a:hover { color: var(--luxury-gold); }

/* ================= PRODUCT DISPLAY SECTION ================= */
.our-products { padding: 160px 8% 80px; }
.our-products h1 { font-family: 'Poppins'; font-size: 3rem; text-align: center; margin-bottom: 40px; }

.product-filter { text-align: center; margin-bottom: 60px; }
.filter-btn { 
    padding: 12px 28px; 
    border: 1px solid #eee; 
    border-radius: 50px; 
    cursor: pointer; 
    background: #fff; 
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition); 
    color: var(--text-muted);
    flex-shrink: 0; /* CRITICAL: Prevents buttons from shrinking on mobile */
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.filter-btn.active { 
    background: var(--primary-black); 
    color: #fff; 
    border-color: var(--primary-black);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.filter-btn:hover:not(.active) { 
    border-color: var(--luxury-gold); 
    color: var(--luxury-gold); 
    transform: translateY(-2px);
}

/* ================= PRODUCT CARDS ================= */
/* Ensure the grid and cards have a high-end feel */
.product-cards {
display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.product-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease;
    display: flex;
    flex-direction: column;
    position: relative !important;
    overflow: visible;
}

/* The Centered Image Container */
.card-image {
    height: 400px; /* Increased from 320px to give more vertical room */
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 10px; /* Reduced outer padding to let image expand */
}

.card-image img {
    width: 100%; /* Increased from 95% to fill width */
    height: 100%; /* Increased from 95% to fill height */
    object-fit: contain; /* Keeps the technical details clear without cropping */
    padding: 10px; /* Minimal padding for a "Full-Bleed" luxury look */
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Optional: If you want the images to pop even more on hover */
.product-card:hover .card-image img {
    transform: scale(1.15); /* Slightly more aggressive zoom for impact */
}

/* Hover Effects */
.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.08);
}

.card-content { padding: 30px; text-align: center; flex-grow: 1; }
.badge { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: var(--luxury-gold); 
    color: #fff; 
    padding: 8px 16px; 
    border-radius: 50px; 
    font-size: 0.65rem; 
    font-weight: 800; 
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 50; /* Ensures it sits on top of the image */
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    pointer-events: none; /* Prevents badge from interfering with clicks */
}
.price-tag { font-size: 1.5rem; font-weight: 700; color: var(--primary-black); margin: 15px 0; }

/* ================= CHECKOUT LAYOUT ================= */
.order-form-section { background: var(--slate-light); padding: 100px 8%; }

.order-layout { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 80px; 
    align-items: start; 
    max-width: 1400px; 
    margin: 0 auto;
}

.form-container { 
    background: #fff; border-radius: var(--radius-lg); padding: 60px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.02);
}

.form-container h2 { margin-bottom: 40px; font-size: 2rem; }

/* Visual Form Inputs */
.form-container label { display: block; margin-bottom: 10px; font-weight: 600; font-size: 0.9rem; }
.form-container input, .form-container select {
    width: 100%; padding: 16px 20px; border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0; margin-bottom: 30px; font-family: inherit;
    transition: 0.3s; background: #fcfcfc;
}
.form-container input:focus { 
    border-color: var(--luxury-gold); background: #fff;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1); 
}

/* ================= LUXURY ACTION BUTTONS ================= */
.btn-primary, #submitOrderBtn {
    /* Use !important to override the style="width:100%" and other inline tweaks */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    
    /* Shape & Background */
    background: var(--gold-gradient) !important;
    color: white !important;
    padding: 16px 35px !important;
    border-radius: 50px !important; /* Changed from 4px to 50px for the Luxury Pill shape */
    border: none !important;
    
    /* Typography */
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    font-size: 0.85rem !important;
    
    /* Effects & Transitions */
    cursor: pointer !important;
    overflow: hidden !important;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 10px 30px rgba(197, 160, 89, 0.3) !important;
    z-index: 1 !important;
    text-decoration: none !important;
}

/* The Cinematic Sweep Animation */
.btn-primary::before, #submitOrderBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    transition: 0.5s;
    z-index: -1;
}

.btn-primary:hover, #submitOrderBtn:hover:not(:disabled) {
    transform: translateY(-5px) !important;
    box-shadow: 0 20px 40px rgba(197, 160, 89, 0.5) !important;
    letter-spacing: 3px !important;
}

.btn-primary:hover::before, #submitOrderBtn:hover:not(:disabled)::before {
    left: 100%;
}

/* SQL Button Logic - Matches the Slate theme */
#submitOrderBtn:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ================= DYNAMIC PREVIEW ================= */
.product-preview { 
    position: sticky; top: 140px; 
    padding: 40px; border-radius: var(--radius-lg);
    background: #fff; border: 1px solid #eee;
    text-align: center; min-height: 500px;
    display: flex; flex-direction: column; justify-content: center;
}
.preview-img { 
    max-height: 450px; /* Increased from 300px to match the new scale */
    object-fit: contain; 
    margin-bottom: 30px; 
}

/* ================= FOOTER ================= */
.site-footer {
    padding: 80px 8% 40px; text-align: center;
    border-top: 1px solid #f0f0f0; background: #fff;
}
.site-footer p { color: var(--text-muted); font-size: 0.9rem; }


.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.success-card {
    background: #fff;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.success-overlay.active { display: flex; opacity: 1; }
.success-overlay.active .success-card { transform: translateY(0); }

.success-icon {
    width: 80px;
    height: 80px;
    background: #f0fff4;
    color: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon svg { width: 40px; }

.referral-box {
    background: #fff8e7; /* Very light gold tint */
    padding: 20px;
    border-radius: 15px;
    border: 2px dashed var(--luxury-gold);
    margin: 25px 0;
    background-image: linear-gradient(rgba(212, 175, 55, 0.05), rgba(212, 175, 55, 0.05));
}

.referral-box strong {
    font-size: 1.6rem; 
    color: var(--primary-black); /* Changed from var(--primary) */
    letter-spacing: 3px;
    display: block;
    margin-top: 5px;
}

/* Add "Punch-holes" to the sides for a ticket look */
.referral-box::before, .referral-box::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff; /* Matches card background */
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}
.referral-box::before { left: -12px; }
.referral-box::after { right: -12px; }

.referral-box span { display: block; font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); }
.referral-box strong { font-size: 1.4rem; color: var(--primary); letter-spacing: 2px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
    .product-preview {
        position: relative;
        top: 0;
        min-height: auto;
        margin-top: 30px;
        order: -1; /* This moves the "Order Summary" ABOVE the form on mobile */
        border: 2px solid var(--luxury-gold); /* Highlight it as the important part */
    }
}

@media (max-width: 900px) {
    /* Navigation Engine */
    .nav-toggle { display: flex !important; flex-direction: column; gap: 5px; cursor: pointer; z-index: 2000; }
    .nav-toggle span { width: 25px; height: 3px; background: var(--primary-black); transition: 0.3s; }
    
    .nav-actions {
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: rgba(255,255,255,0.98); display: flex !important;
        flex-direction: column; align-items: center; justify-content: center;
        transform: translateY(-100%); transition: var(--transition);
        opacity: 0; visibility: hidden; z-index: 1500;
             padding: 20px;
    }

    .nav-actions.active { transform: translateY(0); opacity: 1; visibility: visible; }
    
    .nav-actions a { font-size: 1.5rem; margin: 15px 0 !important; margin-left: 0 !important; }

    /* Product Grid & Header Adjustments */
    .our-products h1 { font-size: 2.2rem; }
.product-filter {
    text-align: center;
    margin-bottom: 60px;
    display: flex;
    justify-content: center; /* Centered on Desktop */
    gap: 12px;
    padding: 10px 8%;
    overflow-x: auto; /* Allows scrolling on mobile */
    white-space: nowrap; /* Prevents buttons from wrapping to new lines */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.product-filter {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide Scrollbar for a cleaner look while keeping functionality */
.product-filter::-webkit-scrollbar {
    display: none;
}
    .filter-btn { white-space: nowrap; flex-shrink: 0; }
    
    .order-layout { grid-template-columns: 1fr; }

    /* Prevent the logo from being squeezed */
    .logo { font-size: 0.9rem; }
    .logo-icon { width: 28px; }

    /* Fix the Product Grid for narrow screens */
    .product-cards {
        grid-template-columns: 1fr; /* Force single column earlier for luxury spacing */
        gap: 20px;
    }

    /* Adjust Card Image height for mobile so it doesn't take up the whole screen */
    .card-image {
        height: 280px; 
        position: relative;
    z-index: 1;
    }

    /* Ensure the form doesn't feel cramped */
    .form-container {
        padding: 40px 20px;
        border-radius: 25px; /* Slightly tighter radius for mobile */
    }

    .form-container h2 {
        font-size: 1.5rem;
    }

}

/* X-Animation for Hamburger */
.nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ================= MOBILE ADAPTATION ================= */
@media (max-width: 768px) {
    .product-filter {
        justify-content: flex-start; /* Align left so user knows to scroll */
        padding: 10px 20px;
        margin-bottom: 40px;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .products-container {
        position: relative;
    }
    /* Subtle fade indicator */
    .products-container::after {
        content: '';
        position: absolute;
        top: 0; right: 0;
        height: 50px; /* Match filter height */
        width: 40px;
        background: linear-gradient(to right, transparent, #fff);
        pointer-events: none;
    }
}
@media (max-width: 900px) {
    .badge {
        top: 10px;
        right: 10px;
        padding: 5px 12px;
        font-size: 0.6rem;
    }
}