/* ═══════════════════════════════════════════
   rhx-carousel
   ═══════════════════════════════════════════ */

.rhx-carousel {
    position: relative;
}

/* ── Viewport ── */
.rhx-carousel__viewport {
    overflow: hidden;
}

/* ── Track ── */
.rhx-carousel__track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

.rhx-carousel--vertical .rhx-carousel__track {
    flex-direction: column;
}

/* ── Slide item ── */
.rhx-carousel__item {
    flex: 0 0 100%;
    min-width: 0;
    overflow: hidden;
}

/* ── Dragging state ── */
.rhx-carousel--dragging .rhx-carousel__track {
    transition: none;
    user-select: none;
}

[data-rhx-mouse-dragging] .rhx-carousel__viewport {
    cursor: grab;
}

.rhx-carousel--dragging .rhx-carousel__viewport {
    cursor: grabbing;
}

/* Prevent image drag during carousel drag */
.rhx-carousel__item img {
    pointer-events: none;
}

.rhx-carousel:not(.rhx-carousel--dragging) .rhx-carousel__item img {
    pointer-events: auto;
}

/* ── Navigation arrows ── */
.rhx-carousel__navigation {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    padding: 0 var(--rhx-space-sm);
}

.rhx-carousel__nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: var(--rhx-border-width) solid var(--rhx-color-border);
    border-radius: var(--rhx-radius-full);
    background: var(--rhx-color-surface);
    color: var(--rhx-color-text);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: var(--rhx-shadow-sm);
    transition: background-color 0.15s ease, opacity 0.15s ease;
    padding: 0;
}

.rhx-carousel__nav-button:hover {
    background: var(--rhx-color-neutral-100);
}

.rhx-carousel__nav-button:focus-visible {
    outline: 2px solid var(--rhx-color-brand-500);
    outline-offset: 2px;
}

.rhx-carousel__nav-button:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.rhx-carousel__nav-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Vertical navigation */
.rhx-carousel--vertical .rhx-carousel__navigation {
    flex-direction: column;
    padding: var(--rhx-space-sm) 0;
}

/* ── Pagination dots ── */
.rhx-carousel__pagination {
    display: flex;
    justify-content: center;
    gap: var(--rhx-space-xs);
    padding: var(--rhx-space-md) 0;
}

.rhx-carousel__dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: var(--rhx-radius-full);
    border: var(--rhx-border-width) solid var(--rhx-color-border);
    background: var(--rhx-color-neutral-200);
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.rhx-carousel__dot:hover {
    background: var(--rhx-color-neutral-400);
}

.rhx-carousel__dot[aria-selected="true"] {
    background: var(--rhx-color-brand-500);
    border-color: var(--rhx-color-brand-500);
    transform: scale(1.25);
}

.rhx-carousel__dot:focus-visible {
    outline: 2px solid var(--rhx-color-brand-500);
    outline-offset: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .rhx-carousel__track {
        transition-duration: 0.01ms;
    }

    .rhx-carousel__dot,
    .rhx-carousel__nav-button {
        transition-duration: 0.01ms;
    }
}
