/**
 * Trusted-Heroes Kategorie Carousel.
 * Leichtgewichtiges Scroll-Snap-Carousel ohne Fremd-Library.
 */

.th-carousel {
    position: relative;
    width: 100%;
}

.th-carousel-track {
    --pv: var(--th-per-view, 3);

    display: flex;
    gap: var(--th-gap, 20px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.th-carousel-track::-webkit-scrollbar {
    display: none;
}

.th-carousel-slide {
    position: relative;
    flex: 0 0 calc( ( 100% - ( var(--pv) - 1 ) * var(--th-gap, 20px) ) / var(--pv) );
    height: 260px; /* wird per Elementor-Control überschrieben */
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    scroll-snap-align: start;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-decoration: none;
    color: inherit;
}

.th-carousel-overlay {
    position: absolute;
    inset: 0;
    background: rgba( 0, 0, 0, 0.35 );
    transition: background 0.25s ease;
}

.th-carousel-slide:hover .th-carousel-overlay {
    background: rgba( 0, 0, 0, 0.5 );
}

.th-carousel-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.th-carousel-name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.th-carousel-count {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
    color: #fff;
}

.th-carousel-desc {
    font-size: 14px;
    line-height: 1.4;
    color: rgba( 255, 255, 255, 0.85 );
}

/* Pfeile */
.th-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY( -50% );
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba( 255, 255, 255, 0.9 );
    color: #111;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.2 );
    transition: background 0.2s ease;
}
.th-carousel-arrow:hover{
    background: #204768 !important;
}
.th-carousel-arrow{
    border: 1px solid #204768 !important;
    border-radius: 50% !important;
    color: #fff !important;
    display: inline-block !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    padding: .5rem 1rem !important;
    text-align: center !important;
    transition: all .3s !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
    white-space: nowrap !important;
    background: #204768b2 !important;
}
.th-carousel-arrow:hover {
    background: #fff;
}

.th-carousel-prev {
    left: -18px;
}

.th-carousel-next {
    right: -18px;
}

/* Responsive Kachel-Anzahl */
@media ( max-width: 1024px ) {
    .th-carousel-track {
        --pv: var(--th-per-view-tablet, 2);
    }
}

@media ( max-width: 640px ) {
    .th-carousel-track {
        --pv: var(--th-per-view-mobile, 1);
    }

    .th-carousel-arrow {
        display: none;
    }
}
