/* ==========================================================================
    VANILLA CSS - OPTIMIZED FOR PAGE SPEED (NO FRAMEWORKS)
    ========================================================================== */

/* CSS Variables for consistent theming */
:root {
    --primary-blue: #004b87;
    --secondary-blue: #0073e6;
    --accent-orange: #ff6b00;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --success-green: #28a745;
    --max-width: 1200px;
    --transition: all 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--primary-blue);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-blue);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Utility */
.container {
    width: 90%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.py-4 { padding: 4rem 0; }

/* Typography */
h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; position: relative; padding-bottom: 10px; }
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-orange);
}
.text-center h2::after { left: 50%; transform: translateX(-50%); }
h3 { font-size: 1.5rem; font-weight: 600; }

p { margin-bottom: 1rem; color: var(--text-light); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-orange);
    color: var(--white) !important;
}

.btn-primary:hover {
    background-color: #e65c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-blue);
    color: var(--white) !important;
}

.btn-secondary:hover {
    background-color: var(--primary-blue);
}

/* Top Bar */
.top-bar {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 10px 0;
    font-size: 0.9rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.top-bar-contact a {
    color: var(--white);
    margin-right: 15px;
    font-weight: 600;
}

.top-bar-badges span {
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: 10px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Header / Nav */
header {
    background: transparent;
    box-shadow: none;
    position: absolute; /* Detaches header so hero image sits underneath it */
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    position: fixed;
    top: 0;
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
    transition: var(--transition);
}

header.scrolled .navbar {
    padding: 10px 0;
}

/* --- Logo Styles --- */
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--white); /* White text to stand out against hero image */
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.logo span {
    color: var(--white);
    transition: var(--transition);
}

.logo svg {
    stroke: var(--white);
    transition: var(--transition);
}

.logo img {
    max-height: 85px;
    width: auto;
    transition: all 0.3s ease;
    /* Turns the logo completely white initially */
    filter: brightness(0) invert(1);
}

/* Change logo back to brand colours when scrolling */
header.scrolled .logo { color: var(--primary-blue); }
header.scrolled .logo span { color: var(--secondary-blue); }
header.scrolled .logo svg { stroke: var(--secondary-blue); }

/* Shrink logo and revert to original colors when user scrolls */
header.scrolled .logo img {
    max-height: 55px;
    /* Removes the white filter, bringing back the brand colors */
    filter: none;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    color: var(--white); /* White text initially */
    transition: var(--transition);
}

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

/* Change nav text to dark grey when scrolling */
header.scrolled .nav-links a {
    color: var(--text-dark);
}

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

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

header.scrolled .mobile-menu-btn {
    color: var(--primary-blue);
}

/* --- Navigation Dropdown Styles --- */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 230px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    border-radius: 4px;
    top: 100%;
    left: 0;
    overflow: visible; /* Changed to visible for sub-dropdowns */
    border-top: 3px solid #ff6b00;
}

.dropdown-menu a {
    color: #333333 !important;
    padding: 14px 18px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #f4f7f6;
    color: #0073e6 !important;
    padding-left: 25px; /* Adds a nice sliding effect on hover */
}

.nav-dropdown:hover > .dropdown-menu {
    display: block;
}

/* --- Sub-Dropdown Styles --- */
.sub-dropdown {
    position: relative;
}

.sub-dropdown-menu {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 320px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 1001;
    border-radius: 4px;
    top: 0;
    left: 100%;
    border-top: 3px solid #ff6b00;
    margin-left: 2px;
}

.sub-dropdown:hover > .sub-dropdown-menu {
    display: block;
}

.sub-dropdown-menu a {
    font-size: 0.9rem;
}

/* Hero Section */
.hero {
    /* Using local image as requested for your server test, turned down blue overlay to 0.45 */
    background: linear-gradient(rgba(0, 75, 135, 0.45), rgba(0, 75, 135, 0.45)), url('km-watermains-hero.jpg') center/cover;
    color: var(--white);
    padding: 9rem 0 6rem 0; /* Increased top padding so text clears the newly transparent header */
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    max-width: 800px;
    margin-bottom: 20px;
}

.hero p {
    color: #e0e0e0;
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 30px;
}

.hero-usps {
    margin-bottom: 30px;
}

.hero-usps li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.hero-usps svg {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    fill: var(--accent-orange);
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Trust Banner */
.trust-banner {
    background: var(--bg-light);
    padding: 30px 0;
    border-bottom: 1px solid #ddd;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: center;
}

.trust-item h4 {
    color: var(--primary-blue);
    font-size: 1.2rem;
    margin-bottom: 5px;
}
.trust-item p { margin: 0; font-size: 0.9rem; }

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-top: 3rem;
}

.service-card {
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: var(--secondary-blue);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.service-icon svg {
    width: 30px;
    height: 30px;
    fill: var(--secondary-blue);
}

/* Promo Section */
.promo-section {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.promo-section h2 { color: var(--white); }
.promo-section h2::after { 
    background: var(--white); 
    left: 50%; 
    transform: translateX(-50%); 
}
.promo-section p { color: #f0f0f0; max-width: 700px; margin: 0 auto 2rem; font-size: 1.1rem; }

.promo-box {
    background: rgba(255,255,255,0.1);
    border: 2px dashed var(--accent-orange);
    padding: 20px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 2rem;
}

.promo-box h3 { color: var(--accent-orange); margin: 0; font-size: 2rem; }

/* Split Section (About) */
.split-section {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 5rem 0;
}

.split-content { flex: 1; }
.split-image { flex: 1; }

.split-image img {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.check-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    color: var(--text-dark);
    font-weight: 500;
}

.check-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--success-green);
    font-weight: bold;
    font-size: 1.2rem;
}

/* --- Meet The Team Styles --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 2rem;
}
.team-card {
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #0073e6;
}
.team-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    border: 4px solid #f4f7f6;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.team-card .check-list {
    text-align: left;
    margin-top: 20px;
    display: inline-block;
}

/* --- Accreditations Section Styles --- */
.accreditations-section {
    background-color: var(--white);
    padding: 3rem 0 5rem 0;
}
.accreditations-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.accreditations-grid img {
    max-height: 80px;
    width: auto;
    opacity: 0.85;
    transition: var(--transition);
}
.accreditations-grid img:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Footer */
footer {
    background-color: #1a1a1a;
    color: #cccccc;
    padding: 4rem 0 2rem;
}


.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 2rem;
}

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

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

.footer-links a {
    color: #cccccc;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    font-size: 0.9rem;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    animation: whatsapp-pulse 2s infinite;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
    animation: none; /* Stops pulsing when the user hovers over it */
}

.whatsapp-float svg {
    width: 35px;
    height: 35px;
    fill: white;
}

/* Subtle Pulsating Animation for WhatsApp Button */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 2px 2px 10px rgba(0,0,0,0.2), 0 0 0 0 rgba(37, 211, 102, 0.6);
    }
    70% {
        box-shadow: 2px 2px 10px rgba(0,0,0,0.2), 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 2px 2px 10px rgba(0,0,0,0.2), 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .split-section { flex-direction: column; }
    .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    .nav-links.active { display: flex; }
    .nav-links a { color: var(--text-dark) !important; } /* Ensures mobile dropdown is always readable */
    .mobile-menu-btn { display: block; }
    .top-bar-badges { display: none; }
    .top-bar .container { justify-content: center; }
    .hero { padding: 7rem 0 4rem 0; }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }

    /* From Index - Mobile Adjustments */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        display: none;
        padding-left: 15px;
        border-left: 2px solid #ff6b00;
        border-top: none;
        margin-top: 10px;
        background-color: transparent;
    }
    .nav-dropdown:hover > .dropdown-menu,
    .nav-dropdown:active > .dropdown-menu {
        display: block;
    }
    
    .sub-dropdown-menu {
        position: static;
        box-shadow: none;
        display: none;
        padding-left: 15px;
        border-left: 2px solid #0073e6;
        border-top: none;
        margin-top: 0;
        background-color: transparent;
    }
    .sub-dropdown:hover > .sub-dropdown-menu,
    .sub-dropdown:active > .sub-dropdown-menu {
        display: block;
    }
    .accreditations-grid {
        gap: 30px;
    }
    .accreditations-grid img {
        max-height: 60px;
    }
}