/* =========================================
       1. CORE VARIABLES & RESET
       ========================================= */
:root {
    /* Glassmorphism (Dropdowns) */
    --color-glass-base: rgba(35, 50, 69, 0.6);
    --color-glass-border: rgba(35, 50, 69, 0.29);
    --color-glass-highlight: rgba(255, 255, 255, 0.08);

    --color-text-main: #23466D;
    /* KCM Primary Blue */
    --color-text-muted: #6D6D6D;
    /* KCM Text Grey */
    --color-accent: #EB6320;
    /* KCM Accent Orange */

    --blur-strength: 13px;
    --shadow-glass: 0 4px 30px rgba(0, 0, 0, 0.1);
    --header-border-color: rgba(0, 0, 0, 0.08);
    --header-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);

    --border-radius-glass: 16px;

    --header-height: 72px;
    --container-width: 1280px;
    --transition-speed: 0.3s;
    --dropdown-gap: 12px;
}

/* Body padding to push content below the sticky header */
body {
    padding-top: calc(var(--header-height) - 8px) !important;
}

body.admin-bar {
    padding-top: calc(var(--header-height) + 24px) !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        padding-top: calc(var(--header-height) + 46px) !important;
    }
}


/* =========================================
       2. HEADER CONTAINER
       ========================================= */
.kcm-header {
    position: fixed;
    /* Fixed works better for ensuring it stays at top and pushes content via body padding */
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);

    /* Force solid background to prevent bleed-through */
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--header-border-color);
    box-shadow: var(--header-shadow);

    z-index: 10000 !important;
    /* Extremely high to stay above all Elementor content */
    transition: all var(--transition-speed) ease;
}

/* 1.1 Desktop visibility resets */
.mobile-nav-header,
.mobile-ksl-item,
.mobile-overlay {
    display: none !important;
}

@media (max-width: 1024px) {

    .mobile-nav-header,
    .mobile-ksl-item,
    .mobile-overlay.active {
        display: block !important;
    }
}

.kcm-header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: relative;
}

/* =========================================
       3. LOGO
       ========================================= */
.kcm-logo {
    flex-shrink: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    /* Default dark logo on white background */
}

.kcm-logo img {
    height: 42px;
    width: auto;
    display: block;
}

/* KSL Network Logo (Desktop) */
.kcm-ksl-network {
    display: flex;
    align-items: center;
    margin-left: 20px;
    flex-shrink: 0;
}

/* Global restriction for mobile logo just in case */
.mobile-ksl-item img {
    max-height: 40px !important;
    width: auto !important;
}

.kcm-ksl-network img {
    height: 40px !important;
    /* Force height to prevent "massive" logo issue */
    width: auto !important;
    max-width: none !important;
    transition: transform 0.3s ease;
    display: block;
}

.kcm-ksl-network:hover img {
    transform: scale(1.05);
}

/* =========================================
       4. NAVIGATION (Desktop)
       ========================================= */
.kcm-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.kcm-menu {
    display: flex;
    gap: 30px;
    align-items: center;
    height: 100%;
    list-style: none;
    /* WP Output specific */
    margin: 0;
    padding: 0;
}

.kcm-menu-item {
    position: relative;
    padding: 28px 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.kcm-header .kcm-menu-link,
.kcm-header .kcm-menu-item a.kcm-menu-link,
.kcm-menu-link {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--color-text-main) !important;
    position: relative;
    padding-bottom: 4px;
    letter-spacing: 0.5px;
    text-decoration: none !important;
}

.kcm-header .kcm-menu > .kcm-menu-item > a.kcm-menu-link {
    color: var(--color-text-main) !important;
}

.kcm-menu-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0.5px;
    bottom: 0;
    left: 0;
    background-color: var(--color-accent);
    transition: width var(--transition-speed) ease;
}

.kcm-menu-item:hover .kcm-menu-link::after {
    width: 100%;
}

.kcm-header .kcm-menu-item:hover>.kcm-menu-link,
.kcm-menu-item:hover>.kcm-menu-link {
    color: var(--color-accent) !important;
}

.kcm-header .kcm-menu > .kcm-menu-item:hover > a.kcm-menu-link {
    color: var(--color-accent) !important;
}

.kcm-menu-item.current-menu-item > .kcm-menu-link,
.kcm-menu-item.current-menu-ancestor > .kcm-menu-link,
.kcm-menu-item.current-menu-parent > .kcm-menu-link {
    color: var(--color-accent) !important;
}

.kcm-header .kcm-menu > .kcm-menu-item.current-menu-item > a.kcm-menu-link,
.kcm-header .kcm-menu > .kcm-menu-item.current-menu-ancestor > a.kcm-menu-link,
.kcm-header .kcm-menu > .kcm-menu-item.current-menu-parent > a.kcm-menu-link {
    color: var(--color-accent) !important;
}

.kcm-menu-item.current-menu-item > .kcm-menu-link::after,
.kcm-menu-item.current-menu-ancestor > .kcm-menu-link::after,
.kcm-menu-item.current-menu-parent > .kcm-menu-link::after {
    width: 100%;
}

.kcm-menu-link i.fa-angle-down {
    margin-left: 5px;
    font-size: 12px;
    transition: transform var(--transition-speed);
    opacity: 0.8;
}

.kcm-menu-item:hover i.fa-angle-down {
    transform: rotate(180deg);
}

/* =========================================
       5. KSL NETWORK (Header Element)
       ========================================= */
.kcm-ksl-network {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-left: 20px;
    border-left: 1px solid var(--header-border-color);
    margin-left: 20px;
}

/* KSL Image sizing */
.kcm-ksl-network img {
    height: 40px;
    width: auto;
    display: block;
}

/* Hide Mobile Version in desktop view */
.mobile-ksl {
    display: none;
}

/* =========================================
       6. DROPDOWNS & MEGA MENU (Desktop)
       ========================================= */

.kcm-dropdown,
.kcm-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;

    /* Glassmorphism Background */
    background: var(--color-glass-base);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    box-shadow: var(--shadow-glass);

    /* Glass Edge Border */
    border: 1px solid var(--color-glass-border);
    outline: 1px solid var(--color-glass-highlight);

    border-radius: var(--border-radius-glass);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-speed) ease;
    z-index: 999;
    overflow: hidden;
    margin-top: var(--dropdown-gap);
    list-style: none;
    /* WP Output specific */
}

/* Standard Dropdown */
.kcm-dropdown {
    min-width: 240px;
    padding: 15px 0;
}

.kcm-menu-item:hover .kcm-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.kcm-dropdown li {
    padding: 0;
    margin: 0;
}

.kcm-header .kcm-dropdown a.kcm-menu-link,
.kcm-dropdown a.kcm-menu-link {
    display: block;
    padding: 10px 25px;
	font-family: "Poppins", sans-serif;
    font-size: 12px !important;
    color: #ffffff !important;
    border-left: 2px solid transparent;
    text-decoration: none !important;
}

.kcm-header .kcm-dropdown a.kcm-menu-link::after,
.kcm-dropdown a.kcm-menu-link::after {
    width: 0;
    height: 0.5px;
}

.kcm-header .kcm-dropdown a.kcm-menu-link:visited,
.kcm-dropdown a.kcm-menu-link:visited {
    color: #ffffff !important;
}

.kcm-header .kcm-dropdown a.kcm-menu-link:hover,
.kcm-dropdown a.kcm-menu-link:hover {
    color: var(--color-accent) !important;
    background: rgba(255, 255, 255, 0.12);
    padding-left: 30px;
    border-left-color: var(--color-accent);
}

.kcm-header .kcm-dropdown a.kcm-menu-link:hover::after,
.kcm-dropdown a.kcm-menu-link:hover::after {
    width: 1em;
}

.kcm-dropdown .current-menu-item > a.kcm-menu-link,
.kcm-dropdown .current-menu-ancestor > a.kcm-menu-link,
.kcm-dropdown .current-menu-parent > a.kcm-menu-link {
    color: var(--color-accent) !important;
    border-left-color: var(--color-accent);
}

.kcm-dropdown .current-menu-item > a.kcm-menu-link::after,
.kcm-dropdown .current-menu-ancestor > a.kcm-menu-link::after,
.kcm-dropdown .current-menu-parent > a.kcm-menu-link::after {
    width: 1em;
}

/* Mega Menu (Dynamic Width) */
.kcm-menu-item.has-mega-menu {
    position: static;
}

.kcm-mega-menu {
    width: 100%;
    max-width: 1080px;
    left: 0;
    padding: 22px 28px;
    border-radius: var(--border-radius-glass);
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    transform: translateY(10px);
}

.kcm-menu-item:hover .kcm-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mega Menu Grid */
.mega-menu-content {
    column-count: 3;
    column-gap: 34px;
    column-rule: 1px solid var(--color-accent);
    /* Separator between columns */
}

.service-line-group {
    break-inside: avoid;
    margin-bottom: 18px;
}

.kcm-header .service-line-heading {
    font-size: 14px;
    font-weight: 400;
    color: #ffffff !important;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-accent);
    display: inline-block;
    width: 100%;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-top: 0;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-list li {
    margin-bottom: 7px;
}

.kcm-header .service-list a,
.service-list a {
    font-size: 13px !important;
    color: #ffffff !important;
    display: block;
    transition: all 0.2s;
    text-decoration: none !important;
}

.kcm-header .service-list a:visited,
.service-list a:visited {
    color: #ffffff !important;
}

.kcm-header .service-list a:hover,
.service-list a:hover {
    color: var(--color-accent) !important;
    transform: translateX(5px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.service-list .current-menu-item > a,
.service-list .current-menu-ancestor > a,
.service-list .current-menu-parent > a {
    color: var(--color-accent) !important;
}

/* =========================================
       7. MOBILE MENU
       ========================================= */
.mobile-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-main);
}

@media (max-width: 1024px) {
    :root {
        --header-height: 68px;
    }

    .kcm-logo {
        max-width: calc(100% - 56px);
    }

    .kcm-logo img {
        height: 36px;
        max-width: 100%;
    }

    .mobile-toggle {
        display: block;
    }

    .kcm-nav {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: calc(100vh - var(--header-height));
        background: #ffffff;
        /* White background for mobile */
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 0;
        /* Changed from 100px since we have a header now */
        transition: right 0.4s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .mobile-nav-header {
        display: flex;
        justify-content: flex-end;
        padding: 20px;
    }

    .mobile-nav-close {
        font-size: 24px;
        cursor: pointer;
        color: #2c2c2c;
    }

    .kcm-nav.active {
        right: 0;
    }

    .kcm-menu {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        gap: 0;
    }

    .kcm-menu-item {
        padding: 0;
        height: auto;
        display: block;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .kcm-menu-link {
        display: flex;
        justify-content: space-between;
        padding: 20px 30px;
        font-size: 16px !important;
        width: 100%;
        color: var(--color-text-main) !important;
    }

    .kcm-menu-item.has-mega-menu {
        position: relative;
    }

    .kcm-dropdown,
    .kcm-mega-menu {
        position: static;
        visibility: visible;
        opacity: 1;
        transform: none;
        box-shadow: none;
        background: #f2f4f7;
        /* Solid fallback for mobile */
        max-height: 0;
        overflow: hidden;
        padding: 0;
        width: 100% !important;
        left: 0 !important;
        margin-top: 0;
        border: none;
        border-radius: 0;
    }

    .kcm-menu-item.active .kcm-dropdown,
    .kcm-menu-item.active .kcm-mega-menu {
        max-height: 2000px;
        padding: 0;
    }

    .kcm-header .kcm-dropdown a,
    .kcm-dropdown a,
    .kcm-header .service-list a,
    .service-list a {
        color: var(--color-text-main) !important;
    }

    .kcm-header .kcm-dropdown a.kcm-menu-link,
    .kcm-dropdown a.kcm-menu-link {
        color: var(--color-text-main) !important;
        font-size: 14px !important;
    }

    .kcm-header .kcm-dropdown a:hover,
    .kcm-dropdown a:hover,
    .kcm-header .service-list a:hover,
    .service-list a:hover {
        color: var(--color-accent) !important;
        background: rgba(0, 0, 0, 0.04);
    }

    .kcm-dropdown .current-menu-item > a,
    .kcm-dropdown .current-menu-ancestor > a,
    .kcm-dropdown .current-menu-parent > a,
    .service-list .current-menu-item > a,
    .service-list .current-menu-ancestor > a,
    .service-list .current-menu-parent > a {
        color: var(--color-accent) !important;
    }

    .mega-menu-content {
        column-count: 1;
        column-rule: none;
        padding: 20px 30px;
    }

    /* Mobile KSL Styles */
    .mobile-ksl-item {
        display: block;
        padding: 30px;
        text-align: center;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        margin-top: auto;
    }

    .mobile-ksl-item img {
        height: 60px;
        width: auto;
        max-width: 100%;
    }

    /* Mobile: Hide icon, show text for Contact */
    .contact-icon {
        display: none !important;
    }

    .contact-text {
        display: inline !important;
    }

    /* Mobile KSL - show in mobile nav */
    .desktop-ksl {
        display: none !important;
    }
}

/* =========================================
       8. MOBILE OVERLAY & ADDITIONAL STYLES
       ========================================= */

/* Mobile Overlay (click to close) */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Contact Icon/Text Desktop vs Mobile */
.contact-icon {
    display: inline-block;
}

.contact-text {
    display: none;
    /* Hide text on desktop, show icon only */
}

/* Desktop: show icon, hide text */
@media (min-width: 1025px) {
    .contact-icon {
        display: inline-block !important;
    }

    .contact-text {
        display: none !important;
    }

    /* Phone icon styling */
    .contact-icon i {
        font-size: 18px;
        color: var(--color-text-main);
    }

    .kcm-menu-item:hover .contact-icon i {
        color: var(--color-accent);
    }
}

/* Mobile: hide overlay toggle on desktop */
@media (min-width: 1025px) {
    .mobile-overlay {
        display: none !important;
    }
}
