/* carousel-fix.css — APENAS ugc-video-carousel (TikTok videos) */
/* Scope estreito pra não quebrar experts-say-carousel / press / reviews que já funcionam */

ugc-video-carousel {
  display: block;
  width: 100%;
  overflow: hidden;
}

ugc-video-carousel > .swiper {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

ugc-video-carousel > .swiper > .swiper-wrapper {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 16px !important;
  transform: none !important;
  transition: none !important;
  width: max-content !important;
  align-items: stretch !important;
}

ugc-video-carousel .swiper-slide[data-video-slide] {
  flex: 0 0 258px !important;
  width: 258px !important;
  max-width: 258px !important;
  min-width: 258px !important;
  margin-right: 0 !important;
  scroll-snap-align: start;
  height: auto !important;
}

@media (max-width: 767px) {
  ugc-video-carousel .swiper-slide[data-video-slide] {
    flex: 0 0 200px !important;
    width: 200px !important;
    max-width: 200px !important;
    min-width: 200px !important;
  }
}

/* Aspect-ratio container do vídeo — 9:16 vertical */
ugc-video-carousel .swiper-slide[data-video-slide] .jc-w-auto {
  aspect-ratio: 9 / 16 !important;
  width: 100% !important;
  position: relative !important;
}

ugc-video-carousel [data-video-poster],
ugc-video-carousel [data-video-item] {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Hide scrollbar visualmente */
ugc-video-carousel > .swiper::-webkit-scrollbar {
  height: 4px;
}
ugc-video-carousel > .swiper::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* Garante poster SEMPRE visível por padrão */
ugc-video-carousel [data-video-poster] {
  opacity: 1 !important;
  z-index: 2 !important;
  display: block !important;
}
ugc-video-carousel [data-video-item] {
  opacity: 0 !important;
  z-index: 0 !important;
}

/* Play state — só quando JS realmente seta */
ugc-video-carousel [data-video-slide][data-playing="true"] [data-video-poster] {
  opacity: 0 !important;
  pointer-events: none !important;
}
ugc-video-carousel [data-video-slide][data-playing="true"] [data-video-item] {
  opacity: 1 !important;
  z-index: 4 !important;
}
ugc-video-carousel [data-video-slide][data-playing="true"] [data-video-play] {
  display: none !important;
}

/* Play button — maior, mais centralizado, melhor visual */
ugc-video-carousel [data-video-play] {
  width: 56px !important;
  height: 56px !important;
  z-index: 3 !important;
}
ugc-video-carousel [data-video-slide]:hover [data-video-play] {
  transform: translate(-50%, -50%) scale(1.1) !important;
}

/* ============================================================
   UGC DOTS — pagination indicator
   ============================================================ */
.ugc-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px auto 0;
  padding: 8px 12px;
  flex-wrap: wrap;
  max-width: 100%;
}
.ugc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.ugc-dot:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: scale(1.15);
}
.ugc-dot[aria-current="true"] {
  background: #ff30cc;
  transform: scale(1.3);
}
@media (max-width: 767px) {
  .ugc-dots {
    margin-top: 12px;
    gap: 6px;
  }
  .ugc-dot {
    width: 7px;
    height: 7px;
  }
}

/* ============================================================
   PRODUCT GALLERY — só carousel mode dentro da PDP main
   (NÃO aplica a featured-product blocks na home — esses têm
   product-gallery--desktop-thumbnails-left nativo do Shopify)
   ============================================================ */

/* DESKTOP + MOBILE: thumbs ROW abaixo da main image */
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__ar-wrapper {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  align-items: stretch !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__media-list-wrapper {
  order: 1 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__thumbnail-list-wrapper {
  order: 2 !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__thumbnail-list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 8px 0 !important;
  justify-content: flex-start !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__thumbnail-list::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__thumbnail {
  flex: 0 0 auto !important;
  width: 72px !important;
  height: 72px !important;
}
@media (max-width: 767px) {
  .shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__thumbnail {
    width: 56px !important;
    height: 56px !important;
  }
}

/* Main carousel: horizontal scroll */
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__media-list,
.shopify-section--main-product .product-gallery--desktop-carousel media-carousel.product-gallery__media-list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  width: 100% !important;
  max-width: 100% !important;
  touch-action: pan-x pan-y pinch-zoom !important;
  cursor: grab !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__media-list::-webkit-scrollbar {
  display: none !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__media {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  scroll-snap-align: start !important;
  width: 100% !important;
}

/* Thumbnail base */
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__thumbnail {
  cursor: pointer !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 2px solid transparent !important;
  background: transparent !important;
  padding: 0 !important;
  transition: border-color 0.2s !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__thumbnail[aria-current="true"] {
  border-color: #1a1a1a !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__thumbnail img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* Nav buttons */
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__nav-button {
  pointer-events: auto !important;
  cursor: pointer !important;
}
.shopify-section--main-product .product-gallery--desktop-carousel .product-gallery__nav-button.disabled {
  opacity: 0.3 !important;
  pointer-events: none !important;
}

/* ============================================================
   UGC mobile swipe — make sure touch scroll works
   ============================================================ */
@media (max-width: 767px) {
  ugc-video-carousel > .swiper {
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    overflow-x: auto !important;
  }
  ugc-video-carousel > .swiper > .swiper-wrapper {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
