/**
 * YouTube testimonials carousel.
 */

/* Hide Elementor "לקוחות מספרים" section when there are no videos */
body.zh-no-youtube-testimonials .youtube-testimonials-section,
body.zh-no-youtube-testimonials #testimonials-section,
body.zh-no-youtube-testimonials .elementor-element-4de895d,
body.zh-no-youtube-testimonials .elementor-element-5182e80,
.youtube-testimonials-section:not(:has(.zh-yt-testimonials)),
#testimonials-section:not(:has(.zh-yt-testimonials)),
.elementor-element-4de895d:not(:has(.zh-yt-testimonials)),
.elementor-element-5182e80:not(:has(.zh-yt-testimonials)) {
    display: none !important;
}

.elementor-widget-shortcode .zh-yt-testimonials,
.elementor-element .zh-yt-testimonials {
    display: block;
    width: 100%;
    max-width: 100%;
}

.zh-yt-testimonials {
    --zh-yt-gap: 16.5px;
    --zh-yt-video-height: 320px;
    --zh-yt-video-radius: 16px;
    --zh-yt-caption-margin-top: 19px;
    width: 100%;
}

.zh-yt-testimonials__swiper {
    overflow: hidden;
    width: 100%;
    cursor: default;
    touch-action: pan-x pinch-zoom;
}

.zh-yt-testimonials__swiper .swiper-wrapper {
    align-items: stretch;
}

.zh-yt-testimonials__swiper .swiper-slide {
    height: auto;
    cursor: default;
}

.zh-yt-testimonials__swiper:not(.swiper-initialized) .swiper-slide:not(:first-child) {
    display: none;
}

.zh-yt-testimonials__slide {
    height: auto;
}

.zh-yt-testimonials__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.zh-yt-testimonials__media {
    position: relative;
    width: 100%;
    height: var(--zh-yt-video-height);
    min-height: var(--zh-yt-video-height);
    border-radius: var(--zh-yt-video-radius);
    overflow: hidden;
    background: #000;
}

.zh-yt-testimonials__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
}

.zh-yt-testimonials button.zh-yt-testimonials__play {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    line-height: 0;
    color: inherit;
    font: inherit;
    min-height: 0;
    touch-action: pan-x pinch-zoom;
}

.zh-yt-testimonials button.zh-yt-testimonials__play:hover,
.zh-yt-testimonials button.zh-yt-testimonials__play:focus,
.zh-yt-testimonials button.zh-yt-testimonials__play:active {
    background: transparent;
    opacity: 1;
    transform: none;
    box-shadow: none;
    color: inherit;
}

.zh-yt-testimonials__icon {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: auto;
    top: auto;
    width: 48px;
    height: 34px;
    pointer-events: none;
}

.zh-yt-testimonials__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.zh-yt-testimonials__iframe-wrap {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
}

.zh-yt-testimonials__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.zh-yt-testimonials__caption {
    margin: var(--zh-yt-caption-margin-top) 0 0;
    padding: 0;
    width: 100%;
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 25px;
    text-align: center;
    color: #000;
}

.zh-yt-testimonials__controls {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 24px;
}

.zh-yt-testimonials__controls-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    direction: ltr;
    min-height: 24px;
}

.zh-yt-testimonials button.zh-yt-testimonials__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #1A0510;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 24px;
    min-height: 0;
}

.zh-yt-testimonials button.zh-yt-testimonials__arrow:hover,
.zh-yt-testimonials button.zh-yt-testimonials__arrow:focus,
.zh-yt-testimonials button.zh-yt-testimonials__arrow:active {
    background: transparent;
    color: #1A0510;
    opacity: 1;
    transform: none;
    box-shadow: none;
}

.zh-yt-testimonials__arrow.swiper-button-disabled {
    opacity: 1;
    color: #C4B5BC;
    cursor: default;
    pointer-events: none;
}

/* Static pagination — same on all screen sizes */
.zh-yt-testimonials .zh-yt-testimonials__pagination.swiper-pagination-horizontal.swiper-pagination-bullets {
    position: relative !important;
    inset: auto !important;
    bottom: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 0;
}

/* Controls are LTR for arrow layout; bullets must stay RTL so slide 1 = rightmost dot */
body.rtl .zh-yt-testimonials .zh-yt-testimonials__pagination.swiper-pagination-horizontal.swiper-pagination-bullets,
html[dir="rtl"] .zh-yt-testimonials .zh-yt-testimonials__pagination.swiper-pagination-horizontal.swiper-pagination-bullets {
    flex-direction: row-reverse;
}

.zh-yt-testimonials__pagination-wrap {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    max-width: 100%;
}

.zh-yt-testimonials__pagination .swiper-pagination-bullet {
    position: static !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    width: 8px;
    height: 8px;
    margin: 0 4px !important;
    opacity: 1;
    background: #C4B5BC;
    border-radius: 50%;
}

.zh-yt-testimonials__pagination .swiper-pagination-bullet-active {
    background: #1A0510;
}

@media (max-width: 1024px) {
    .zh-yt-testimonials {
        --zh-yt-video-height: 300px;
    }
}
