/* Explain: Styles for the compact sticky category navigation bar. */
/* Compact sticky category navigation for the Collections page.
   Sits directly beneath the site header, revealed only once the original
   category links have scrolled out of view. Horizontally scrollable on mobile. */
.cat-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-offset, 4.5rem);
    z-index: 40;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-105%);
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.cat-sticky-bar.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.cat-sticky-track {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
}

.cat-sticky-track::-webkit-scrollbar { display: none; }

.cat-sticky-link {
    flex: none;
    white-space: nowrap;
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.cat-sticky-link:hover { color: var(--secondary-hover); }

.cat-sticky-link.is-active {
    color: var(--secondary-hover);
    border-bottom-color: var(--secondary-color);
}

@media (min-width: 640px) {
    .cat-sticky-track { padding-inline: 2rem; }
}

@media (min-width: 1024px) {
    .cat-sticky-track { padding-inline: 2.5rem; }
}

/* Keep category headings clear of both the header and the sticky bar when
   navigating by anchor. IDs come from the Collections category sections. */
#rings,
#necklaces,
#earrings,
#bracelets,
#jewelry-sets,
#brooches,
#anklets {
    scroll-margin-top: calc(var(--header-offset, 4.5rem) + var(--catbar-height, 3.25rem) + 1rem);
}