/* Avoid animating layout changes when scroll locking is released. */
#main-header {
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* Keep the sticky header below Bootstrap offcanvas panels and backdrops. */
#main-header.HeaderSticky {
    z-index: 1000;
}

#main-header .header-logo {
    display: block;
    width: 94px;
    max-width: 94px;
    height: 48px;
    margin: 0;
    object-fit: contain;
}

#main-header nav {
    box-sizing: border-box;
    padding: 0 12px;
}

#main-header .header-left {
    display: flex;
    flex: 0 0 94px;
    align-items: center;
    min-width: 94px;
}

#main-header .navbar-brand {
    display: flex;
    align-items: center;
    line-height: 0;
}

#main-header.HeaderSticky .header-left a.navbar-brand img {
    width: 94px !important;
    max-width: 94px;
    height: 48px;
}

#main-header .header-icon-fadeable {
    position: relative;
}

#main-header .header-icon-fadeable span {
    position: absolute;
    height: 20px;
    width: 20px;
    background-color: var(--bs-success);
    color: var(--bs-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease-in-out;
}

#headerMobile.offcanvas.offcanvas-end {
    --bs-offcanvas-width: min(360px, 92vw);
    top: 0 !important;
    width: var(--bs-offcanvas-width) !important;
    height: 100vh;
    /* Follow the visible viewport as mobile browser bars expand and collapse. */
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    border: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px 0 0 24px;
    background: #101820 !important;
    box-shadow: -18px 0 45px rgba(5, 12, 18, 0.28);
    color: #f4f7f8;
    transform: translateX(100%);
    transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1), visibility 380ms linear;
    will-change: transform;
}

#headerMobile.offcanvas.offcanvas-end.show {
    transform: translateX(0);
}

#headerMobile.offcanvas.offcanvas-end .offcanvas-header,
#headerMobile.offcanvas.offcanvas-end .offcanvas-body,
#headerMobile.offcanvas.offcanvas-end .offcanvas-footer {
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 240ms ease, transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

#headerMobile.offcanvas.offcanvas-end.show .offcanvas-header,
#headerMobile.offcanvas.offcanvas-end.show .offcanvas-body,
#headerMobile.offcanvas.offcanvas-end.show .offcanvas-footer {
    opacity: 1;
    transform: translateX(0);
}

#headerMobile.offcanvas.offcanvas-end.show .offcanvas-body {
    transition-delay: 60ms;
}

#headerMobile.offcanvas.offcanvas-end.show .offcanvas-footer {
    transition-delay: 110ms;
}

#headerMobile .offcanvas-header {
    flex: 0 0 auto;
    padding: 22px 20px 14px !important;
    background: linear-gradient(145deg, #162630, #101820);
}

#headerMobile .offcanvas-header form {
    display: flex;
    align-items: center;
    gap: 8px !important;
    padding: 5px 6px 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
}

#headerMobile .offcanvas-header input {
    min-width: 0;
    height: 38px !important;
    margin: 0 !important;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    /* Prevent mobile browsers from zooming the page when this input is focused. */
    font-size: 16px;
}

#headerMobile .offcanvas-header input::placeholder {
    color: rgba(255, 255, 255, 0.56);
}

#headerMobile .offcanvas-header button {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px;
    border-radius: 10px !important;
    background: #d94b3d;
    color: #fff;
    transition: background 180ms ease, transform 180ms ease;
}

#headerMobile .offcanvas-header button:hover,
#headerMobile .offcanvas-header button:focus-visible {
    background: #ee6757;
    transform: translateY(-1px);
}

#headerMobile .offcanvas-body {
    flex: 1 1 0;
    min-height: 0;
    padding: 0 20px !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    font-size: 0.92rem;
    scrollbar-width: thin;
    scrollbar-color: #3b5662 transparent;
}

#headerMobile .offcanvas-body section {
    padding: 18px 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#headerMobile .offcanvas-body section:first-child {
    border-top: 0 !important;
}

#headerMobile .offcanvas-body section>div:first-child {
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-bottom: 12px;
    text-align: left !important;
}

#headerMobile .offcanvas-body section>div:first-child i {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 10px;
    background: rgba(217, 75, 61, 0.16);
    color: #f06a59;
    font-size: 0.9rem !important;
}

#headerMobile .offcanvas-body .header-menu-icon,
#headerMobile .offcanvas-body .color-logo-red {
    color: #f4f7f8 !important;
}

#headerMobile .offcanvas-body .header-menu-icon {
    font-size: 0.92rem !important;
}

#headerMobile .offcanvas-body section>ul,
#headerMobile .offcanvas-body section>li {
    margin-top: 8px !important;
}

#headerMobile .offcanvas-body .normal-link,
#headerMobile .offcanvas-body button.normal-btn {
    min-height: 44px;
    width: 100%;
    padding: 6px 8px !important;
    border-radius: 12px;
    color: #d8e1e5;
    text-decoration: none;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

#headerMobile .offcanvas-body .normal-link:hover,
#headerMobile .offcanvas-body .normal-link:focus-visible,
#headerMobile .offcanvas-body button.normal-btn:hover,
#headerMobile .offcanvas-body button.normal-btn:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(3px);
}

#headerMobile .offcanvas-body button.normal-btn:hover,
#headerMobile .offcanvas-body button.normal-btn:focus-visible {
    transform: none;
    transition: background 180ms ease, color 180ms ease;
}

#headerMobile .offcanvas-body .img-icon {
    display: block;
    flex: 0 0 40px;
    width: 40px;
    height: 35px;
    max-width: 40px;
    object-fit: contain;
    object-position: center;
    filter: none;
    opacity: 1;
}

#headerMobile .offcanvas-body .d-flex-full {
    min-width: 0;
    align-items: center;
}

#headerMobile .offcanvas-body .one-ligne-text {
    overflow-wrap: anywhere;
    font-size: 0.92rem !important;
    line-height: 1.35;
}

#headerMobile .offcanvas-body .d-flex-full.gap-4 {
    gap: 1rem !important;
}

#headerMobile .offcanvas-body .collapse>ul {
    margin: 4px 0 4px 39px !important;
    padding-left: 12px;
    border-left: 1px solid rgba(240, 106, 89, 0.35);
}

#headerMobile .offcanvas-body .mobile-submenu {
    display: block !important;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 360ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 220ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 360ms;
}

#headerMobile .offcanvas-body .mobile-submenu.is-open {
    max-height: 1200px;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

#headerMobile .offcanvas-body .mobile-submenu>ul {
    margin: 4px 0 4px 39px !important;
    padding-left: 12px;
    border-left: 1px solid rgba(240, 106, 89, 0.35);
}

#headerMobile .offcanvas-body .mobile-menu-toggle .fa-chevron-up {
    transform: rotate(180deg);
}

#headerMobile .offcanvas-body .mobile-menu-toggle.is-open .fa-chevron-up {
    transform: rotate(0deg);
}

#headerMobile .offcanvas-body .collapse .normal-link {
    min-height: 38px;
    padding: 6px 10px !important;
    font-size: 0.92rem;
}

#headerMobile .offcanvas-body .fa-chevron-up {
    margin-left: auto;
    color: #f06a59;
    font-size: 0.8rem;
}

#headerMobile .offcanvas-footer {
    flex: 0 0 auto;
    padding: 0 20px env(safe-area-inset-bottom, 0px);
    background: #101820;
}

#headerMobile .offcanvas-footer section {
    padding: 14px 0 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#headerMobile .offcanvas-footer ul {
    justify-content: space-around !important;
}

#headerMobile .offcanvas-footer .normal-link,
#headerMobile .offcanvas-footer .normal-btn {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    color: #f4f7f8;
    transition: background 180ms ease, color 180ms ease;
}

#headerMobile .offcanvas-footer .normal-link:hover,
#headerMobile .offcanvas-footer .normal-link:focus-visible,
#headerMobile .offcanvas-footer .normal-btn:hover,
#headerMobile .offcanvas-footer .normal-btn:focus-visible {
    background: #d94b3d;
    color: #fff;
}

#headerMobile .offcanvas-footer .normal-link>.bg-success {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1;
    font-size: 11px !important;
    z-index: 2;
}

#headerMobile+.offcanvas-backdrop,
.offcanvas-backdrop {
    background-color: #071015;
    opacity: 0;
    transition: opacity 320ms ease;
}

.offcanvas-backdrop.show {
    opacity: 0.72;
}

#mg-costum-modal-logoutFromHeader {
    width: min(430px, calc(100vw - 32px));
    max-width: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(16, 24, 32, 0.08);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(7, 16, 21, 0.28);
}

#mg-costum-modal-logoutFromHeader>* {
    width: 100% !important;
    height: auto;
    margin: 0;
    overflow: visible;
    box-sizing: border-box;
}

#mg-costum-modal-logoutFromHeader .mg-costum-modal-header {
    position: relative;
    padding: 22px 52px 18px 24px;
    border-bottom: 1px solid #e8ecee;
}

#mg-costum-modal-logoutFromHeader .mg-costum-modal-header-content {
    color: #17232b;
    font-size: 1.35rem;
    line-height: 1.2;
}

#mg-costum-modal-logoutFromHeader .mg-costum-modal-header-close {
    position: absolute;
    top: 50%;
    right: 16px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: #17232b;
    font-size: 25px;
    line-height: 1;
    transform: translateY(-50%);
    transition: background 180ms ease, color 180ms ease;
}

#mg-costum-modal-logoutFromHeader .mg-costum-modal-header-close:hover,
#mg-costum-modal-logoutFromHeader .mg-costum-modal-header-close:focus-visible {
    background: #f1f4f5;
    color: #d94b3d;
    transform: translateY(-50%);
}

#mg-costum-modal-logoutFromHeader .mg-costum-modal-body {
    padding: 22px 24px;
    color: #53616a;
    font-size: 1rem;
}

#mg-costum-modal-logoutFromHeader .mg-costum-modal-body p {
    margin: 0;
}

#mg-costum-modal-logoutFromHeader .mg-costum-modal-footer {
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 22px;
    border-top: 0;
}

#mg-costum-modal-logoutFromHeader .mg-costum-modal-footer-btn {
    min-width: 112px;
    margin: 0;
    padding: 11px 18px;
    border-radius: 9px;
    font-size: 0.95rem;
    text-align: center;
    transition: transform 180ms ease, filter 180ms ease;
}

#mg-costum-modal-logoutFromHeader .mg-costum-modal-footer-btn:hover,
#mg-costum-modal-logoutFromHeader .mg-costum-modal-footer-btn:focus-visible {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    #mg-costum-modal-logoutFromHeader .mg-costum-modal-footer {
        justify-content: stretch;
    }

    #mg-costum-modal-logoutFromHeader .mg-costum-modal-footer-btn {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 380px) {
    #headerMobile.offcanvas.offcanvas-end {
        --bs-offcanvas-width: 94vw;
        border-radius: 18px 0 0 18px;
    }

    #headerMobile .offcanvas-body,
    #headerMobile .offcanvas-header,
    #headerMobile .offcanvas-footer {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}

@media (min-width: 1201px) {
    #main-header {
        --header-ink: #f4f7f8;
        --header-muted: #a9b7bf;
        --header-panel: #111d27;
        --header-accent: #ee6757;
        position: relative;
        z-index: 1000;
        height: 76px;
        background: #0d1821;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 24px rgba(5, 12, 18, 0.14);
    }

    #main-header nav {
        position: relative;
        display: flex;
        gap: 24px;
        padding: 0 28px;
    }

    #main-header .header-left {
        display: flex;
        align-items: center;
        flex: 0 0 94px;
        min-width: 94px;
    }

    #main-header .header-right {
        display: grid;
        grid-template-columns: auto minmax(220px, 1fr) auto;
        align-items: center;
        width: 100%;
        height: 100%;
        min-width: 0;
        gap: 20px;
    }

    #main-header .menu-left,
    #main-header .menu-right {
        min-width: 0;
    }

    #main-header .menu-left {
        grid-column: 1;
        justify-self: start;
    }

    #main-header .menu-right {
        grid-column: 3;
        justify-self: end;
    }

    #main-header .menu-left>ul,
    #main-header .menu-right>ul {
        gap: 4px;
        margin: 0;
        padding: 0;
        justify-content: flex-start;
    }

    #main-header .header-right>.form {
        grid-column: 2;
        width: 240px;
        min-width: 220px;
        max-width: 100%;
        justify-self: start;
        transition: width 280ms ease, min-width 280ms ease;
    }

    #main-header .header-right>.form:focus-within {
        width: 100%;
        min-width: 280px;
    }

    #main-header form.form-search {
        position: relative;
        align-items: center;
        height: 42px;
        padding: 0 4px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 20px rgba(3, 10, 15, 0.12);
        transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
    }

    #main-header form.form-search:focus-within {
        border-color: rgba(255, 255, 255, 0.35);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06), 0 12px 28px rgba(3, 10, 15, 0.2);
    }

    #main-header form.form-search input {
        width: 100%;
        height: 40px;
        min-width: 0;
        padding: 0 12px !important;
        border: 0;
        outline: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--header-ink);
        font-size: 0.86rem;
    }

    #main-header form.form-search input::placeholder {
        color: var(--header-muted);
    }

    #main-header .header-right .header-item,
    #main-header .header-right .big-menu {
        position: relative;
        min-height: 42px;
        padding: 0 10px;
        border-radius: 10px;
        color: var(--header-muted);
        cursor: pointer;
        transition: background 180ms ease, color 180ms ease;
    }

    #main-header .header-right .header-item:hover,
    #main-header .header-right .big-menu:hover {
        background: rgba(255, 255, 255, 0.07);
        color: var(--header-ink);
    }

    #main-header .header-right .header-item>a,
    #main-header .header-right .big-menu>span {
        color: inherit;
        font-size: 0.82rem;
        font-weight: 600;
        letter-spacing: 0.01em;
        white-space: nowrap;
    }

    #main-header .header-right .menu-icon {
        color: var(--header-accent);
        font-size: 0.75rem !important;
        transition: transform 180ms ease;
    }

    #main-header .header-right .header-item:hover>.menu-icon,
    #main-header .header-right .big-menu:hover>.menu-icon {
        transform: translateY(1px);
    }

    #main-header .menu-left li>ul,
    #main-header .menu-right li>ul {
        top: 100% !important;
        left: 50% !important;
        display: flex !important;
        width: max-content;
        min-width: 190px;
        max-width: 280px;
        gap: 4px !important;
        padding: 8px !important;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 14px;
        background: var(--header-panel);
        box-shadow: 0 18px 40px rgba(3, 10, 15, 0.32);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate(-50%, -8px);
        transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
    }

    #main-header .menu-left li>ul.active,
    #main-header .menu-right li>ul.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, 0);
        transition-delay: 0s;
    }

    #main-header .menu-left li>ul li,
    #main-header .menu-right li>ul li {
        width: 100%;
        min-height: 0;
        align-items: stretch;
    }

    #main-header .menu-left li>ul a,
    #main-header .menu-right li>ul a {
        display: block;
        width: 100%;
        padding: 10px 12px;
        border-radius: 9px;
        color: var(--header-muted);
        font-size: 0.8rem;
        line-height: 1.3;
        text-align: left;
        white-space: normal;
        transition: background 160ms ease, color 160ms ease, padding 160ms ease;
    }

    #main-header .menu-left li>ul a:hover,
    #main-header .menu-right li>ul a:hover {
        padding-left: 15px;
        background: rgba(238, 103, 87, 0.13);
        color: var(--header-ink);
    }

    #main-header .header-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 8px;
        margin-left: 4px;
    }

    #main-header .header-actions>li {
        height: auto !important;
    }

    #main-header .header-icon-fadeable {
        display: grid;
        width: 40px;
        height: 40px;
        place-items: center;
        border-radius: 11px;
        color: var(--header-ink);
        transition: background 180ms ease, color 180ms ease, transform 180ms ease;
    }

    #main-header .header-icon-fadeable:hover {
        background: rgba(255, 255, 255, 0.09);
        color: var(--header-accent);
        transform: translateY(-1px);
    }

    #main-header .header-icon-fadeable span {
        top: -3px;
        right: -3px;
        bottom: auto;
        left: auto;
        width: 16px;
        height: 16px;
        padding: 0;
        font-size: 0.62rem;
        line-height: 1;
        transform: none;
    }
}
