/* Category carousel — shared 16:9 infinite loop slider */
.cat-carousel {
    --cat-carousel-gap: 12px;
    --cat-carousel-slide-pct: 100%;
    --cat-carousel-duration: 0.45s;
    position: relative;
    width: 100%;
    margin: 0 0 50px;
    padding: 16px 0 44px;
    user-select: none;
    -webkit-user-select: none;
}

.cat-carousel__viewport {
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
    cursor: grab;
    direction: ltr;
}

.cat-carousel__viewport.is-dragging {
    cursor: grabbing;
}

.cat-carousel__track {
    display: flex;
    align-items: center;
    will-change: transform;
}

.cat-carousel__track.no-transition {
    transition: none !important;
}

.cat-carousel__track.is-animating {
    transition: transform var(--cat-carousel-duration) cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cat-carousel__slide {
    flex: 0 0 var(--cat-carousel-slide-pct);
    flex-shrink: 0;
    padding: 0 calc(var(--cat-carousel-gap) / 2);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-carousel__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #e9ecef;
    box-shadow: 0 8px 32px rgba(46, 58, 89, 0.12);
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.cat-carousel__slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}

.cat-carousel__btn {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #2E3A59;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    align-items: center;
    justify-content: center;
}

.cat-carousel__btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.cat-carousel__btn--prev {
    right: 12px;
}

.cat-carousel__btn--next {
    left: 12px;
}

.cat-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 0 16px;
}

.cat-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #cbd5e1;
    cursor: pointer;
    transition: width 0.3s, background 0.3s;
}

.cat-carousel__dot.is-active {
    width: 24px;
    border-radius: 4px;
    background: #7a90c9;
}

.cat-carousel-description {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    padding: 30px 40px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: #2E3A59;
    font-size: 16px;
    line-height: 1.8;
}

@media (min-width: 769px) {
    .cat-carousel {
        --cat-carousel-gap: 20px;
        --cat-carousel-slide-pct: 72%;
        padding: 20px 0 48px;
    }

    .cat-carousel__viewport {
        cursor: default;
    }

    /* Keep 16:9 — shrink width (not height) when 80vh cap applies */
    .cat-carousel__frame {
        width: min(100%, calc(80vh * 16 / 9));
        aspect-ratio: 16 / 9;
        margin: 0 auto;
    }

    .cat-carousel__slide:not(.is-active) .cat-carousel__frame {
        transform: scale(0.94);
        opacity: 0.65;
    }

    .cat-carousel__slide.is-active .cat-carousel__frame {
        transform: scale(1);
        opacity: 1;
    }

    .cat-carousel__btn {
        display: flex;
    }
}
