/*
 * JN Top Bar Rotator
 * ------------------
 * Shoptimizer owns the surrounding top bar. JNDS provides only the compact
 * center rotator, drag/swipe interaction and lazy REVIEWS.io slot.
 */
.top-bar-center .jnds-topbar-rotator,
.jnds-topbar-rotator {
    --jnds-topbar-transition: 400ms;
    --jnds-topbar-content-height: 28px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    color: inherit;
    line-height: 1.2;
}

/* Shoptimizer has no desktop vertical padding on Top Bar Center. Add a small,
 * predictable breathing space here. On <=992px Shoptimizer already applies
 * its own 0.6rem top-bar padding, so do not double it there. */
@media (min-width: 993px) {
    .top-bar-center .jnds-topbar-rotator {
        padding-top: 6px;
        padding-bottom: 6px;
    }
}

.jnds-topbar-viewport {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    height: var(--jnds-topbar-content-height);
    min-height: var(--jnds-topbar-content-height);
    align-items: center;
    justify-items: center;
    overflow: hidden;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.jnds-topbar-rotator.is-draggable .jnds-topbar-viewport {
    cursor: grab;
}

.jnds-topbar-rotator.is-dragging .jnds-topbar-viewport {
    cursor: grabbing;
}

.jnds-topbar-slide {
    grid-area: 1 / 1;
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(100%,0,0);
}

.jnds-topbar-rotator.is-dragging .jnds-topbar-slide,
.jnds-topbar-rotator.is-transitioning .jnds-topbar-slide {
    will-change: transform;
}

.jnds-topbar-rotator:not(.is-enhanced) .jnds-topbar-slide:first-child,
.jnds-topbar-rotator.is-enhanced .jnds-topbar-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0,0,0);
}

.jnds-topbar-message,
.jnds-topbar-message__text {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    color: inherit !important;
    white-space: nowrap;
    text-align: center;
    text-overflow: ellipsis;
}

.jnds-topbar-message {
    text-decoration: none;
    -webkit-user-drag: none;
}

.jnds-topbar-message:hover,
.jnds-topbar-message:focus-visible {
    color: inherit !important;
}

.jnds-topbar-slide--reviews {
    display: flex;
    align-items: center;
    justify-content: center;
}

.jnds-topbar-reviews {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
    max-width: 100% !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: inherit;
}

.jnds-topbar-reviews > * {
    max-width: 100% !important;
}

.jnds-topbar-reviews__fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1;
    text-overflow: ellipsis;
}

.jnds-topbar-reviews__fallback-stars {
    color: inherit !important;
    letter-spacing: -1px;
}

.jnds-topbar-reviews[data-jnds-ready="1"] .jnds-topbar-reviews__fallback {
    display: none;
}

/* Official REVIEWS.io Rating Bar. The JN wrapper fixes the available one-line
 * geometry so the third-party widget cannot grow the Shoptimizer top bar and
 * create CLS when it is lazily injected. */
.jnds-topbar-reviews .reviews-io-rating-bar-widget {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    min-width: 0;
    max-height: var(--jnds-topbar-content-height);
    align-items: center;
    justify-content: center;
    overflow: visible;
    line-height: 1;
}

/* The compact rating is informational in this slot; disabling iframe pointer
 * capture keeps drag/swipe available across the full Top Bar Center surface. */
.jnds-topbar-reviews .reviews-io-rating-bar-widget iframe {
    pointer-events: none !important;
}

@media (max-width: 768px) {
    .top-bar-center .jnds-topbar-rotator,
    .jnds-topbar-rotator {
        --jnds-topbar-content-height: 24px;
    }

    .jnds-topbar-message,
    .jnds-topbar-message__text {
        padding-right: 8px;
        padding-left: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jnds-topbar-rotator.is-dragging .jnds-topbar-slide,
    .jnds-topbar-rotator.is-transitioning .jnds-topbar-slide {
        will-change: auto;
    }
}
