.ps-anchor-menu {
    position: relative;
    padding: var(--ps-anchor-menu-block-padding-y, 6px) 0;
    z-index: 2;
    --ps-anchor-menu-header-gap: 6px;
    --ps-anchor-menu-sticky-top: calc(var(--header-height, 80px) + var(--ps-anchor-menu-admin-offset, 0px) + var(--ps-anchor-menu-header-gap));
    --ps-anchor-menu-scroll-gap: 34px;
}

@media (min-width: 768px) {
    html.is-header-hidden .ps-anchor-menu {
        --ps-anchor-menu-sticky-top: calc(var(--ps-anchor-menu-admin-offset, 0px) + 8px);
    }

    html.ps-anchor-menu-programmatic-scroll .ps-anchor-menu {
        --ps-anchor-menu-sticky-top: calc(var(--header-height, 80px) + var(--ps-anchor-menu-admin-offset, 0px) + var(--ps-anchor-menu-header-gap));
    }
}

.ps-anchor-menu.ps-anchor-menu--sticky {
    position: sticky;
    top: var(--ps-anchor-menu-sticky-top);
    z-index: 45;
}

.admin-bar {
    --ps-anchor-menu-admin-offset: 32px;
}

@media (max-width: 782px) {
    .admin-bar {
        --ps-anchor-menu-admin-offset: 46px;
    }
}

.ps-anchor-menu--overlap {
    margin-top: clamp(-42px, -3vw, -24px);
    z-index: 8;
}

.ps-anchor-menu,
.ps-anchor-menu .layout-container,
.ps-anchor-menu__inner {
    overflow: visible;
}

.ps-anchor-menu .layout-container {
    display: flex;
    justify-content: flex-start;
}

.ps-anchor-menu--layout-center .layout-container {
    justify-content: center;
}

.ps-anchor-menu--layout-stretch .layout-container {
    display: block;
}

.ps-anchor-menu__inner {
    position: relative;
    z-index: 1;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(0, 31, 26, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
    box-shadow: 0 12px 30px rgba(0, 31, 26, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.ps-anchor-menu--layout-stretch .ps-anchor-menu__inner {
    width: 100%;
}

.ps-anchor-menu__inner::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(246, 193, 46, 0), rgba(246, 193, 46, 0.6), rgba(246, 193, 46, 0));
    pointer-events: none;
}

.ps-anchor-menu--style-glass .ps-anchor-menu__inner {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.45));
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
}

.ps-anchor-menu--style-dark .ps-anchor-menu__inner {
    background:
        linear-gradient(135deg, rgba(0, 31, 26, 0.92), rgba(2, 80, 67, 0.82)),
        radial-gradient(circle at 18% 0%, rgba(246, 193, 46, 0.12), transparent 34%);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
        0 18px 42px rgba(0, 31, 26, 0.16),
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.ps-anchor-menu--style-dark .ps-anchor-menu__inner::before {
    opacity: 0.45;
}

.ps-anchor-menu__nav {
    width: 100%;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
}

.ps-anchor-menu__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ps-anchor-menu--layout-center .ps-anchor-menu__list {
    justify-content: center;
}

.ps-anchor-menu--layout-stretch .ps-anchor-menu__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.ps-anchor-menu__item {
    min-width: 0;
}

.ps-anchor-menu__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 37px;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.005em;
    line-height: 1;
    white-space: nowrap;
    transition: transform 200ms ease, background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.ps-anchor-menu__link:hover {
    transform: translateY(-1px);
    border-color: rgba(2, 80, 67, 0.25);
    background: rgba(255, 255, 255, 1);
    color: var(--color-secondary);
    box-shadow: 0 8px 18px rgba(0, 31, 26, 0.08);
}

.ps-anchor-menu__link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.ps-anchor-menu__link.is-current {
    color: var(--color-secondary);
    border-color: var(--color-primary);
    background: rgba(246, 193, 46, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.ps-anchor-menu__icon {
    font-size: 17px;
    line-height: 1;
    font-variation-settings: "wght" 300, "opsz" 24;
}

.ps-anchor-menu--style-dark .ps-anchor-menu__link {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.78);
}

.ps-anchor-menu--style-dark .ps-anchor-menu__link:hover {
    border-color: rgba(246, 193, 46, 0.28);
    background: rgba(255, 255, 255, 0.085);
    color: #fff;
    box-shadow: none;
}

.ps-anchor-menu--style-dark .ps-anchor-menu__link.is-current {
    color: var(--color-blue-dark);
    border-color: rgba(246, 193, 46, 0.75);
    background: linear-gradient(180deg, #F6C12E 0%, #E8AE1B 100%);
    box-shadow:
        0 8px 18px rgba(246, 193, 46, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.ps-anchor-menu--compact .ps-anchor-menu__nav {
    padding: 8px;
}

.ps-anchor-menu--compact .ps-anchor-menu__list {
    gap: 6px;
}

.ps-anchor-menu--compact .ps-anchor-menu__link {
    min-height: 34px;
    padding: 8px 12px;
    font-size: 12.5px;
}

.ps-anchor-menu__label--mobile {
    display: none;
}

.ps-anchor-menu-admin-placeholder {
    border: 1px dashed var(--gray-200);
    border-radius: 999px;
    padding: 14px 16px;
    color: var(--gray-500);
    font-size: 14px;
    background: var(--gray-50);
}

@media (max-width: 767px) {
    .ps-anchor-menu {
        --ps-anchor-menu-block-padding-y: 6px;
        --ps-anchor-menu-header-gap: 6px;
        --ps-anchor-menu-sticky-top: calc(var(--header-height, 64px) + var(--ps-anchor-menu-admin-offset, 0px) + var(--ps-anchor-menu-header-gap));
        --ps-anchor-menu-scroll-gap: 44px;
    }

    html.is-header-hidden .ps-anchor-menu {
        --ps-anchor-menu-sticky-top: calc(var(--header-height, 64px) + var(--ps-anchor-menu-admin-offset, 0px) + var(--ps-anchor-menu-header-gap));
    }

    .ps-anchor-menu.ps-anchor-menu--sticky {
        z-index: 49;
    }

    .ps-anchor-menu__inner {
        width: 100%;
        overflow: visible;
    }

    .ps-anchor-menu__nav {
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 8px;
    }

    .ps-anchor-menu__nav::-webkit-scrollbar {
        display: none;
    }

    .ps-anchor-menu--style-dark .ps-anchor-menu__nav {
        border-radius: 999px;
        background:
            linear-gradient(90deg, rgba(0, 31, 26, 0.96), transparent) left / 24px 100% no-repeat local,
            linear-gradient(-90deg, rgba(0, 31, 26, 0.96), transparent) right / 24px 100% no-repeat local,
            linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent) left / 18px 100% no-repeat,
            linear-gradient(-90deg, rgba(0, 0, 0, 0.34), transparent) right / 18px 100% no-repeat;
    }

    .ps-anchor-menu--style-light .ps-anchor-menu__nav,
    .ps-anchor-menu--style-glass .ps-anchor-menu__nav {
        border-radius: 999px;
    }

    .ps-anchor-menu__list {
        display: inline-flex;
        flex-wrap: nowrap;
        min-width: 100%;
    }

    .ps-anchor-menu--layout-stretch .ps-anchor-menu__list {
        display: inline-flex;
        grid-template-columns: none;
    }

    .ps-anchor-menu__item,
    .ps-anchor-menu__link {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .ps-anchor-menu__label--desktop {
        display: none;
    }

    .ps-anchor-menu__label--mobile {
        display: inline;
    }
}

.ps-anchor-menu-hint {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 8px;
    background: var(--color-primary);
    color: #001F1A;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -130%);
    transition: opacity 260ms ease, transform 260ms ease;
}

.ps-anchor-menu-hint.is-visible {
    opacity: 1;
    transform: translate(-50%, -115%);
}

.ps-anchor-menu-hint::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    transform: translateX(-50%) rotate(45deg);
    border-bottom-right-radius: 2px;
}

.ps-anchor-menu-hint-arrow {
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    animation: ps-anchor-menu-hint-arrow-left 1.4s ease-in-out infinite;
}

.ps-anchor-menu-hint-arrow:last-child {
    animation-name: ps-anchor-menu-hint-arrow-right;
    animation-delay: 0.2s;
}

@keyframes ps-anchor-menu-hint-arrow-left {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-3px); }
}

@keyframes ps-anchor-menu-hint-arrow-right {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
    .ps-anchor-menu__link {
        transition: none;
    }

    .ps-anchor-menu-hint {
        transition: opacity 160ms ease;
    }

    .ps-anchor-menu-hint-arrow {
        animation: none;
    }
}
