/* ── Announcement bar ─────────────────────────────────────────── */

.dev-header-announcement {
    width: 100%;
    background-color: #D5EFF8;
    text-align: center;
    padding: 8px 24px;
}

.dev-header-announcement-text {
    margin: 0;
    font-size: 0.9rem;
    color: #075FAB;
}

/* ── Main bar ─────────────────────────────────────────────────── */

#dev-header {
    width: 100%;
    background: #fff;
    border-bottom: 3px solid #cce9f5;
    /* position: sticky; */
    top: 0;
    z-index: 9999;
    position: relative;
}

.dev-header-main {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Section 1: Brand image ───────────────────────────────────── */

.dev-header-brand {
    flex-shrink: 0;
}

.dev-header-brand-img {
    display: block;
    max-height: 88px;
    width: auto;
}

.dev-header-brand-placeholder {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
    border: 1px dashed #ccc;
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
}

/* ── Section 2: Search bar ────────────────────────────────────── */

.dev-header-search {
    flex: 1;
    max-width: 750px;
    min-width: 0;
}

/* ── Section 3: Actions ───────────────────────────────────────── */

.dev-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.dev-mini-cart-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.dev-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #075FAB;
    font-size: 1.7rem;
    text-decoration: none;
    transition: color 0.2s;
}

.dev-header-icon:hover {
    color: #054f8e;
}

/* Hover tooltip */
.dev-header-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc( 100% + 10px );
    left: 50%;
    transform: translateX(-50%);
    background: #D5EFF8;
    color: #075FAB;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    pointer-events: none;
    z-index: 10000;
}

.dev-header-icon[data-tooltip]:hover::after,
.dev-header-icon[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

/* Cart count badge */
.dev-cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #075FAB;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
}

.dev-cart-count.has-items {
    opacity: 1;
    pointer-events: auto;
}

/* Loyalty image icon */
.dev-header-loyalty-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
}

/* Mini cart dropdown */
.dev-mini-cart-dropdown {
    position: absolute;
    top: calc( 100% + 12px );
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.12 );
    z-index: 9999;
    padding: 16px;
}

/* Language switcher */
.dev-header-lang {
    font-size: 1.1rem;
    color: #075FAB;
    white-space: nowrap;
}

/* ── Nav bar ──────────────────────────────────────────────────── */

.dev-header-nav {
    background-color: #075FAB;
    width: 100%;
}

.dev-header-nav-inner {
    display: flex;
    align-items: stretch;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Nav menus (shared) ───────────────────────────────────────── */

.dev-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
}

.dev-nav-menu > li {
    position: relative; /* dropdown positions relative to its own parent li */
}

.dev-nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 16px;
    color: #fff;
    text-decoration: none;
    font-size: 1.20rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.dev-nav-menu > li > a:hover,
.dev-nav-menu > li:hover > a {
    background-color: rgba( 255, 255, 255, 0.12 );
}

/* Dropdown arrow on items with children */
.dev-nav-menu > li.menu-item-has-children > a::after {
    content: '\f0d7';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.7em;
    line-height: 1;
    margin-left: 2px;
}

/* ── Mega menu dropdown ───────────────────────────────────────── */

/* Nav bar is the positioning context for the mega panel */
.dev-header-nav {
    position: relative;
}

/* Top-level dropdown: flex row, anchored to the parent li's left edge */
.dev-nav-menu > li > .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.12 );
    z-index: 9999;
    padding: 28px 0 32px;
    display: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    list-style: none;
    margin: 0;
}

.dev-nav-menu > li:hover > .sub-menu {
    display: flex;
}

/* Every second-level item */
.dev-nav-menu > li > .sub-menu > li {
    flex: 0 0 auto;
    padding: 4px 24px 8px;
    box-sizing: border-box;
    list-style: none;
}

.dev-nav-menu > li > .sub-menu > li:not( :last-child ) {
    border-right: 1px solid #e8e8e8;
}

/* Leaf items (no children): compact width */
.dev-nav-menu > li > .sub-menu > li:not( .menu-item-has-children ) {
    width: 170px;
}

/* Leaf link */
.dev-nav-menu > li > .sub-menu > li:not( .menu-item-has-children ) > a {
    display: block;
    color: #075FAB;
    font-size: 0.95rem;
    font-weight: 400;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    padding: 7px 0;
    white-space: normal;
    transition: color 0.2s;
}

.dev-nav-menu > li > .sub-menu > li:not( .menu-item-has-children ) > a:hover {
    color: #054f8e;
    text-decoration: underline;
}

/* Column header items (have children): slightly wider */
.dev-nav-menu > li > .sub-menu > li.menu-item-has-children {
    width: 210px;
}

/* Column header link */
.dev-nav-menu > li > .sub-menu > li.menu-item-has-children > a {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1a3a5c;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    padding: 0 0 14px;
    white-space: normal;
    transition: color 0.2s;
}

.dev-nav-menu > li > .sub-menu > li.menu-item-has-children > a:hover {
    color: #075FAB;
}

/* Third-level sub-menu: always visible inside its column */
.dev-nav-menu > li > .sub-menu > li > .sub-menu {
    display: block;
    position: static;
    background: transparent;
    box-shadow: none;
    padding: 0;
    list-style: none;
    margin: 0;
}

.dev-nav-menu > li > .sub-menu > li > .sub-menu li {
    list-style: none;
    padding: 0;
}

.dev-nav-menu > li > .sub-menu > li > .sub-menu li a {
    display: block;
    color: #075FAB;
    font-size: 0.93rem;
    font-weight: 400;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    padding: 7px 0;
    white-space: normal;
    transition: color 0.2s;
}

.dev-nav-menu > li > .sub-menu > li > .sub-menu li a:hover {
    color: #054f8e;
    text-decoration: underline;
}

/* ── Leaf item group (JS-generated wrapper) ───────────────────── */
/* The group <li> itself inherits width:170px and border-right from
   the :not(.menu-item-has-children) rule above — no extra needed. */

li.dev-mega-leaf-group {
    display: block; /* stack inner items vertically */
}

li.dev-mega-leaf-group > .menu-item {
    list-style: none;
    padding: 0;
}

li.dev-mega-leaf-group > .menu-item > a {
    display: block;
    color: #075FAB;
    font-size: 0.95rem;
    font-weight: 400;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    padding: 7px 0;
    white-space: normal;
    transition: color 0.2s;
}

li.dev-mega-leaf-group > .menu-item > a:hover {
    color: #054f8e;
    text-decoration: underline;
}

/* ── Healthcare Professional item — no special separator ─────── */

.dev-header-cart {
    background-color: #fff;
    border-color: #fff;
    padding-left: 0;
    padding-right: 0;
}

.dev-header-cart:hover, .dev-header-cart:active {
    border-color: #fff;
}

/* ── Hamburger (hidden on desktop) ───────────────────────────── */

.dev-hamburger {
    display: none;
    background: none;
    border: none;
    color: #075FAB;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* ── Mobile nav drawer (hidden on desktop) ───────────────────── */

.dev-mobile-nav {
    display: none;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media ( max-width: 768px ) {

    /* ── Main bar ─────────────────────────────────────────────── */
    .dev-header-main {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 12px;
    }

    .dev-header-brand-img {
        max-height: 44px;
        max-width: 160px;
    }

    .dev-header-search {
        order: 3;
        flex-basis: 100%;
    }

    .dev-header-actions {
        margin-left: auto;
        gap: 14px;
    }

    /* Icons/lang were enlarged for desktop — scale back down for mobile */
    .dev-header-icon {
        font-size: 1.3rem;
    }

    .dev-header-loyalty-img {
        width: 26px;
        height: 26px;
    }

    .dev-header-lang {
        font-size: 0.85rem;
    }

    /* Show hamburger */
    .dev-hamburger {
        display: flex;
        align-items: center;
    }

    /* Hide desktop nav bar entirely */
    .dev-header-nav {
        display: none !important;
    }

    /* ── Mobile nav drawer ────────────────────────────────────── */
    .dev-mobile-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 9998;
        background: #075FAB;
        box-shadow: 0 8px 20px rgba( 0, 0, 0, 0.2 );
        max-height: calc( 100vh - 120px );
        overflow-y: auto;
    }

    .dev-mobile-nav.is-open {
        display: block;
    }

    /* ── Mobile menu list ─────────────────────────────────────── */
    .dev-mobile-menu {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* Top-level links */
    .dev-mobile-menu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 20px;
        color: #fff;
        font-size: 0.9rem;
        font-weight: 700;
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border-bottom: 1px solid rgba( 255, 255, 255, 0.12 );
        transition: background-color 0.2s;
    }

    .dev-mobile-menu > li > a:hover {
        background-color: rgba( 255, 255, 255, 0.1 );
    }

    /* Expand arrow on items with children */
    .dev-mobile-menu .menu-item-has-children > a::after {
        content: '\f0d7';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 0.75em;
        transition: transform 0.2s;
        flex-shrink: 0;
        margin-left: 8px;
    }

    .dev-mobile-menu .menu-item-has-children.is-open > a::after {
        transform: rotate( 180deg );
    }

    /* Sub-menus: hidden until toggled */
    .dev-mobile-menu .sub-menu {
        display: none;
        list-style: none;
        margin: 0;
        padding: 0;
        background: rgba( 0, 0, 0, 0.18 );
    }

    .dev-mobile-menu .menu-item-has-children.is-open > .sub-menu {
        display: block;
    }

    /* Second-level links */
    .dev-mobile-menu .sub-menu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 13px 20px 13px 36px;
        color: rgba( 255, 255, 255, 0.9 );
        font-size: 0.88rem;
        font-weight: 400;
        text-decoration: none;
        border-bottom: 1px solid rgba( 255, 255, 255, 0.08 );
    }

    .dev-mobile-menu .sub-menu > li > a:hover {
        background-color: rgba( 255, 255, 255, 0.08 );
        color: #fff;
    }

    /* Third-level links */
    .dev-mobile-menu .sub-menu .sub-menu > li > a {
        padding-left: 52px;
        font-size: 0.85rem;
        color: rgba( 255, 255, 255, 0.75 );
    }
}
