/* =========================================
   HEADER – Two-Tier Navbar
   ========================================= */

/* --- Base Header --- */
.header {
    display: block;
    width: 100%;
    position: relative;
    z-index: 9;
    background: #fff;
}

/* --- Top Bar (white bg, green top border) --- */
.header-top-bar {
    background: #fff;
    padding: 14px 0;
    border-top: 4px solid #1F7A63;
}
.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo img {
    width: 180px;
    z-index: 2;
    position: relative;
}

/* Contact info (right side of top bar) */
.header .header-top-bar .item-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.header-contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.3s ease;
}
.header-contact-link:hover {
    opacity: 0.85;
}
.header-contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #1F7A63;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    transition: background 0.3s ease, color 0.3s ease;
}
.header-contact-icon i {
    font-size: 20px;
    color: #1F7A63;
    transition: color 0.3s ease;
}
.header-contact-link:hover .header-contact-icon {
    background: #1F7A63;
}
.header-contact-link:hover .header-contact-icon i {
    color: #fff;
}
.header-contact-link span {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.header-contact-link b {
    font-size: 16px;
    color: #1F7A63;
    font-weight: 700;
    line-height: 1.4;
    font-style: italic;
}
.header-contact-link p,
.header-contact-link p.header-phone-text,
.header-contact-link .header-phone-text {
    font-weight: 500;
    margin: 0;
    font-size: 14px;
    color: #333 !important;
    line-height: 1.4;
}

/* --- Navigation Bar (white, below the top bar) --- */
.navbar-main {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    z-index: 10;
}
.header-item-main {
    display: flex;
    align-items: center;
    position: relative;
    justify-content: center;
}
.header .item-center {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}
.header .item-center ul.menu-main {
    text-align: left;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    list-style: none;
}

/* Nav items with vertical dividers */
.header .menu > ul > li {
    display: inline-flex;
    align-items: center;
    line-height: 48px;
    margin: 0;
    padding: 0 18px;
    border-right: 1px solid #d5d5d5;
    position: relative;
}
.header .menu > ul > li:first-child {
    padding-left: 0;
}
.header .menu > ul > li:last-child {
    border-right: none;
}
.header .menu > ul > li > a {
    font-size: 14px;
    font-weight: 500;
    color: #1A1A1A;
    position: relative;
    text-transform: none;
    transition: color 0.3s ease;
    letter-spacing: 0.2px;
    white-space: nowrap;
    text-decoration: none;
}

/* Dropdown caret */
@media (min-width: 992px) {
    .header .menu .menu-item-has-children::after {
        display: inline-block;
        margin-left: 6px;
        vertical-align: middle;
        content: "";
        border-top: 5px solid;
        border-right: 5px solid transparent;
        border-bottom: 0;
        border-left: 5px solid transparent;
        color: #1A1A1A;
        transition: color 0.3s ease;
    }
    .header .menu .menu-item-has-children:hover::after {
        color: #1F7A63;
    }
}

/* Active / Current states */
.header .menu > ul > li.current-menu-item > a { color: #1F7A63; }
.header .menu > ul > li.current-menu-parent > a { color: #1F7A63; }
.header .menu > ul > li.current-menu-parent::after { color: #1F7A63; }
.header .menu > ul > li.current-menu-parent ul.sub-menu li a { color: #050505; }
.header .menu > ul > li.current-menu-parent ul.sub-menu li.current-menu-item a { color: #1F7A63; }

/* Hover state */
.header .menu > ul > li:hover > a {
    color: #1F7A63;
}

/* --- Sub-menus (dropdowns) --- */
.header .menu > ul > li .sub-menu {
    font-size: 13px;
    text-align: left;
    line-height: 1.4;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 999;
    background-color: #fff;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    border-radius: 10px;
    padding: 12px 0;
    box-shadow: 0 10px 35px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.06);
    min-width: 220px;
    margin-top: 0;
}
.header .menu > ul > li .sub-menu a { position: relative; }
.header .menu > ul > li .sub-menu a:hover { color: #1F7A63; }
.header .menu > ul > li .sub-menu.active li.current_page_item a { color: #1F7A63; }
.header .menu > ul > li .sub-menu li.current-menu-item a { color: #1F7A63; font-weight: 500; }
.header .menu > ul > li .sub-menu li a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background-color: #1F7A63;
    transition: transform 0.3s ease;
    transform: scaleY(0);
    border-radius: 2px;
}
.header .menu > ul > li .sub-menu li a:hover::before { transform: scaleY(1); }
.header .menu > ul > li .sub-menu li {
    list-style: none;
}
.header .menu > ul > li .sub-menu li a {
    display: block;
    padding: 6px 20px 6px 16px;
    font-size: 14px;
    color: #1A1A1A;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    position: relative;
}
.header .menu > ul > li .sub-menu li a:hover {
    color: #1F7A63;
    background: rgba(31,122,99,0.04);
}

/* Mega menu on desktop */
@media screen and (min-width: 992px) {
    li.has-mega-menu:hover > .sub-menu {
        grid-template-columns: repeat(auto-fit, minmax(33.3333%, 1fr));
    }
}
@media screen and (min-width: 1200px) {
    li.has-mega-menu:hover > .sub-menu {
        grid-template-columns: repeat(auto-fit, minmax(25%, 1fr));
    }
}
@media (min-width: 992px) {
    .header .menu .has-mega-menu .sub-menu {
        box-shadow: 0 10px 35px rgba(0,0,0,0.1);
        max-width: 400px;
        min-width: 360px;
        display: flex;
        flex-wrap: wrap;
        padding: 12px 0;
    }
    .header .menu .has-mega-menu .sub-menu li.mega-menu-column {
        flex: 0 0 50%;
        padding: 0;
        text-align: left;
        text-transform: capitalize;
    }
    .header .menu .has-mega-menu .sub-menu li.mega-menu-column a {
        padding: 5px 16px;
        font-size: 13px;
    }
    .header .menu > ul > li.menu-item-has-children:hover .sub-menu {
        visibility: visible;
        opacity: 1;
        top: 100%;
    }
}

.header .menu > ul > li .sub-menu > ul > li { line-height: 1.2; }
.header .menu > ul > li .sub-menu > ul > li > a {
    display: block;
    padding: 6px 16px;
    font-size: 13px;
    color: #1A1A1A;
    transition: color 0.3s ease;
    text-decoration: none;
    text-transform: capitalize;
}
.header .menu > ul > li .single-column-menu { text-align: left; min-width: 220px; max-width: 320px; }
.header .menu > ul > li .sub-menu.mega-menu > .list-item > ul > li {
    text-align: left;
    line-height: 1;
    display: block;
}
.header .menu > ul > li .sub-menu.mega-menu > .list-item > ul > li > a {
    padding: 5px 16px;
    display: block;
    font-size: 13px;
    color: #1A1A1A;
    transition: color 0.3s ease;
}
.header .menu > ul > li .sub-menu.mega-menu {
    left: 50%;
    transform: translateX(25%);
}
.header .menu > ul > li .sub-menu.mega-menu > .list-item > ul > li > a:hover,
.header .menu > ul > li .sub-menu > ul > li > a:hover {
    color: #1F7A63;
}

/* Hide mobile-only elements on desktop */
.mobile-menu-head,
.mobile-menu-trigger { display: none; }

/* =========================================
   RESPONSIVE: Tablet & Mobile (max 991px)
   ========================================= */
@media (max-width: 991px) {
    /* Hide contact info on mobile - must match desktop specificity */
    .header .header-top-bar .item-right { display: none !important; }

    /* Hide the separate navbar row on mobile */
    .navbar-main {
        position: static;
        border-bottom: none;
        box-shadow: none;
        padding: 0;
        height: 0;
        overflow: visible;
    }
    .header-item-main {
        position: static;
        padding: 0;
    }
    .header .item-center { order: 3; flex: 0 0 100%; }

    /* Mobile menu trigger (hamburger) – positioned in top bar */
    .header .mobile-menu-trigger {
        display: flex;
        height: 30px;
        width: 30px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }

    /* Make top bar the single row */
    .header-top-bar { padding: 12px 0; position: relative; }
    .header-top-inner {
        flex-wrap: nowrap;
        align-items: center;
    }
    .header .mobile-menu-trigger span {
        display: block;
        height: 2px;
        background-color: #333;
        width: 24px;
        position: relative;
    }
    .header .mobile-menu-trigger span::before,
    .header .mobile-menu-trigger span::after {
        content: '';
        position: absolute;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #333;
    }
    .header .mobile-menu-trigger span::before { top: -7px; }
    .header .mobile-menu-trigger span::after { top: 7px; }

    /* Mobile slide-out menu */
    .header .menu {
        position: fixed;
        width: 320px;
        background-color: #fff;
        left: 0;
        top: 0;
        height: 100%;
        overflow: hidden;
        transform: translateX(-100%);
        transition: transform 0.4s ease;
        z-index: 1099;
    }
    .header .menu.active { transform: translateX(0); }

    /* CRITICAL: Override the flex layout to vertical block list */
    .header .item-center ul.menu-main,
    .header .menu > ul {
        display: block !important;
        flex-direction: unset;
        align-items: unset;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .header .menu > ul > li {
        line-height: 1;
        margin: 0;
        padding: 0;
        display: block;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.08);
        position: relative;
    }
    .header .menu > ul > li > a {
        text-align: left;
        color: #1A1A1A;
        line-height: 50px;
        height: 50px;
        font-size: 15px;
        padding: 0 50px 0 20px;
        display: block;
        white-space: normal;
    }
    .header .menu > ul > li > a i {
        position: absolute;
        height: 50px;
        width: 50px;
        top: 0;
        right: 0;
        text-align: center;
        line-height: 50px;
        transform: rotate(-90deg);
    }

    /* Mobile menu header */
    .header .menu .mobile-menu-head {
        display: flex;
        height: 50px;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        justify-content: space-between;
        align-items: center;
        position: sticky;
        background-color: #fff;
        top: 0;
        z-index: 501;
    }
    .header .menu .mobile-menu-head .go-back {
        height: 50px;
        width: 50px;
        border-right: 1px solid rgba(0,0,0,0.1);
        cursor: pointer;
        line-height: 50px;
        text-align: center;
        color: #050505;
        font-size: 16px;
        display: none;
    }
    .header .menu .mobile-menu-head.active .go-back { display: block; }
    .header .menu .mobile-menu-head .current-menu-title {
        font-size: 13px;
        font-weight: 500;
        color: #050505;
    }
    .header .menu .mobile-menu-head .mobile-menu-close {
        background: #145A4A;
        height: 50px;
        width: 50px;
        cursor: pointer;
        line-height: 50px;
        text-align: center;
        color: #fff;
        font-size: 25px;
    }
    .header .menu .menu-main {
        height: calc(100% - 50px);
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Mobile dropdown caret override */
    .header .menu .menu-item-has-children::after {
        font-family: bootstrap-icons;
        content: "\F231";
        color: #555;
        right: 16px;
        position: absolute;
        font-size: 14px;
        line-height: 50px;
        top: 0;
        border: none;
    }
    .header .menu .menu-item-has-children { position: relative; }

    /* Mobile dropdowns (sub-menus) */
    .header .menu > ul > li .sub-menu,
    .header .menu > ul > li .sub-menu.mega-menu {
        visibility: visible;
        opacity: 1;
        position: absolute;
        box-shadow: none;
        margin: 0;
        padding: 15px 20px;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        padding-top: 65px;
        max-width: none;
        min-width: auto;
        display: none;
        transform: translateX(0);
        overflow-y: auto;
        border-radius: 0;
        border: none;
        background: #fff;
    }
    .header .menu > ul > li .sub-menu.active {
        display: block;
        height: 100vh;
        padding-top: 55px;
        top: 0;
        position: fixed;
    }
    .header .menu > ul > li .sub-menu li {
        display: block;
        line-height: 1;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }
    .header .menu > ul > li .sub-menu li:last-child {
        border-bottom: none;
    }
    .header .menu > ul > li .sub-menu li a {
        white-space: normal;
        padding: 14px 0;
        font-size: 14px;
        display: block;
        color: #1A1A1A;
    }
    .header .menu > ul > li .sub-menu li a::before {
        display: none;
    }

    @keyframes slideLeft {
        0%   { opacity: 0; transform: translateX(100%); }
        100% { opacity: 1; transform: translateX(0); }
    }
    @keyframes slideRight {
        0%   { opacity: 1; transform: translateX(0); }
        100% { opacity: 0; transform: translateX(100%); }
    }

    .header .menu > ul > li .sub-menu.mega-menu > .list-item > ul > li > a,
    .header .menu > ul > li .sub-menu > ul > li > a {
        border-bottom: 1px dashed #e1e1e1;
        display: block;
        font-size: 14px;
    }
    .header .menu > ul > li .sub-menu.mega-menu > .list-item > ul { margin-bottom: 15px; }
    .header .menu > ul > li .sub-menu.active li.menu-item {
        border-bottom: 1px solid rgba(0,0,0,0.08);
        font-size: 13px;
    }

    /* Overlay */
    .menu-overlay {
        position: fixed;
        background-color: rgba(0,0,0,0.5);
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 1098;
        visibility: hidden;
        opacity: 0;
        transition: all 0.4s ease;
    }
    .menu-overlay.active { visibility: visible; opacity: 1; }
}

/* =========================================
   RESPONSIVE: 1600px and below
   ========================================= */
@media (max-width: 1600px) {
    .header .menu > ul > li { padding: 0 14px; }
    .header .menu > ul > li > a { font-size: 13px; }
    .header .menu > ul > li .sub-menu > ul > li > a { font-size: 12px; }
    .header .menu > ul > li .sub-menu.mega-menu > .list-item > ul > li > a { font-size: 12px; }
    .logo img { width: 160px; }
}

/* =========================================
   RESPONSIVE: 1199px and below
   ========================================= */
@media (max-width: 1199px) {
    .header .menu > ul > li { padding: 0 10px; }
    .header .menu > ul > li > a { font-size: 12px; }
    .logo img { width: 140px; }
    .header-contact-link b { font-size: 14px; }
    .header-contact-link .header-phone-text { font-size: 12px; }
    .header-contact-icon { width: 42px; height: 42px; }
    .header-contact-icon i { font-size: 17px; }
    .header-contact-link { gap: 8px; }
}

/* =========================================
   RESPONSIVE: Tablet (max 820px)
   ========================================= */
@media (max-width: 820px) {
    .header-top-bar { padding: 10px 0; }
    .logo img { width: 130px; }
}

/* =========================================
   RESPONSIVE: Mobile (max 575px)
   ========================================= */
@media (max-width: 575px) {
    .header-top-bar { padding: 8px 0; }
    .logo img { width: 140px; }
}
