/* Main wrapper */
.testimonial-main {
  position: relative;
  max-width: 1400px;
  height: 500px;
  margin: 40px auto;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

/* YouTube iframe / Video element */
#main-video {
  width: 100%;
  height: 100%;
  border: none;
}
#main-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Poster overlay */
#poster-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none !important;
}
#poster-overlay.hidden {
  opacity: 0;
  pointer-events: none !important;
}

/* Play button with pulse animation */
#poster-overlay .play-btn {
  position: relative;
  z-index: 20 !important;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: auto !important;
}
.play-btn svg {
  width: 90px;
  height: 90px;
  cursor: pointer;
  transition: transform 0.3s ease;
  animation: pulse 1.8s infinite;
  pointer-events: none;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.play-btn svg:hover {
  animation: none;
  transform: scale(1.2);
}

/* Overlay box */
.text-overlay {
  position: absolute;
  right: 40px;
  top: 40px;
  max-width: 380px;
  padding: 20px 30px;
  border-left: 2px solid #faaa13;
  background: linear-gradient(270deg, rgba(250, 166, 19, 0) 2.1%, rgba(250, 166, 19, 0.15) 100%);
  color: #fff;
  z-index: 10;
  border-radius: 4px;
  pointer-events: none !important;
}
.text-overlay h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 10px;
  pointer-events: none !important;
  user-select: none;
  -webkit-user-select: none;
}
.text-overlay p {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  margin: 0;
  pointer-events: none !important;
  user-select: none;
  -webkit-user-select: none;
}

/* Unmute button (top-left) */
.unmute-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0,0,0,0.7);
  border: 2px solid #faaa13;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  z-index: 15;
  display: none;
}
.unmute-btn:hover {
  background: rgba(250, 166, 19, 0.9);
  color: #000;
}

/* Thumbnails */
.testimonial-thumbs-wrapper {
  max-width: 1400px;
  margin: 25px auto;
  position: relative;
}

.testimonial-thumbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
@media(min-width: 768px) {
  .testimonial-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Carousel Layout */
.vtw-carousel-wrapper {
  position: relative;
  overflow: hidden;
}

.vtw-carousel {
  display: flex;
  transition: transform 0.4s ease;
  gap: 15px;
  overflow: visible;
  /* Fallback grid layout until JS initializes */
  flex-wrap: wrap;
}

/* When JS initializes, remove wrap and set proper widths */
.vtw-carousel.vtw-initialized {
  flex-wrap: nowrap;
}

.vtw-carousel .testimonial-thumb {
  flex: 0 0 auto;
  min-width: 0;
  /* Fallback: show as grid items until JS calculates widths */
  flex-basis: calc(25% - 11.25px); /* 4 items per row by default, accounting for gap */
  max-width: calc(25% - 11.25px);
}

/* Responsive fallback widths */
@media (max-width: 1024px) {
  .vtw-carousel .testimonial-thumb {
    flex-basis: calc(33.333% - 10px); /* 3 items */
    max-width: calc(33.333% - 10px);
  }
}

@media (max-width: 767px) {
  .vtw-carousel .testimonial-thumb {
    flex-basis: calc(50% - 7.5px); /* 2 items */
    max-width: calc(50% - 7.5px);
  }
}

/* When initialized, JS will override these with specific widths */
.vtw-carousel.vtw-initialized .testimonial-thumb {
  flex-basis: auto;
  max-width: none;
}

/* Carousel Navigation Arrows */
.vtw-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #faaa13;
  color: #fff;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 28px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: all 0.3s ease;
  padding: 0;
  line-height: 1;
}

.vtw-carousel-arrow:hover {
  background: rgba(250, 166, 19, 0.9);
  color: #000;
  transform: translateY(-50%) scale(1.1);
}

.vtw-carousel-prev {
  left: 10px;
}

.vtw-carousel-next {
  right: 10px;
}

@media (max-width: 767px) {
  .vtw-carousel-arrow {
    width: 35px;
    height: 35px;
    font-size: 22px;
  }
  .vtw-carousel-prev {
    left: 5px;
  }
  .vtw-carousel-next {
    right: 5px;
  }
}
.testimonial-thumb {
  cursor: pointer;
  border-bottom: 2px solid #333;
  text-align: center;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
}
.testimonial-thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.testimonial-thumb:hover img {
  transform: scale(1.08);
}
.testimonial-thumb h4 {
  padding: 10px 0;
  font-size: 15px;
  font-weight: 600;
  transition: color 0.3s ease;
}
.testimonial-thumb.active {
  border-bottom: 2px solid #faaa13;
  background: linear-gradient(rgba(250,166,19,0) 78%, rgba(250,166,19,0.15) 100%);
  color: #faaa13;
}
.testimonial-thumb.active h4 {
  color: #faaa13;
}

/* Hide overlay on mobile when toggle is ON */
@media (max-width: 767px) {
  .vtw-hide-overlay-yes .text-overlay {
    display: none !important;
  }
}
