.hf-machines-nav {
    position: relative;
    overflow: visible;
}

.hf-machines-nav .elementor-button-wrapper {
    padding-inline-end: 22px;
}

.hf-machines-nav .hf-machines-toggle {
    position: absolute;
    inset: 0 0 auto auto;
    display: grid;
    place-items: center;
    width: 22px;
    height: 100%;
    padding: 0;
    color: inherit;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}

.hf-machines-nav .hf-machines-toggle:hover,
.hf-machines-nav .hf-machines-toggle:focus {
    color: inherit;
    background: transparent;
}

.hopefly-catalog-header .hf-machines-nav .hf-machines-toggle {
    color: #fff;
}

.hf-machines-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.hf-machines-nav .hf-machines-menu {
    position: absolute;
    inset: 100% auto auto 0;
    z-index: 30;
    width: min(276px, calc(100vw - 24px));
    max-height: min(440px, calc(100dvh - 120px));
    overflow: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 4px 0;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 0 0 6px 6px;
    background: rgb(65 65 65 / 95%);
    box-shadow: 0 12px 26px rgb(0 0 0 / 20%);
    list-style: none;
    text-align: left;
    animation: hf-machines-enter 240ms ease-out both;
}

.hf-machines-menu li {
    margin: 0;
}

.hf-machines-menu li + li {
    border-top: 1px solid rgb(255 255 255 / 13%);
}

.hf-machines-menu li a {
    display: block;
    padding: 11px 15px;
    color: #fff;
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    white-space: normal;
    transition: background-color 140ms ease, color 140ms ease;
}

.hf-machines-menu li a:hover,
.hf-machines-menu li a:focus-visible {
    color: #fff;
    background: rgb(255 255 255 / 13%);
}

.hf-machines-menu a:focus-visible,
.hf-machines-toggle:focus-visible {
    outline: 2px solid #62b4ef;
    outline-offset: -2px;
}

.hf-machines-menu[hidden],
.hf-machines-toggle[hidden] {
    display: none !important;
}

.hf-home-category-card[id] {
    scroll-margin-top: 112px;
}

@keyframes hf-machines-enter {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 800px) {
    body.hf-native .hf-site-header.hf-menu-open .hf-machines-nav {
        width: min(100%, 300px);
        text-align: center;
    }

    body.hf-native .hf-machines-nav .elementor-button-wrapper {
        display: inline-block;
        padding-inline-end: 36px;
    }

    body.hf-native .hf-machines-nav .hf-machines-toggle {
        top: 0;
        right: auto;
        left: calc(50% + 40px);
        width: 44px;
        height: 44px;
    }

    body.hf-native .hf-machines-nav .hf-machines-menu {
        position: static;
        width: 100%;
        max-height: none;
        margin-block: 4px 10px;
        border-radius: 6px;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hf-machines-nav .hf-machines-menu { animation: none; }
    .hf-machines-menu li a { transition: none; }
}
