/* --- VARIABLES & THEME --- */
:root {
    --primary: #151845;        /* Deep Navy */
    --primary-light: #1e2360;
    --secondary: #F58220;      /* Orange */
    --secondary-light: #ff9a42;
    --secondary-dark: #d46e15;
    --white: #FFFFFF;
    --light: #F8F9FC;
    --gray-100: #F1F3F8;
    --gray-200: #E2E6EF;
    --gray-500: #6B7280;
    --text-main: #374151;
    
    --shadow-sm: 0 1px 3px rgba(21,24,69,0.08);
    --shadow-md: 0 4px 16px rgba(21,24,69,0.1);
    --shadow-lg: 0 10px 40px rgba(21,24,69,0.12);
    --shadow-xl: 0 20px 60px rgba(21,24,69, 0.15);
}

/* --- GLOBAL RESET --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
    scroll-behavior: smooth; 
}

html, body {
    width: 100%; /* Ensures no white space on left/right */
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevents horizontal scroll */
}

body { 
    background-color: var(--light); 
    color: var(--text-main); 
    line-height: 1.6; 
    
    /* CRITICAL: Pushes content down so it doesn't hide behind the fixed header */
    padding-top: 80px; 
}

/* --- UTILITIES --- */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    width: 100%; 
}

.section-padding { 
    padding: 80px 0; 
}

.grid-2 { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 40px; 
}

.grid-3 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; 
}

.grid-4 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 24px; 
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px;
    padding: 14px 32px; 
    border-radius: 50px; 
    font-weight: 600; 
    font-size: 15px;
    text-decoration: none; 
    transition: all 0.3s; 
    border: none; 
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--white);
    box-shadow: 0 4px 10px rgba(245,130,32,0.2);
}

.btn-primary:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 25px rgba(245,130,32,0.4); 
}

.btn-outline {
    background: transparent; 
    border: 2px solid var(--primary); 
    color: var(--primary);
}

.btn-outline:hover { 
    background: var(--primary); 
    color: var(--white); 
}

/* --- NAVIGATION (Fixed Header) --- */
.main-navbar {
    position: fixed; /* LOCKS TO TOP */
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85); /* Glass effect background */
    backdrop-filter: blur(12px); /* Glass effect */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    z-index: 1000; /* Sits on top of content */
    transition: all 0.3s ease;
}

.nav-inner {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 0;
    width: 100%;
}

/* Mobile Fix: Ensure Toggler stays inside */
@media (max-width: 768px) {
    .nav-inner {
        position: relative; /* Needed for absolute positioning of toggle */
        justify-content: flex-start;
        padding-right: 60px; /* Space for the button */
        padding-left: 0;
    }
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.nav-brand-icon-img {
    height: 50px; 
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
}

.nav-brand-name {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
    text-transform: uppercase;
}

.nav-brand-name span {
    color: var(--secondary);
}

.nav-brand-tagline {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Desktop Nav Links */
.nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--secondary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary);
    transition: width 0.3s;
}

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

/* Hamburger Menu (Hidden on Desktop) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

/* --- PRELOADER --- */
#preloader {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: var(--primary); 
    z-index: 99999; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden { 
    opacity: 0; 
    visibility: hidden; 
}

.preloader-logo-link {
    display: block;
    width: 100px; 
    height: 100px; 
    margin-bottom: 20px;
    animation: pulseLogo 2s infinite;
}

.preloader-logo-link img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
}

.preloader-text { 
    color: white; 
    font-weight: 700; 
    font-size: 18px; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
}

.spinner { 
    width: 40px; 
    height: 40px; 
    border: 4px solid rgba(255,255,255,0.1); 
    border-top: 4px solid var(--secondary); 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
    margin-top: 20px; 
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); }
}

@keyframes pulseLogo { 
    0%, 100% { transform: scale(1); } 
    50% { transform: scale(1.05); }
}

/* --- ANNOUNCEMENT BAR --- */

.announcement-bar {
    position: fixed !important;
    top: 80px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 40px !important;

    background: red !important;
    color: white !important;

    z-index: 1002 !important;

    display: flex !important;
    align-items: center !important;
}

.announcement-bar .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.marquee-content {
    display: flex;
    gap: 50px;
    white-space: nowrap;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Push page content below the bar */
body {
    padding-top: 40px;
}

/* --- HERO SECTION --- */
.hero-full {
    position: relative;
    min-height: 80vh; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    overflow: hidden;
    padding-top: 80px; 
}

.hero-bg-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/chemistryinnovative.jpg');
    background-size: cover;
    background-position: center;
    filter: blur(5px); 
    transform: scale(1.1);
    z-index: -2; 
    opacity: 0.9;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
}

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

/* --- CARDS --- */
.card {
    background: var(--white); 
    border-radius: 20px; 
    padding: 30px;
    box-shadow: var(--shadow-sm); 
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
    height: 100%; 
    display: flex;
    flex-direction: column;
}

.card:hover { 
    transform: translateY(-5px); 
    box-shadow: var(--shadow-md); 
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white); 
    border: 1px solid rgba(255,255,255,0.2); 
}

/* --- FORMS --- */
.form-control {
    width: 100%; 
    padding: 14px; 
    border: 2px solid var(--gray-200); 
    border-radius: 12px; 
    margin-bottom: 20px;
    font-family: inherit; 
    transition: 0.3s;
}

.form-control:focus { 
    outline: none; 
    border-color: var(--secondary); 
    background: var(--white); 
    color: var(--text-main); 
}

/* --- FAQ SECTION --- */
.faq-item {
    cursor: pointer;
}

.faq-item h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-top: 0;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
}

.faq-item.active h3 i {
    transform: rotate(180deg);
}

/* --- FOOTER --- */
.comprehensive-footer {
    background: var(--primary);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 50px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--white);
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--secondary);
}

.footer-brand-desc {
    font-size: 14px; 
    color: rgba(255,255,255,0.6); 
    margin-top: 20px; 
}

.footer-social { 
    display: flex; 
    gap: 15px; 
    margin-top: 20px;
}

.footer-social a {
    width: 40px; 
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: white; 
    transition: 0.3s;
}

.footer-social a:hover { 
    transform: translateY(-3px); 
    background: var(--secondary); 
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
}

.payment-methods {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mpesa-badge {
    background: #4CAF50;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

/* --- WHATSAPP WIDGET (Fixed at Bottom) --- */
.wa-widget-container {
    position: fixed; /* LOCKS TO BOTTOM RIGHT */
    bottom: 30px;
    right: 30px;
    z-index: 10000; /* Highest Z-Index */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wa-menu {
    background: var(--white);
    border-radius: 15px;
    padding: 15px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 15px;
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    position: absolute;
    bottom: 60px;
    right: 0;
    z-index: 10001;
}

.wa-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wa-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 16px;
}

.btn-wa-menu {
    background: var(--white); 
    color: var(--primary); 
    width: 100%;
    padding: 12px; 
    border-radius: 10px; 
    text-align: left; 
    margin-bottom: 8px;
    border: 1px solid var(--gray-200); 
    transition: 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-wa-menu:hover { 
    background: var(--light); 
    border-color: var(--secondary); 
    padding-left: 20px; 
}

.wa-button {
    background: #25D366;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wa-button:hover {
    transform: scale(1.1);
}

.wa-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: red;
    color: white;
    font-size: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* --- GLASSMORPHISM STYLES --- */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.glass-card-dark {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.hero-counter-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 20px 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 150px;
}

/* --- RESPONSIVE STYLES --- */

/* Tablet Adjustments */
@media (max-width: 992px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    
    /* 1. Reduce body padding for smaller mobile header */
    body {
        padding-top: 70px; 
    }

    /* 2. Mobile Menu Dropdown */
    .nav-links {
        position: absolute;
        top: 100%; /* Starts below header */
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        box-shadow: var(--shadow-md);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        max-height: 0;
        overflow: hidden;
        z-index: 1002; /* Higher than nav (1000) */
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        max-height: 400px;
    }

    /* 3. Toggle Button Positioning */
    .menu-toggle {
        display: block;
        position: absolute; 
        right: 20px; 
        top: 50%;
        transform: translateY(-50%);
        z-index: 1003;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        color: var(--primary);
        cursor: pointer;
    }

    .close-menu-btn {
        display: block;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        color: var(--primary);
        align-self: flex-end;
        padding: 10px 20px;
        cursor: pointer;
    }
    
    /* 4. Hero Adjustments */
    .hero-full {
        min-height: 70vh;
        padding-top: 60px; 
        text-align: center;
    }
    
    .hero-content h1 { 
        font-size: 2.5rem; 
    }
    
    .hero-content p { 
        font-size: 1rem; 
    }

    /* 5. Grid Adjustments */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important; 
        gap: 20px;
    }
    
    /* 6. Footer Adjustments */
    .footer-top {
        grid-template-columns: 1fr !important; 
        gap: 30px;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* 7. Button Adjustments */
    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    /* 8. WhatsApp Adjustments */
    .wa-widget-container {
        bottom: 20px;
        right: 20px;
    }
}