/* ==========================================================================
   CARE-HOSPITAL - CORPORATE HEADER STYLES (header.css)
   STRICT RULE: Written in pixel units (px), responsive layouts, clean structures
   ========================================================================== */

/* 1. HEADER CONTAINER & STICKY STATE */
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    padding: 0;
    transition: all var(--transition-normal);
    padding: 10px 0;
}

.site-header.header-scrolled {
    box-shadow: var(--shadow-md);
    border-bottom-color: rgba(226, 232, 240, 0.4);
}

.site-header .container {
    padding-left: 20px;
    padding-right: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
    /* Fixed height to allow absolute element alignments */
}

/* 2. MULTI-LOGO BRANDING SYSTEM WITH FULL-HEIGHT DIVIDERS */
.brand-logos-container {
    display: grid;
    grid-template-columns: repeat(4, auto);
    grid-template-rows: 44px auto;
    row-gap: 6px;
    align-items: center;
    align-self: stretch;
    padding-top: 8px;
    padding-bottom: 8px;
}

.brand-subtext {
    grid-row: 2;
    grid-column: 1 / span 4;
    text-align: center;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #000000;
    letter-spacing: 0.2px;
    line-height: 1.2;
    margin: 0;
    margin-top: 11px;
}


.brand-subtext-former {
    display: block;
    font-style: italic;
    font-weight: 400;
    font-size: 11px; 
}


.brand-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 16px;
    padding-right: 16px;
    align-self: stretch;
    /* Stretch to full height of parent */
    height: 100%;
    position: relative;
    transition: opacity var(--transition-fast);
}

/* Vertical divider stretching from the absolute top to the absolute bottom of the header */
/* .brand-logo-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #e2e8f0;
} */

.brand-logo-item:first-child {
    padding-left: 0;
    padding-right: 6px;
}

.brand-logo-item:first-child::before {
    display: none;
}

/* Individual Logo Styles (Replicating exact colors & aesthetics) */
.brand-logo-item img {
    height: 100%;
    /* Consistent height matching clinical branding */
    width: 100%;
    object-fit: contain;
    display: block;
}

.brand-logo-item:first-child img{width: 90px; height: 30px; margin-top: 18px;}
.brand-logo-item:nth-child(2) img{width: 49px; height: 41px;}
.brand-logo-item:nth-child(3) img{width: 74px; height: 44px;}
.brand-logo-item:nth-child(4) img{width: 59px; height: 41px;}

.brand-svg-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.logo-text-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
}

/* 3. NAVIGATION BAR LINKS (TOUCHING THE HEADER BOTTOM BORDER) */
.navigation-bar {
    margin-left: auto;
    margin-right: 38px;
    align-self: stretch;
    /* Stretch to full header height */
    height: 100%;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

.nav-menu li {
    height: 100%;
}

.nav-menu .nav-link {
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    color: #292929;
    font-size: 14px;
    padding: 0;
    /* Clear vertical padding to rely on height stretch */
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-menu .nav-link:hover,
.nav-menu .nav-link.active {
    color: #164D92;
}

.nav-menu .nav-link:hover::after,
.nav-menu .nav-link.active::after {
    width: 100%;
}

/* 4. SEARCH TRIGGER CONTAINER */
.search-container {
    display: flex;
    align-items: center;
    align-self: stretch;
    /* Stretch to full height */
    height: 100%;
}

.desktop-search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    padding: 0;
    height: 100%;
    transition: color var(--transition-fast);
}

.desktop-search-trigger svg circle,
.desktop-search-trigger svg line {
    stroke: #164D92;
}

.desktop-search-trigger svg {
    stroke: currentColor;
    transition: transform var(--transition-fast);
}

/* 5. DESKTOP SEARCH DROPDOWN OVERLAY (OPENS DOWNWARDS) */
.desktop-search-dropdown {
    position: absolute;
    top: 100%;
    /* Sits exactly below the sticky header */
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.08);
    z-index: 999;
    padding: 16px 0;
    display: none;
    /* Managed dynamically via slideToggle in JS */
}

.search-dropdown-inner {
    max-width: 100%;
    padding-left: 60px;
    padding-right: 60px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 16px;
    stroke: #64748b;
    pointer-events: none;
}

.search-input-wrapper .search-input {
    width: 100%;
    height: 46px;
    padding-left: 48px;
    padding-right: 48px;
    font-size: 15px;
    font-family: 'Manrope', sans-serif;
    color: #0f172a;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
}

.search-input-wrapper .search-input::placeholder {
    color: #64748b;
}

/* .search-input-wrapper .search-input:focus {
    background-color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
} */

.search-close-btn {
    position: absolute;
    right: 16px;
    color: #64748b;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.search-close-btn:hover {
    color: var(--color-danger);
}

/* MOBILE SEARCH BAR FOR VIEWPORTS */
.mobile-search-bar {
    display: none;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 16px;
}

.mobile-search-inner {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.mobile-search-inner svg {
    position: absolute;
    left: 12px;
    stroke: #64748b;
    pointer-events: none;
}

.mobile-search-inner input {
    width: 100%;
    height: 40px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding-left: 40px;
    padding-right: 16px;
    font-size: 15px;
    font-family: 'Manrope', sans-serif;
    color: #0f172a;
    outline: none;
    transition: all var(--transition-fast);
}

.mobile-search-inner input::placeholder {
    color: #64748b;
}

.mobile-search-inner input:focus {
    background-color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.mobile-search-inner input.has-query {
    padding-right: 40px;
}

#mobile-search-close-btn[hidden] {
    display: none;
}

/* Mobile home button - hidden on desktop */
.mobile-home-btn {
    display: none;
    width: 37px;
    height: 40px;
    background-color: #27437B;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color var(--transition-fast);
}

.mobile-home-btn:hover {
    background-color: #1c325c;
}

/* Hamburger mobile button */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1010;
    padding: 0;
}

.mobile-nav-toggle .burger-bar {
    width: 100%;
    height: 2px;
    background-color: #0f172a;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

/* ==========================================================================
   [RESPONSIVE] HEADER & NAVIGATION SYSTEM
   ========================================================================== */

  

@media (max-width: 1280px) {
    .site-header .container {
        padding-left: 30px;
        padding-right: 30px;
        /* height: 64px; */
        /* Slightly more compact header height */
    }

    .brand-logos-container {
        border-right: none;
    }

    .brand-logo-item {
        height: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }

    .brand-logo-item img {
        height: 36px;
        /* Proportionately smaller logos */
    }

    .nav-menu {
        gap: 12px;
    }
}

@media (max-width: 1024px) {
    .nav-menu .nav-link {
        font-size: 13px;
    }

    .desktop-search-trigger {
        font-size: 13px;
    }
}

@media (max-width: 991px) {
    .site-header .container {
        /* height: 56px; */
        /* Row height for mobile devices */
        padding: 12px 30px;
        border-bottom: 1px solid #ddd;
    }

    .brand-logos-container {
        /* flex: 1; */
        justify-content: flex-start;
    }

    /* Show all 4 logos in a row on mobile screen */
    .brand-logo-item {
        padding-left: 26px;
        padding-right: 26px;
        /* flex: 1; */
        justify-content: center;
        height: 100%;
    }

    /* Hide divider pseudo-elements on mobile to avoid crowded space */
    /* .brand-logo-item::before {
        display: none;
    } */

    .brand-logo-item:first-child {
        padding-left: 0;
    }

    .brand-logo-item img {
        height: 100%;
        /* Highly compact branding size to fit in mobile top row */
    }

    /* Toggle Mobile home button display */
    .mobile-home-btn {
        display: flex;
    }

    /* Toggle Hamburger display */
    .mobile-nav-toggle {
        display: flex;
        margin-left: 0px;
        margin-top: -20px;
    }

    /* Hide desktop search triggers on mobile screens */
    .desktop-search-trigger {
        display: none;
    }

    /* Show mobile-specific second-row search bar */
    .mobile-search-bar {
        display: block;
        padding: 0;
    }

    .mobile-search-inner input {
        border-radius: 0;
        border: 0;
        background-color: #ffffff;
    }

    /* Mobile drawer overlay slide system */
    .navigation-bar {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: #ffffff;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.05);
        padding: 40px 20px 20px;
        transition: right var(--transition-normal), visibility var(--transition-normal);
        z-index: 1005;
        overflow-y: auto;
        visibility: hidden;
    }

    .navigation-bar.active {
        right: -40px;
        visibility: visible;
    }

    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        height: auto;
    }

    .nav-menu li {
        width: 100%;
        height: auto;
    }

    .nav-menu .nav-link {
        width: 100%;
        padding: 8px 0;
        height: auto;
        display: block;
        border-bottom: 1px solid #e2e8f0;
    }

    /* Burger button active animation states */
    .mobile-nav-toggle.active .burger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-nav-toggle.active .burger-bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-nav-toggle.active .burger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .brand-subtext {
        margin-top: 0;
    }

    .site-header{padding-bottom: 0; padding-top: 0;}
    .mobile-nav-toggle .burger-bar{width: 17px;}
    .mobile-nav-toggle .burger-bar:nth-child(2){width: 11px;}
}

@media (max-width: 767px) {
    .site-header .container {
        padding: 0 20px;
    }

    .brand-logo-item img {
        width: 100%;
        height: 34px;
    }

    .brand-logo-item {
        padding: 0 16px;
    }

    .site-header{border: 0; padding-bottom: 0;}
     .mobile-blos-btn svg{position: initial;  }
}

@media (max-width: 420px) {

    .mobile-home-btn {
        width: 27px;
        height: 30px;
    }

    .brand-logo-item{padding: 0 10px;}
    .brand-logo-item:nth-child(1) img{    width: 60px;
    height: 34px;}
    .brand-logo-item:nth-child(2) img{    width: 39px;
    height: 31px;
}
    .brand-logo-item:nth-child(3) img{    width: 54px;
    height: 34px;}
    .brand-logo-item:nth-child(4) img{    width: 49px;
    height: 34px;}
}

@media (max-width: 380px) {

    .mobile-home-btn {
        width: 27px;
        height: 30px;
    }
    
    .brand-logo-item img {
        height: 30px;
    }
}
