/* ==========================================================================
   Header Topbar Styles
   ========================================================================== */
.bs-header-topbar {
    background-color: #d1f7ff; /* Match the screenshot light blue */
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.bs-header-topbar a {
    color: #222;
    text-decoration: none;
}
.bs-header-topbar a:hover {
    color: #0d8ada;
}

/* ==========================================================================
   Main Header Styles
   ========================================================================== */
.bs-header-main {
    background-color: #ffffff;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative; /* Revert to relative for default state */
    z-index: 1000;
}

.bs-header-main.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    animation: stickySlideDown 0.3s ease-in-out;
}

.admin-bar .bs-header-main.is-fixed {
    top: 32px; /* Offset for WordPress admin bar */
}

@keyframes stickySlideDown {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

/* Logo */
.bs-header-logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

/* Navigation */
.bs-header-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}
.bs-header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 30px;
}
.bs-header-nav ul li {
    position: relative;
}
.bs-header-nav ul li > a:not(.elementor-button-link) {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 10px 0;
    transition: color 0.3s ease;
}
.bs-header-nav ul li > a:not(.elementor-button-link):hover {
    color: #00a0dc; /* Hover blue */
}

/* Dropdown Arrows */
.bs-header-nav ul li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    margin-left: 6px;
    border: solid #333;
    border-width: 0 2px 2px 0;
    padding: 3px;
    transform: rotate(45deg);
    transition: border-color 0.3s ease, transform 0.3s ease;
    margin-top: -3px;
}
.bs-header-nav ul li.menu-item-has-children > a:hover::after {
    border-color: #00a0dc;
}

/* Desktop Dropdown Styles */
@media (min-width: 992px) {
    .bs-header-nav ul li.menu-item-has-children:hover > ul.sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .bs-header-nav ul ul.sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: #ffffff;
        min-width: 200px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        border-radius: 8px;
        padding: 10px 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        gap: 0;
        z-index: 99;
    }
    .bs-header-nav ul ul.sub-menu li {
        width: 100%;
    }
    .bs-header-nav ul ul.sub-menu li a {
        padding: 10px 20px;
        color: #555;
        font-size: 15px;
        display: block;
    }
    .bs-header-nav ul ul.sub-menu li a:hover {
        background: #f8f9fa;
        color: #00a0dc;
    }
    .bs-header-nav ul ul.sub-menu li.menu-item-has-children > a::after {
        transform: rotate(-45deg); /* Point right */
        position: absolute;
        right: 20px;
        top: 50%;
        margin-top: -6px;
    }
    /* Nested Dropdowns */
    .bs-header-nav ul ul.sub-menu ul.sub-menu {
        top: 0;
        left: 100%;
    }
}

/* Actions (Buttons) */
.bs-header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}
.bs-header-btn {
    background-color: #00a0dc; /* Match the screenshot bright blue */
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border: 2px solid transparent;
}
.bs-header-btn:hover {
    background-color: #0087ba;
    color: #fff;
}
.bs-header-btn.btn-outline {
    background-color: transparent;
    color: #00a0dc;
    border-color: #00a0dc;
}
.bs-header-btn.btn-outline:hover {
    background-color: #00a0dc;
    color: #fff;
}

/* Mobile Toggle Button */
.bs-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}
.bs-mobile-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}
.bs-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.bs-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}
.bs-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ==========================================================================
   Responsive Styles (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 991px) {
    .bs-header-topbar {
        display: none;
    }
    .bs-mobile-toggle {
        display: block;
    }
    .bs-header-actions {
        display: none; /* Hide buttons on mobile header bar */
    }
    .bs-header-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        flex-direction: column;
        justify-content: flex-start;
    }
    .bs-header-nav.active {
        max-height: 100vh; /* Allow expanding */
        padding: 20px 5%;
        overflow-y: auto;
    }
    .bs-header-nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        align-items: flex-start;
    }
    .bs-header-nav ul li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    .bs-header-nav ul li:last-child {
        border-bottom: none;
    }
    .bs-header-nav ul li > a:not(.elementor-button-link) {
        padding: 15px 0;
        width: 100%;
        justify-content: space-between;
    }
    .bs-header-nav ul ul.sub-menu {
        display: none;
        padding-left: 20px;
        background: #fcfcfc;
        border-top: 1px solid #f0f0f0;
        margin-bottom: 10px;
    }
    .bs-header-nav ul ul.sub-menu.active {
        display: block;
    }
    
    /* Mobile Actions inside menu */
    .bs-header-nav .bs-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-top: 25px;
        width: 100%;
    }
    .bs-header-nav .bs-mobile-actions .bs-header-btn {
        text-align: center;
        width: 100%;
    }
}

/* Hide mobile actions on desktop */
@media (min-width: 992px) {
    .bs-header-nav .bs-mobile-actions {
        display: none;
    }
}

/* ==========================================================================
   Mega Menu Overrides (Force headings to be black & Remove lines)
   ========================================================================== */
.bs-header-nav #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-megamenu > ul.mega-sub-menu > li.mega-menu-row .mega-menu-column > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link,
.bs-header-nav .mega-sub-menu .mega-menu-item-has-children > a.mega-menu-link {
    color: #222222 !important;
}

/* Reset borders, dots, and pseudo-elements in mega menu using maximum specificity */
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item,
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item > a.mega-menu-link,
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu .widget {
    border: none !important;
    box-shadow: none !important;
    list-style: none !important;
    background-image: none !important;
}

#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item::before,
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item > a.mega-menu-link::before,
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item > a.mega-menu-link .mega-description-group::before,
#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item > a.mega-menu-link .mega-menu-title::before {
    display: none !important;
    content: none !important;
    background: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}

#mega-menu-wrap-primary #mega-menu-primary ul.mega-sub-menu li.mega-menu-item > a.mega-menu-link {
    padding-left: 0 !important; /* Reset padding used by dots */
}

/* ==========================================================================
   Mega Menu Custom Buttons (Small, Black, Box-Shaped)
   ========================================================================== */
.bs-mega-btn {
    display: inline-block !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-radius: 0 !important; /* Box shaped */
    transition: background-color 0.3s ease !important;
}
.bs-mega-btn:hover {
    background-color: #333333 !important;
    color: #ffffff !important;
}
