.kt-carousel-container {
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    --row-height: var(--base-row-height);
    --spacing: var(--base-spacing);
    gap: var(--spacing);
}

.kt-carousel-row {
    width: 100%;
    overflow: hidden;
}

.kt-carousel-track {
    display: flex;
    width: max-content;
    gap: var(--spacing);
    animation: kt-scroll var(--duration) linear infinite;
    animation-direction: var(--direction);
    will-change: transform;
}

.kt-carousel-item {
    flex-shrink: 0;
    height: var(--row-height);
}

.kt-carousel-item img {
    height: 100%;
    width: auto;
    display: block;
}

@keyframes kt-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        /* Move exactly half the track width (since track is duplicated) */
        transform: translateX(-50%);
    }
}

/* Pause on hover - only if interactive is enabled */
.kt-carousel-container.kt-is-interactive .kt-carousel-track:hover {
    animation-play-state: paused;
}

/* Gallery: fixed frame above the scrolling row */
.kt-gallery-stage {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    aspect-ratio: 3 / 2;
    background-color: transparent;
    overflow: hidden;
}

.kt-carousel-container .kt-gallery-stage > .kt-gallery-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center center;
}

.kt-is-gallery .kt-carousel-item {
    cursor: pointer;
}

.kt-is-gallery .kt-carousel-item img {
    -webkit-user-drag: none;
    user-select: none;
}

.kt-is-gallery .kt-carousel-item.is-selected,
.kt-is-gallery .kt-carousel-item:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

/* Manual control: no auto-scroll; desktop side arrows; touch swipe via JS */
.kt-is-manual .kt-carousel-row {
    position: relative;
    touch-action: pan-y;
}

.kt-is-manual .kt-carousel-track {
    animation: none;
    will-change: transform;
    transform: translateX(0);
}

.kt-manual-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: min(5.5rem, 18%);
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.kt-manual-prev {
    left: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
}

.kt-manual-next {
    right: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
}

.kt-manual-arrow:hover,
.kt-manual-arrow:focus-visible {
    opacity: 1;
}

.kt-manual-arrow:focus,
.kt-manual-arrow:focus-visible {
    outline: none;
    box-shadow: none;
}

.kt-manual-arrow-icon {
    position: absolute;
    top: 50%;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transform: translateY(-50%);
}

.kt-manual-prev .kt-manual-arrow-icon {
    left: 0.65rem;
}

.kt-manual-next .kt-manual-arrow-icon {
    right: 0.65rem;
}

.kt-manual-arrow-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.55rem;
    height: 0.55rem;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.kt-manual-prev .kt-manual-arrow-icon::before {
    transform: translate(-35%, -50%) rotate(-135deg);
}

.kt-manual-next .kt-manual-arrow-icon::before {
    transform: translate(-65%, -50%) rotate(45deg);
}

/* Touch / coarse pointer: hide arrows; swipe handles scrolling */
@media (hover: none), (pointer: coarse) {
    .kt-manual-arrow {
        display: none;
    }
}

/* Mobile Responsiveness */
@media (max-width: 680px) {
    .kt-carousel-container {
        --row-height: calc(var(--base-row-height) * var(--responsive-scale, 0.6));
        --spacing: calc(var(--base-spacing) * var(--responsive-scale, 0.6));
    }
}