/* ===== BASE STYLES ===== */
:root {
    --primary: #1a73e8;
    --dark: #2d3748;
    --text: #333;
    --light: #f8fafc;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
    padding: 0;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    font-weight: 400;
}

/* ===== NAVIGATION SYSTEMS ===== */
/* ===== NAVBAR ===== -------------------------------------------------------------------------------------*/
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        transform: translateX(-100%);
        transition: var(--transition);
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-menu a::after {
        display: none;
    }
}

/* Desktop Sidebar*/
.product-sidebar {
    position: fixed;
    left: 20px;
    top: 120px; 
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 90;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    width: 180px;
} 

.product-sidebar h4 {
    margin-bottom: 1rem;
    color: #2d3748;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.product-sidebar a {
    display: block;
    padding: 0.6rem 0;
    color: #4a5568;
    text-decoration: none;
    border-bottom: 1px solid #f8f8f8;
    transition: all 0.2s ease;
}

.product-sidebar a:hover {
    color: #1a73e8;
    padding-left: 5px;
}

.product-sidebar a.active {
    color: #1a73e8;
    font-weight: 600;
    border-left: 3px solid #1a73e8;
    padding-left: 10px;
}

/* Mobile Drawer*/
.drawer-toggle {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #1a73e8;
    color: white;
    border: none;
    padding: 1rem;
    z-index: 95;
    font-size: 1rem;
    cursor: pointer;
    display: none; /* Hidden by default */
}

.product-drawer {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: white;
    padding: 1.5rem;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    transition: bottom 0.3s ease-out;
    z-index: 90;
    max-height: 50vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.product-drawer.show {
    bottom: 50px; /* Matches toggle height */
}

.product-drawer a {
    padding: 0.8rem;
    background: #f8f8f8;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    color: #2d3748;
    transition: all 0.2s ease;
}

.product-drawer a:hover {
    background: #e2e8f0;
}

.product-drawer a.active {
    background: #1a73e8;
    color: white;
}

/* Floating Navigation*/
.floating-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-btn {
    padding: 8px 15px;
    border-radius: 50px;
    background: #1a73e8;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-btn:hover {
    background: #1557b0;
    transform: translateY(-2px);
}

/* Responsive Adjustments - CRITICAL */
@media (max-width: 1023px) {
    .product-sidebar {
        display: none; /* Hide sidebar on mobile */
    }
    .drawer-toggle {
        display: block; /* Show mobile toggle */
    }
    main {
        margin-left: 0 !important; /* Remove sidebar offset */
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .product-drawer {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .floating-nav {
        width: 95%;
    }
    .nav-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .nav-btn i {
        display: none; /* Hide icons on smallest screens */
    }
}

/* ===== PRODUCT CONTAINER ===== */
.product-container {
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 5rem auto 0 auto;
    padding: 0;
}

/* Gallery Section */
.product-gallery {
    order: 1; /* Moves gallery to top on mobile */
    width: 100%;
    padding: 1rem;
    margin-bottom: 100px;
}

.main-image {
    background: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 1rem;
    aspect-ratio: 1/1; /* Ensures square container */
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.thumbnails img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.thumbnails img:hover,
.thumbnails img:active {
    border-color: #1a73e8;
}

/* Product Info Section */
.product-info {
    order: 2;
    width: 100%;
    padding: 1.5rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.product-header h1 {
    font-size: 1.8rem;
    margin: 0;
    color: #2d3748;
}

.back-link {
    color: #1a73e8;
    font-size: 0.9rem;
    text-decoration: none;
}

.spec-highlights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
}

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

.spec-label {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 0.3rem;
}

.spec-value {
    font-weight: 600;
    color: #2d3748;
}

.detailed-specs {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.detailed-specs td {
    padding: 0.8rem 0;
    border-bottom: 1px solid #edf2f7;
}

.detailed-specs tr:last-child td {
    border-bottom: none;
}

.detailed-specs td:first-child {
    color: #718096;
    width: 40%;
}

/* CTA Buttons */
.cta-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 4rem;
    position: sticky;
    bottom: 80px; /* Above floating nav */
    background: white;
    padding: 1rem 0;
    z-index: 80;
}

.cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cta-button.primary {
    background: #1a73e8;
    color: white;
}

.cta-button.secondary {
    background: white;
    color: #1a73e8;
    border: 1px solid #1a73e8;
}

/* ===== MEDIA QUERIES ===== */
@media (min-width: 768px) {
    .product-container {
        flex-direction: row;
        padding: 2rem;
    }
    
    .product-gallery {
        width: 50%;
        order: 0;
        padding-right: 2rem;
        position: sticky;
        top: 120px;
        align-self: flex-start;
    }
    
    .product-info {
        width: 50%;
        padding: 0 0 0 2rem;
    }
    
    .cta-container {
        grid-template-columns: 1fr 1fr;
        position: static;
        background: transparent;
        padding: 0;
    }
}

@media (min-width: 1024px) {
    .product-gallery {
        width: 60%;
    }
    
    .product-info {
        width: 40%;
    }
}