/* ================= HEADER ================= */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    padding: 15px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    /* Used for mega-menu positioning (desktop) */
    --dropdown-top: 88px;
}

.main-header.sticky {
    padding: 10px 0;
    --dropdown-top: 78px;
}

.header-container {
    max-width: 100% !important;
    padding: 0 40px !important;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 65px !important;
    max-height: 100% !important;
    transition: 0.3s;
    display: block;
}

/* Logo remains in original colors always */

.nav-list {
    display: flex;
    gap: 10px !important;
    align-items: center;
}

.nav-link {
    display: inline-block;
    color: #333333 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.04em !important;
    padding: 6px 8px !important;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.nav-link::after {
    display: none !important;
}

.main-header.sticky .nav-link {
    color: #333333 !important;
}

.nav-link:hover, .nav-link.active, .dropdown:hover .nav-link.dropbtn,
.main-header.sticky .nav-link:hover, .main-header.sticky .nav-link.active, .main-header.sticky .dropdown:hover .nav-link.dropbtn {
    background-color: #0055a8 !important;
    color: #ffffff !important;
    font-weight: bold !important;
}

.nav-link:hover::after, .nav-link.active::after {
    display: none !important;
}

.nav-blog-btn {
    display: inline-block;
    background-color: #0055a8;
    color: var(--white);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
}

.nav-blog-btn:hover {
    background-color: #ef4924;
    color: var(--white);
}

.btn-rect-blue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0055a8;
    color: var(--white) !important;
    padding: 10px 22px;
    font-family: "Roboto", sans-serif !important;
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px;
    box-shadow: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.btn-rect-blue:hover {
    background: #ef4924;
    color: var(--white) !important;
    transform: translateY(0);
    box-shadow: none;
}

/* Dropdown Mega-Menu */
.dropdown { position: relative; }
.dropdown-content {
    /* Use fixed positioning so the mega-menu never touches the screen edges */
    position: fixed;
    top: var(--dropdown-top);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #f1f1f1 !important;
    width: min(780px, calc(100vw - 40px)); /* leaves ~20px margin on both sides */
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 12px;
    box-shadow: none !important;
    border-radius: 1px 1px 10px 10px !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 14px 16px;
    border-top: none !important;
}
.dropdown.show .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.dropdown-content a {
    display: block;
    padding: 8px 12px;
    color: #333333 !important;
    font-size: 13px !important;
    font-weight: 500;
    text-transform: uppercase !important;
    text-align: center !important;
    transition: all 0.2s ease;
}
.dropdown-content a:hover {
    background: #0055a8 !important;
    color: #ffffff !important;
    font-weight: bold !important;
    padding-left: 12px !important;
}

.mobile-toggle {
    display: none;
    font-size: 24px;
    color: var(--white);
}

.main-header.sticky .mobile-toggle { color: var(--dark-black); }

@media (max-width: 1400px) and (min-width: 1201px) {
    .nav-list {
        gap: 12px;
    }
    .nav-link {
        font-size: 13px;
        padding: 6px 10px;
    }
    .btn-rect-blue {
        padding: 8px 18px;
        font-size: 13px;
    }
    .logo img {
        height: 38px;
    }
}

@media (max-width: 1200px) {
    .nav-list {
        position: fixed; top: 0; right: -100%; width: 300px; height: 100vh;
        background: var(--white); flex-direction: column; padding-top: 100px;
        transition: 0.4s; box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        align-items: flex-start; padding-left: 30px;
        overflow-y: auto;
    }
    .nav-list.active { right: 0; }
    .nav-link { color: var(--dark-black) !important; font-size: 1.1rem; }
    .mobile-toggle { display: block; background: var(--primary-blue); padding: 5px 12px; border-radius: 8px; position: relative; z-index: 10001; color: white !important;}
    .mobile-toggle i { color: white; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;}
    .header-actions .btn, .header-actions .btn-rect-blue { display: none; }
    
    /* Mobile Dropdown Fix */
    .dropdown-content {
        position: static;
        width: 100%;
        transform: none !important;
        /* Mobile: single-column list */
        grid-template-columns: 1fr;
        box-shadow: none;
        padding: 10px;
        opacity: 0;
        visibility: hidden;
        display: none;
        margin-top: 10px;
    }
    .dropdown.show .dropdown-content {
        display: grid;
        opacity: 1;
        visibility: visible;
    }
}

/* Patient-facing minimal header polish */
.main-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(16, 42, 67, 0.06);
    border-bottom: 1px solid rgba(16, 42, 67, 0.06);
}

.main-header.sticky {
    box-shadow: 0 10px 28px rgba(16, 42, 67, 0.08);
}

.nav-link {
    color: #333333 !important;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff !important;
    background-color: #0055a8 !important;
}

@media (max-width: 1250px) {
    .nav-list {
        box-shadow: -16px 0 40px rgba(16, 42, 67, 0.12);
        transition: right 0.28s ease;
    }

    .mobile-toggle {
        background: #0b5f8f;
        border-radius: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .main-header,
    .nav-link,
    .nav-link::after,
    .btn-rect-blue,
    .dropdown-content,
    .dropdown-content a,
    .nav-list {
        transition-duration: 0.001ms !important;
    }
}

/* Global professional font alignment */
.main-header,
.main-header *,
.dropdown-content,
.dropdown-content *,
.btn-rect-blue {
    font-family: "Montserrat", sans-serif !important;
    letter-spacing: 0.02em !important;
}

.nav-link {
    letter-spacing: 0.04em !important;
}

/* Keep header icons rendered through Font Awesome. */
.main-header .fa,
.main-header .fas,
.main-header .far,
.main-header .fab,
.main-header .fa-solid,
.main-header .fa-regular,
.main-header .fa-brands {
    font-family: var(--icon-font-solid, "Font Awesome 6 Free") !important;
}

.main-header .fab,
.main-header .fa-brands {
    font-family: var(--icon-font-brands, "Font Awesome 6 Brands") !important;
}

.main-header .fas,
.main-header .fa-solid {
    font-weight: 900 !important;
}
