html {
    overflow-x: hidden;
}

.public-header {
    width: 100%;
    height: 100px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    transition: height 0.3s ease-in-out,
                background-color 0.3s ease-in-out,
                border-color 0.3s ease-in-out,
                box-shadow 0.3s ease-in-out;
}

.public-header.scrolled {
    height: 70px;
}

.public-header.scrolled .header-logo > img {
    height: 50px;
}

/* Homepage — transparent navbar until scrolled */
.page-home .public-header:not(.scrolled) {
    background-color: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
}

@media (min-width: 1200px) {
    .page-home .public-header:not(.scrolled) .header-menu > li > a {
        color: #ffffff;
    }

    .page-home .public-header:not(.scrolled) .header-menu > li > a:hover,
    .page-home .public-header:not(.scrolled) .header-menu > li > a.active {
        color: #fecc7e !important;
    }
}

.public-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.public-header .header-logo > img {
    height: 70px;
    transition: filter 0.3s ease-in-out, height 0.3s ease-in-out;
}

.page-home .public-header:not(.scrolled) .header-logo > img {
    filter: brightness(0) invert(1);
}

.page-home .public-header:not(.scrolled) .header-menu-container .header-logo > img {
    filter: none;
}

.public-header .header-menu {
    display: flex;
    gap: 25px;
    align-items: center;
    margin-bottom: 0;
    padding-left: 0;
    list-style: none;
}

.public-header .header-menu > li > a {
    color: #212529;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 13px;
}

.public-header .header-menu > li > a:hover,
.public-header .header-menu > li > a.active {
    color: var(--primary-color) !important;
    background-color: transparent !important;
}

.btn-sign-in {
    background-color: var(--primary-color);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    padding: 10px 20px;
    border-radius: 4px;
    text-transform: uppercase;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0;
    transition: all 0.3s ease;
}

.btn-sign-in:hover {
    opacity: 0.85;
    color: #ffffff !important;
}

.header-menu-container {
    display: flex;
    gap: 30px;
    align-items: center;
}

.header-menu-login {
    display: flex;
    gap: 10px;
    padding-left: 0;
    flex-shrink: 0;
    margin-bottom: 0;
    align-items: center;
}

.header-menu-toggle {
    display: none;
}

@media (max-width: 1199px) {
    .header-menu-container {
        width: 300px;
        height: 100vh;
        background-color: #ffffff;
        border-left: 1px solid #e8e8e8;
        position: fixed;
        top: 0;
        right: -300px;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 30px;
        transition: all 0.3s ease-in-out;
    }

    .header-menu-container .header-menu,
    .header-menu-container .header-menu-login {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .header-menu-container .header-menu {
        gap: 20px;
    }

    .header-menu-container .header-menu-login {
        gap: 10px;
    }

    .header-menu-container .header-menu-login {
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        padding-top: 30px;
    }

    .header-menu-toggle {
        width: 30px;
        height: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        cursor: pointer;
    }

    .header-menu-toggle span {
        width: 100%;
        height: 2px;
        background-color: #212529;
        transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out, opacity 0.3s ease-in-out, width 0.3s ease-in-out;
        position: relative;
    }

    .page-home .public-header:not(.scrolled) .header-menu-toggle span {
        background-color: #ffffff;
    }

    .header-menu-toggle span:nth-child(1) {
        transform-origin: left top;
        transform: rotate(0deg);
    }

    .header-menu-toggle span:nth-child(2) {
        width: 100%;
        left: 0;
        opacity: 1;
    }

    .header-menu-toggle span:nth-child(3) {
        width: 100%;
        transform-origin: left bottom;
        transform: rotate(0deg);
    }

    body {
        position: relative;
        right: 0;
        transition: all 0.3s ease-in-out;
    }

    .public-header {
        transition: all 0.3s ease-in-out;
    }

    body.show-menu,
    body.show-menu .public-header {
        right: 300px;
    }

    body.show-menu .header-menu-container {
        right: 0;
        box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.15);
    }

    body.show-menu .header-menu-toggle span:nth-child(1) {
        transform: rotate(45deg);
        top: -2px;
    }

    body.show-menu .header-menu-toggle span:nth-child(2) {
        opacity: 0;
        width: 0;
    }

    body.show-menu .header-menu-toggle span:nth-child(3) {
        transform: rotate(-45deg);
    }

    .public-header .header-menu > li > a {
        color: #212529;
    }

    .btn-sign-in {
        display: block;
        width: 100%;
    }

    /* Account dropdown flattened into mobile menu */
    .header-menu-login .nav-item.dropdown {
        flex-direction: column;
        align-items: stretch;
    }

    .header-menu-login .nav-account-link.dropdown-toggle {
        display: none;
    }

    .header-menu-login .account-dropdown {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        position: static;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
        width: 100%;
        --bs-dropdown-bg: transparent;
        --bs-dropdown-border-color: transparent;
        --bs-dropdown-box-shadow: none;
        --bs-dropdown-link-color: #212529;
        --bs-dropdown-link-hover-bg: transparent;
        --bs-dropdown-link-hover-color: var(--primary-color);
    }

    .header-menu-login .account-dropdown .dropdown-item,
    .header-menu-login .account-dropdown button.dropdown-item {
        color: #212529 !important;
        font-size: 14px;
        font-weight: 400;
        text-transform: uppercase;
        text-decoration: none;
        padding: 0;
        background: transparent !important;
        border-radius: 0;
        border: none;
        width: 100%;
        text-align: left;
        display: block;
    }

    .header-menu-login .account-dropdown .dropdown-item:hover,
    .header-menu-login .account-dropdown button.dropdown-item:hover {
        color: var(--primary-color) !important;
        background: transparent !important;
    }

    .header-menu-login .account-dropdown .dropdown-item i,
    .header-menu-login .account-dropdown button.dropdown-item i {
        display: none;
    }

    .header-menu-login .account-dropdown .dropdown-divider {
        display: none;
    }
}
