/* --- 1. GLOBAL VARIABLES & RESET --- */
:root {
    /* Colors */
    --bg-body: #f8f9fa; /*Main page background*/
    --bg-white: #ffffff;    /*card and surface background*/
    --text-main: #334155;   /*Normal paragraph text*/
    --text-heading: #0f172a;    /*headings and strong text*/
    --accent-primary: #ffc107; /* Gold */ /*Highlight, brand color*/
    --accent-secondary: #0b212d; /* Blue */ /*secondary band color*/
    --overlay-dark: rgba(11, 33, 45, 0.85);

    /* Motion */
    --ease-luxury: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --header-height: 80px;
    --nav-sub-height: 60px;
    --container-width: 1100px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--nav-sub-height) + 20px);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--text-heading); font-weight: 700; }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

/* --- 2. MAIN NAVBAR (Fixed) --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar .container {
    max-width: 1000px;
    width: 100%;
}

.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-heading); }
.logo span { color: var(--accent-primary); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active-page { color: var(--accent-primary); }

/* --- 3. PRODUCTS HERO --- */
.products-hero {
    height: 50vh;
    min-height: 350px;
    background-image: url('../../images/B_prod.png');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    color: white;
    padding-top: var(--header-height);
}

.products-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--overlay-dark);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 { font-size: 3rem; margin-bottom: 1rem; color: white; }
.hero-content p { font-size: 1.2rem; opacity: 0.9; }

/* --- 4. STICKY SUB-NAV --- */
.sticky-product-nav {
    position: sticky;
    top: var(--header-height);
    height: var(--nav-sub-height);
    background: white;
    z-index: 900;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border-bottom: 1px solid #eee;
    display: flex;
    overflow: visible;
    align-items: center;
    transition: all 0.3s ease;
}

.product-nav-inner {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

@media (max-width: 768px) {
    .product-nav-inner {
        justify-content: flex-start;
        min-width: max-content;
    }

    .p-nav-link {
        white-space: nowrap;
    }
}

.p-nav-link {
    font-weight: 600;
    color: #64748b;
    padding: 0.5rem 0;
    position: relative;
    cursor: pointer;
}

.p-nav-link:hover { color: var(--text-heading); }
.p-nav-link.active { color: var(--accent-secondary); }

.p-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-primary);
}

/* --- 5. SMART EXPAND CARD SYSTEM --- */
.product-category { padding: 80px 0; border-bottom: 1px solid #eee; }

.category-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-secondary);
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    transition: all 0.3s var(--ease-luxury);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.product-card:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #e2e8f0;
}

/* --- Card Top: Always Visible --- */
.pc-visible-row {
    display: flex;
    align-items: stretch;
    min-height: 280px; /* Increased slightly for variant grid */
}

.pc-image {
    width: 30%;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}

.pc-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.6s var(--ease-luxury);
}

/* Loading state for images */
.pc-image img.loading {
    opacity: 0.5;
    filter: blur(5px);
}

.pc-info {
    width: 70%;
    padding: 2.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.pc-header h3 { font-size: 1.5rem; margin: 0; color: var(--text-heading); }

.pc-price {
    background: #fffbeb;
    color: #b45309;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 1.1rem;
    white-space: nowrap;
}

.quote-btn {
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.quote-btn:hover {
    background: var(--accent-primary);
    color: var(--text-heading);
    transform: translateY(-2px);
}

/* --- VARIANT SELECTOR STYLES (NEW) --- */
.variant-wrapper {
    margin-bottom: 1.5rem;
}

.variant-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

.variant-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.variant-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.variant-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--text-heading);
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Short Specs (Fade out on expand) */
.pc-short-specs {
    display: flex;
    gap: 2rem;
    margin-top: auto;
    margin-bottom: 1rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.short-spec {
    display: flex;
    flex-direction: column;
}

.short-spec span.label { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; }
.short-spec span.val { font-weight: 600; color: var(--text-heading); }

.view-details-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-details-btn span { transition: transform 0.3s ease; }

/* --- Card Bottom: The Accordion --- */
.pc-accordion-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s var(--ease-luxury);
    background: #fafbfc;
    border-top: 1px solid transparent;
}

.pc-accordion-inner {
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

.pc-details-grid {
    padding: 2.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr; /* Table takes more space */
    gap: 3rem;
}

/* Specs Table Styling */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.specs-table th, .specs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.specs-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    width: 40%;
}

.specs-table tr:last-child td, .specs-table tr:last-child th { border-bottom: none; }
.specs-table tr:nth-child(even) { background-color: #fcfcfc; }

/* Highlight for dynamic row */
.spec-power {
    font-weight: 700;
    color: var(--accent-secondary);
    transition: color 0.3s ease;
}

/* Features List */
.features-list h4 { font-size: 1.1rem; margin-bottom: 1rem; }
.features-list ul { padding-left: 1.2rem; }
.features-list li {
    list-style: disc;
    margin-bottom: 0.5rem;
    color: #475569;
}
.features-list li::marker { color: var(--accent-primary); }

/* --- EXPANDED STATE CLASSES --- */
.product-card.expanded {
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
}

.product-card.expanded .pc-short-specs {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.product-card.expanded .pc-accordion-wrapper {
    grid-template-rows: 1fr;
    border-top-color: #f1f5f9;
}

.product-card.expanded .pc-accordion-inner {
    opacity: 1;
    transform: translateY(0);
}

.product-card.expanded .view-details-btn span {
    transform: rotate(180deg);
}

.product-card.expanded .pc-image img {
    transform: scale(1.05);
}

/* --- FOOTER & COPYRIGHT FIX --- */
footer {
    background-color: var(--text-heading);
    color: #94a3b8;
    padding: 4rem 0 2rem;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.footer-logo span { color: var(--accent-primary); }

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links a:hover { color: var(--accent-primary); }

.copyright {
    font-size: 0.875rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    margin-top: 2rem;
    display: block;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .navbar .nav-links { display: none; }
    .sticky-product-nav { overflow-x: auto; justify-content: flex-start; padding: 0 1rem;-webkit-overflow-scrolling: touch;}
    
    .pc-visible-row { flex-direction: column; }
    .pc-image { width: 100%; height: 300px; }
    .pc-info { width: 100%; padding: 1.5rem; }
    
    .pc-header { flex-direction: column; gap: 0.5rem; }
    .pc-short-specs { flex-wrap: wrap; gap: 1rem; }
    
    .pc-details-grid { grid-template-columns: 1fr; gap: 2rem; padding: 1.5rem; }
    
    /* Scrollable Table on Mobile */
    .table-wrapper { overflow-x: auto; }
    .specs-table { min-width: 400px; }
}

/* ================= MOBILE NAV ================= */

.hamburger {
    display: none;
    position: relative;
    z-index: 1001; /* above navbar */
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px 0;
    background: var(--text-heading);
}


/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 998;
}

/* Drawer */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: white;
    z-index: 999;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: right 0.3s ease;
}

.mobile-menu a {
    font-size: 1.1rem;
    font-weight: 600;
}

.close-menu {
    align-self: flex-end;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* Active state */
.menu-open .mobile-menu {
    right: 0;
}

.menu-open .mobile-menu-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Scroll lock */
body.menu-open {
    overflow: hidden;
}

/* Mobile only */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .hamburger {
        display: block;
    }
}


@media (max-width: 768px) {
    .products-hero {
        height: 40vh;          /* Fix crushed hero */
        min-height: 260px;
        padding-top: calc(var(--header-height) + 10px);
        background-attachment: scroll;
    }

    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-content p {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .category-header h2 {
        font-size: 1.6rem;     /* Reduced from 2rem */
    }

    .category-header p {
        font-size: 0.95rem;
    }
}


/* =========================================
   MOBILE GRID PRODUCT NAV (2x2 layout)
========================================= */
@media (max-width: 768px) {

    /* reduce heights */
    :root {
        --header-height: 60px;
        --nav-sub-height: 90px;
    }

    /* make subnav taller for grid */
    .sticky-product-nav {
        height: auto;
        padding: 8px 0;
    }

    /* turn row → grid */
    .product-nav-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    /* style each button nicely */
    .p-nav-link {
        text-align: center;
        padding: 8px 6px;
        font-size: 0.9rem;
        background: #f1f5f9;
        border-radius: 6px;
        font-weight: 600;
    }

    .p-nav-link.active {
        background: var(--accent-primary);
        color: var(--text-heading);
    }

    /* remove underline bar (not needed in grid) */
    .p-nav-link.active::after {
        display: none;
    }
}

.disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 1rem;
}
