/* --- BRANDING & HEADER --- */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-brand { display: block; align-items: center; gap: 12px; }
.company-name {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: #003366;
    line-height: 1.1;
}
.tagline { font-size: 0.75rem; color: #666; font-weight: 400; }


/* --- AD BAR --- */
.top-ad-bar { background: #f4f4f4; border-bottom: 1px solid #ddd; text-align: center; }
.ad-wrapper img { height: 20px; width: auto; max-width: 100%; }


/* --- DESKTOP NAVIGATION (Reset & Core) --- */
nav ul {
    background: #333333; 
    box-shadow: 0px 4px 9px rgba(0,0,0,0.15);
    padding: 0 15px;
    border-radius: 10px;  
    list-style: none;
    position: relative;
    display: flex; /* CHANGED: Use Flexbox instead of inline-table for stability */
    margin: 0;
}

nav ul li {
    position: relative; /* Essential for dropdown positioning */
}

nav ul li a {
    display: block; 
    padding: 15px 25px; /* Increased padding for better click area */
    color: white; 
    text-decoration: none;
    text-align: left;
    white-space: nowrap; /* Prevents text from wrapping on desktop */
    transition: background 0.3s;
}

nav ul li:hover > a {
    background: #eeeeee;
    color: #333333; /* Darker text when background is light */
}

/* --- DESKTOP DROPDOWNS --- */
@media (min-width: 993px) {
    /* Level 2 Dropdown (.dropdown-content) */
    nav ul .dropdown-content {
        display: none;
        position: absolute;
        top: 100%; /* Sits directly below the parent */
        left: 0;
        background: #a69c9c;
        min-width: 240px;
        z-index: 1001;
        box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    }

    /* Level 3 Dropdown (.sub-dropdown-content) */
    nav ul .sub-dropdown-content {
        display: none;
        position: absolute;
        left: 100%; /* Sits to the right of the parent */
        top: 0;
        background: #8e8484; /* Slightly darker to distinguish levels */
        min-width: 240px;
        z-index: 1002;
    }

    /* Hover Triggers for Desktop */
    nav ul li:hover > .dropdown-content {
        display: block;
    }

    /* Triggering tertiary level when the secondary link is hovered */
    .dropdown-content a.has-sub-dropdown:hover + .sub-dropdown-content,
    .sub-dropdown-content:hover {
        display: block;
    }
}

/* --- MOBILE MENU STYLES (Your working mobile code preserved) --- */
.mobile-nav-button {
    display: none; 
    background: none;
    border: none;
    font-size: 28px;
    color: #007BFF; 
    cursor: pointer;
    padding: 5px 10px; 
    z-index: 1000;
}

@media (max-width: 992px) {
    header > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .mobile-nav-button {
        display: block;
    }

    #main-nav { 
        width: 100%;
        position: relative; 
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
        z-index: 99;
    }

    #main-nav.active {
        max-height: 1000px; 
        overflow-y: auto; 
    }

    nav ul {
        display: block;
        border-radius: 0;
    }

    nav ul li {
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-content, .sub-dropdown-content {
        max-height: 0;
        overflow: hidden;
        position: static; /* Reset absolute positioning for mobile stack */
        display: block; /* Ensure they exist for the height transition */
        background-color: #4a4a4a;
        transition: max-height 0.3s ease-in-out;
    }

    .dropdown.sub-menu-active > .dropdown-content,
    .has-sub-dropdown.sub-menu-active + .sub-dropdown-content {
        max-height: 800px; 
    }
}


/* Lead Magnet Styles */
      .lead-magnet {
    background: #f8f9fa; /* Light grey/white for a cleaner look */
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    color: #333;
    padding: 80px 20px;
}
        .lead-magnet-container {
            max-width: 800px;
            margin: 0 auto;
        }
        .lead-magnet h2 {
            font-size: 2.5em;
            margin-bottom: 15px;
        }
        .lead-magnet p {
            font-size: 1.2em;
            margin-bottom: 30px;
        }
 .lead-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.lead-form input[type="email"] {
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    width: 100%;
    max-width: 350px;
}

.btn-submit {
    background-color: #25D366; /* WhatsApp Green */
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-submit:hover {
    transform: scale(1.05);
    background-color: #128C7E;
}

/* --- FLOATING CONTACT SIDEBAR --- */
.floating-contact {
    position: fixed;
    right: 20px;
    top: 150px; /* Adjust this so it sits below your menu */
    width: 280px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 998; /* Sits below the main nav dropdowns (1000) */
    overflow: hidden;
    border-top: 4px solid #007BFF;
}

.contact-header {
    background: #003366;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.floating-contact form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-contact input, 
.floating-contact textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.btn-side-submit {
    background: #007BFF;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-side-submit:hover {
    background: #0056b3;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 1100px) {
    /* Hide the floating form on smaller screens to avoid overlapping text */
    .floating-contact {
        display: none;
    }
}