/* CANOPY-PERSONAL-ACCOUNT-MENU-V20.3.10 */

/*
 * Desktop Field layout recovery.
 *
 * The former account-menu stylesheet changed the entire sidebar to
 * position: relative. That returned the rail to normal document flow and
 * displaced the Greenhouse workspace vertically. Keep the rail fixed and
 * full-height on desktop, independent of transient data attributes.
 */
@media (min-width: 768px) {
    html.canopy-field .cf-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
    }
}

/*
 * Only the small bottom account dock may host the personal-account popover.
 * No selector in this file applies relative positioning to the sidebar.
 */
html.canopy-field .cf-account-dock[data-canopy-personal-account-menu-host] {
    position: relative !important;
    z-index: 30;
    overflow: visible !important;
    isolation: isolate;
}

/*
 * Neutralize a stale host attribute that an older script may have placed on
 * the sidebar before the current JavaScript removes it.
 */
html.canopy-field .cf-sidebar[data-canopy-personal-account-menu-host] {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
}

html.canopy-field .cf-account-dock .cf-account-copy {
    min-width: 0;
}

html.canopy-field .cf-account-dock .cf-account-menu-button {
    position: relative;
    z-index: 2;
}

.canopy-personal-account-menu {
    position: absolute;
    z-index: 2147483000;
    right: 10px;
    bottom: calc(100% + 8px);
    left: 10px;
    display: grid;
    gap: 2px;
    max-height: min(420px, calc(100dvh - 120px));
    padding: 7px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background:
        linear-gradient(
            180deg,
            rgba(11, 54, 42, 0.99),
            rgba(5, 35, 28, 0.99)
        );
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.34),
        0 2px 8px rgba(0, 0, 0, 0.24);
    color: #f5fbf7;
    overscroll-behavior: contain;
    transform-origin: bottom right;
}

.canopy-personal-account-menu[hidden] {
    display: none !important;
}

.canopy-personal-account-profile,
.canopy-personal-account-child,
.canopy-personal-account-signout {
    display: flex;
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    align-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.canopy-personal-account-profile {
    padding: 10px 11px;
    font-size: 13px;
    font-weight: 800;
}

.canopy-personal-account-children {
    display: grid;
    gap: 2px;
    padding: 0 0 5px 13px;
}

.canopy-personal-account-child {
    min-height: 34px;
    padding: 8px 11px;
    color: rgba(245, 251, 247, 0.82);
    font-size: 12px;
    font-weight: 650;
}

.canopy-personal-account-divider {
    height: 1px;
    margin: 5px 4px;
    border: 0;
    background: rgba(255, 255, 255, 0.13);
}

.canopy-personal-account-signout-form {
    display: block;
    margin: 0;
}

.canopy-personal-account-signout {
    padding: 10px 11px;
    font-size: 13px;
    font-weight: 750;
}

.canopy-personal-account-profile:hover,
.canopy-personal-account-profile:focus-visible,
.canopy-personal-account-child:hover,
.canopy-personal-account-child:focus-visible,
.canopy-personal-account-signout:hover,
.canopy-personal-account-signout:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    outline: none;
}

#personal-information,
#shipping-information {
    scroll-margin-top: 5rem;
}

@media (prefers-reduced-motion: no-preference) {
    .canopy-personal-account-menu:not([hidden]) {
        animation: canopy-personal-account-menu-enter 130ms ease-out;
    }

    @keyframes canopy-personal-account-menu-enter {
        from {
            opacity: 0;
            transform: translateY(5px) scale(0.985);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

/*
 * The menu remains absolute on mobile. Making it static would add another
 * layout row and reproduce the vertical displacement regression.
 */
@media (max-width: 767.98px) {
    .canopy-personal-account-menu {
        right: 8px;
        bottom: calc(100% + 6px);
        left: 8px;
        max-height: min(360px, calc(100dvh - 110px));
    }
}