/* "Header bim" (Magento_Theme/templates/html/headers/header_bim.phtml): clean + glass.
   Every rule is scoped to .bimh, so the other MGS headers are not affected. */
.bimh {
    --bimh-blue: #0a2a9e;
    --bimh-navy: #0a1f6e;
    --bimh-ink: #0e1430;
    --bimh-soft: #3a4260;
    --bimh-line: #cdd6ea;
    --bimh-ground: #edf1f9;
    --bimh-orange: #ec5a0e;
    --bimh-orange-hover: #d14c06;
    --bimh-margin: clamp(16px, 3.6vw, 54px);
    position: relative;
    z-index: 100;
    background: #eef4fc url("../images/header-bim-bg.jpg") right center / cover no-repeat;
    color: var(--bimh-ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
}
.bimh input,
.bimh button { font-family: inherit; }
.bimh [hidden] { display: none !important; }
.bimh *,
.bimh *::before,
.bimh *::after { box-sizing: border-box; }
.bimh svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bimh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bimh a:focus-visible,
.bimh button:focus-visible,
.bimh input:focus-visible { outline: 3px solid var(--bimh-orange); outline-offset: 2px; }

/* Sticky, when "Sticky menu" is on in the theme settings. */
header.header:has(.bimh--sticky) { position: sticky; top: 0; z-index: 100; }
header.header:has(.bimh) { box-shadow: none; } /* taste-skill-ignore: removes the theme shadow */

.bimh-wrap { position: relative; padding: 14px var(--bimh-margin) 15px; }

/* Glass bar: logo, search, actions */
.bimh-bar {
    /* Above the menu row, so the search dropdowns and the account menu open over it. */
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 40px;
    min-height: 80px;
    padding: 12px 22px 12px 28px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 16px;
    background: rgba(255, 255, 255, .55);
    /* The glass bar is the look chosen for this header (reference "Clean + Glass"). */
    -webkit-backdrop-filter: blur(18px) saturate(1.4); /* taste-skill-ignore */
    backdrop-filter: blur(18px) saturate(1.4); /* taste-skill-ignore */
}
.bimh-logo { display: block; flex: none; color: var(--bimh-navy); font-weight: 800; font-size: 22px; text-decoration: none; }
.bimh-logo img { display: block; width: auto; height: 50px; }

.bimh-search { flex: 1 1 auto; min-width: 0; max-width: 740px; margin-left: 28px; }
.bimh-search .search-form { float: none; width: 100%; }
.bimh .search-form .form-search {
    display: flex;
    align-items: center;
    float: none;
    height: 50px;
    overflow: visible;
    padding: 0 10px 0 12px;
    border: 1px solid var(--bimh-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .5);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.bimh .search-form .form-search:focus-within { border-color: var(--bimh-blue); box-shadow: 0 0 0 4px rgba(0, 48, 184, .1); } /* taste-skill-ignore: focus ring */
.bimh .search-form .form-search .btn,
.bimh #search_mini_form .btn-primary {
    position: static;
    order: -1;
    flex: none;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--bimh-ink);
    font-size: 18px;
    line-height: 36px;
}
.bimh .search-form .form-search .btn:hover,
.bimh #search_mini_form .btn-primary:hover { background: var(--bimh-ground); color: var(--bimh-blue); }
.bimh .search-form .form-search .input-text,
.bimh .search-form.select-search .form-search .input-text {
    flex: 1 1 auto;
    float: none;
    width: auto;
    min-width: 0;
    height: 48px;
    padding: 0 8px 0 4px;
    border: 0;
    background: transparent;
    color: var(--bimh-ink);
    font-size: 14px;
    line-height: 48px;
}
.bimh .search-form .form-search .input-text:focus { outline: none; box-shadow: none; } /* taste-skill-ignore: reset */
.bimh .search-form .form-search .input-text::placeholder { color: var(--bimh-soft); opacity: 1; }
.bimh .search-form .form-search .search-select {
    flex: none;
    float: none;
    width: auto;
    margin: 0;
    border: 0;
}
.bimh .search-form .form-search .search-select .search-cat-active {
    position: relative;
    display: block;
    max-width: 190px;
    overflow: hidden;
    height: 40px;
    padding: 0 38px 0 16px;
    border-radius: 999px;
    color: var(--bimh-ink);
    font-size: 14px;
    font-weight: 400;
    line-height: 40px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.bimh .search-form .form-search .search-select .search-cat-active:hover { background: var(--bimh-ground); }
.bimh .search-form .form-search .search-select .search-cat-active:after { top: 14px; right: 16px; color: var(--bimh-ink); }
.bimh .search-form .form-search .search-select #select-cat-dropdown {
    top: calc(100% + 10px);
    right: -8px;
    left: auto;
    width: 280px;
    max-height: 380px;
    height: auto;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--bimh-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(16, 36, 94, .14); /* taste-skill-ignore: floating dropdown */
}
.bimh .search-form .form-search .search-select #select-cat-dropdown li span { padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.bimh .search-form .form-search .search-select #select-cat-dropdown li span:hover { background: var(--bimh-ground); color: var(--bimh-blue); }
.bimh .search-form .search-autocomplete,
.bimh .search-form.select-search .form-search .search-autocomplete {
    top: calc(100% + 10px);
    width: 100%;
    border: 1px solid var(--bimh-line);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(16, 36, 94, .14); /* taste-skill-ignore: floating dropdown */
}

.bimh-actions { display: flex; flex: none; align-items: center; gap: 14px; margin-left: auto; }
.bimh-cta,
.bimh-cta:visited {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-right: 8px;
    padding: 0 20px 0 18px;
    border-radius: 8px;
    background: var(--bimh-orange);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .15s ease, transform .1s ease;
}
.bimh-cta:hover { background: var(--bimh-orange-hover); color: #fff; text-decoration: none; }
.bimh-cta:active { transform: scale(.97); }
.bimh-cta--drawer { display: none; }
.bimh-round,
.bimh-round:visited,
.bimh-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--bimh-ink);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.bimh-round svg { width: 23px; height: 23px; stroke-width: 2; }
.bimh-round--solid svg { width: 26px; height: 26px; }
.bimh-round:hover { background: rgba(0, 48, 184, .07); color: var(--bimh-blue); }
.bimh-round:active,
.bimh-avatar:active { transform: scale(.94); }
.bimh-round--solid,
.bimh-round--solid:visited { width: 40px; height: 40px; background: #fff; color: var(--bimh-ink); }
.bimh-round--solid svg { stroke-width: 2.2; }
.bimh-avatar { width: 40px; height: 40px; background: var(--bimh-navy); color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.bimh-avatar:hover,
.bimh-avatar[aria-expanded="true"] { background: var(--bimh-blue); }
.bimh-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: var(--bimh-orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.bimh-account { position: relative; }
.bimh-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 110;
    min-width: 250px;
    padding: 8px;
    border: 1px solid var(--bimh-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(16, 36, 94, .16); /* taste-skill-ignore: floating menu */
}
.bimh-menu__who { margin: 0; padding: 10px 12px 12px; color: var(--bimh-ink); font-size: 15px; font-weight: 700; }
.bimh-menu ul { margin: 0; padding: 0; list-style: none; }
.bimh-menu li { margin: 0; }
.bimh-menu a,
.bimh-menu a:visited {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--bimh-ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.bimh-menu a:hover { background: var(--bimh-ground); color: var(--bimh-blue); }
.bimh-menu__out { margin-top: 10px !important; }

/* Menu row (the MGS megamenu, restyled) */
.bimh-nav { position: relative; z-index: 1; display: flex; align-items: center; padding: 18px 0 0 16px; }
.bimh-nav__menu { flex: 1; min-width: 0; }
.bimh-nav .nav-main,
.bimh-nav .navigation > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    float: none;
    margin: 0;
    padding: 0;
    list-style: none;
    background: none;
    border: 0;
}
.bimh-nav .nav-main > li,
.bimh-nav .navigation > ul > li { position: relative; float: none; margin: 0; padding: 0; border: 0; background: none; }
.bimh-nav .nav-main > li > a,
.bimh-nav .nav-main > li > a.level0,
.bimh-nav .navigation > ul > li > a {
    position: relative;
    display: block;
    padding: 7px 20px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--bimh-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 19px;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.bimh-nav .nav-main > li > a span::before,
.bimh-nav .nav-main > li > a span::after,
.bimh-nav .nav-main > li > a::before,
.bimh-nav .nav-main > li > a::after { content: none !important; display: none !important; }
.bimh-nav .nav-main > li > a span { display: inline; padding: 0; color: inherit; transform: none; }
.bimh-nav .nav-main > li > a:hover,
.bimh-nav .nav-main > li > a:focus { background: rgba(10, 42, 158, .08); color: var(--bimh-blue); }
.bimh-nav .nav-main > li > a[aria-current="page"],
.bimh-nav .nav-main > li > a[aria-current="page"]:hover { background: var(--bimh-blue); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .bimh *, .bimh *::before, .bimh *::after { transition: none !important; }
}

/* Laptops: the category picker folds away and the bar tightens. */
@media (max-width: 1279px) {
    .bimh-bar { gap: 18px; padding-left: 20px; }
    .bimh-logo img { height: 46px; }
    .bimh .search-form .form-search .search-select { display: none; }
    .bimh-cta { margin-right: 4px; padding: 0 18px 0 16px; font-size: 15px; }
    .bimh-nav .nav-main > li > a,
    .bimh-nav .nav-main > li > a.level0 { padding: 7px 14px; }
    .bimh-search { margin-left: 0; }
}

/* Phone and tablet: menu button, logo and round actions on one row, search below,
   and the menu opens as a glass panel. */
.bimh-burger { display: none; }
@media (max-width: 991px) {
    .bimh-wrap { padding: 10px var(--bimh-margin) 12px; }
    .bimh-bar { flex-wrap: wrap; gap: 10px 8px; min-height: 0; padding: 10px 12px 12px; border-radius: 18px; }
    .bimh-burger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: var(--bimh-ink);
        cursor: pointer;
    }
    .bimh-burger:hover { background: rgba(0, 48, 184, .07); }
    .bimh-burger__lines,
    .bimh-burger__lines::before,
    .bimh-burger__lines::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, background-color .2s ease; }
    .bimh-burger__lines { position: relative; }
    .bimh-burger__lines::before,
    .bimh-burger__lines::after { content: ""; position: absolute; left: 0; }
    .bimh-burger__lines::before { top: -6px; }
    .bimh-burger__lines::after { top: 6px; }
    .bimh.is-open .bimh-burger__lines { background: transparent; }
    .bimh.is-open .bimh-burger__lines::before { transform: translateY(6px) rotate(45deg); }
    .bimh.is-open .bimh-burger__lines::after { transform: translateY(-6px) rotate(-45deg); }

    .bimh-logo img { height: 40px; }
    .bimh-actions { gap: 4px; }
    .bimh-actions > .bimh-cta { display: none; }
    .bimh-round, .bimh-avatar { width: 44px; height: 44px; }
    .bimh-search { order: 5; flex-basis: 100%; max-width: none; }
    .bimh .search-form .form-search { height: 48px; }
    .bimh .search-form .form-search .input-text { height: 46px; line-height: 46px; }

    .bimh-nav { display: none; margin-top: 10px; padding: 8px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 18px; background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); } /* taste-skill-ignore: phone menu panel, same glass */
    .bimh.is-open .bimh-nav { display: block; }
    .bimh-nav .nav-main,
    .bimh-nav .navigation > ul { display: block; }
    .bimh-nav .nav-main > li > a,
    .bimh-nav .nav-main > li > a.level0 { padding: 14px 14px; font-size: 16px; }
    .bimh-nav .toggle-menu { display: none !important; }
    .bimh-cta--drawer { display: flex; justify-content: center; margin: 8px 0 0; }
}
