/* Shared in-page navigation for all long-form product pages. */
:root {
    --page-anchor-scroll-offset: 128px;
}

.page-anchor-nav {
    position: sticky;
    z-index: 80;
    top: 72px;
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: 0 10px 28px rgba(20, 34, 54, .045);
    backdrop-filter: blur(16px) saturate(145%);
    -webkit-backdrop-filter: blur(16px) saturate(145%);
}

.page-anchor-nav .page-anchor-nav__scroll {
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 24px;
    scrollbar-width: none;
}

.page-anchor-nav .page-anchor-nav__scroll::-webkit-scrollbar {
    display: none;
}

.page-anchor-nav a {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 14px;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color .2s ease, background-color .2s ease;
}

.page-anchor-nav a > span {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.page-anchor-nav a::after {
    position: absolute;
    right: 13px;
    bottom: -1px;
    left: 13px;
    height: 2px;
    background: var(--primary);
    content: "";
    opacity: 0;
    transform: scaleX(.3);
    transition: opacity .2s ease, transform .2s ease;
}

.page-anchor-nav a:hover,
.page-anchor-nav a.is-active {
    color: var(--primary);
}

.page-anchor-nav a:hover::after,
.page-anchor-nav a.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

@media (max-width: 768px) {
    :root {
        --page-anchor-scroll-offset: 116px;
    }

    .page-anchor-nav {
        /* The mobile header is exactly 64px high. Keep both edges flush. */
        top: 64px;
        height: 52px;
    }

    .page-anchor-nav .page-anchor-nav__scroll {
        justify-content: flex-start;
        gap: 0;
        padding-inline: 12px;
        scroll-padding-inline: 12px;
    }

    .page-anchor-nav a {
        padding-inline: 12px;
        font-size: .7rem;
    }

    .page-anchor-nav a::after {
        right: 11px;
        left: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-anchor-nav a,
    .page-anchor-nav a::after {
        transition: none;
    }
}
