/**
 * Addon CSS: Shoppable Video Slider ("See how it looks on...") with Lightbox Modal
 * Theme: Zurix
 */

.zurix-shoppable-video-widget {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.shoppable-video-header {
  margin-bottom: 24px;
}

.shoppable-video-title {
  font-size: 32px;
  font-weight: 600;
  color: #111111;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.shoppable-video-subtitle {
  font-size: 15px;
  color: #666666;
  margin: 0;
}

/* ── Swiper Container & Navigation ──────────────────────── */
.zurix-shoppable-video-swiper {
  position: relative;
  overflow: hidden;
  padding: 4px 0 10px 0;
}

.shoppable-video-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111111;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.shoppable-video-nav-prev {
  left: 12px;
}

.shoppable-video-nav-next {
  right: 12px;
}

.shoppable-video-nav:hover {
  background: #111111;
  color: #ffffff;
  transform: translateY(-50%) scale(1.08);
}

.shoppable-video-nav.swiper-button-disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* ── Video Card Item ────────────────────────────────────── */
.shoppable-video-slide {
  height: auto;
  box-sizing: border-box;
}

.shoppable-video-card {
  position: relative;
  width: 100%;
  height: 520px;
  border-radius: 16px;
  overflow: hidden;
  background-color: #111111;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transform: translateZ(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.shoppable-video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.shoppable-video-card video,
.shoppable-video-card img.shoppable-video-fallback-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

/* ── Play Button Overlay (Main & Modal) ─────────────────── */
.shoppable-video-player,
.shoppable-video-modal-player {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  cursor: pointer;
  z-index: 25 !important;
  padding: 0;
  margin: 0;
  outline: none;
  opacity: 1 !important;
  visibility: visible !important;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.shoppable-video-player svg,
.shoppable-video-modal-player svg {
  width: 22px !important;
  height: 22px !important;
  fill: #ffffff !important;
  stroke: none !important;
  display: block !important;
  margin: 0 !important;
}

.shoppable-video-player svg path,
.shoppable-video-modal-player svg path {
  fill: #ffffff !important;
}

.shoppable-video-card:hover .shoppable-video-player,
.shoppable-video-modal-card:hover .shoppable-video-modal-player {
  background: rgba(0, 0, 0, 0.85) !important;
  border-color: #ffffff !important;
  transform: translate(-50%, -50%) scale(1.12);
  opacity: 1 !important;
  visibility: visible !important;
}

/* When video is actively playing in modal */
.shoppable-video-modal-card.is-playing .shoppable-video-modal-player {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.shoppable-video-modal-card.is-playing:hover .shoppable-video-modal-player {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* ── Tag Handle Badge ───────────────────────────────────── */
.shoppable-video-tag-wrapper {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 30px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 5;
  pointer-events: none;
  max-width: calc(100% - 32px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shoppable-video-tag-wrapper svg {
  width: 14px;
  height: 14px;
  fill: #ffffff;
  flex-shrink: 0;
}

.shoppable-video-tag {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── LIGHTBOX MODAL POPUP (FULL SCREEN COVER - HIGH Z-INDEX) ────── */
body .shoppable-video-modal-popup {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999999999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  box-sizing: border-box;
}

body .shoppable-video-modal-popup.is-open {
  opacity: 1;
  visibility: visible;
}

.shoppable-video-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1;
}

/* Screen Top-Right Close Button */
.shoppable-video-modal-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  z-index: 99999 !important;
  transition: all 0.25s ease;
  outline: none;
  padding: 0;
  margin: 0;
}

.shoppable-video-modal-close svg {
  width: 18px !important;
  height: 18px !important;
  stroke: #ffffff !important;
  display: block !important;
}

.shoppable-video-modal-close:hover {
  background: rgba(0, 0, 0, 0.8) !important;
  transform: scale(1.08);
}

.shoppable-video-modal-container {
  position: relative;
  width: 100%;
  height: 88vh;
  max-height: 820px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shoppable-video-modal-swiper {
  width: 100%;
  height: 100%;
  overflow: visible !important;
}

/* Swiper Slides Layout */
.shoppable-video-modal-slide {
  width: calc(88vh * 9 / 16) !important;
  max-width: 420px;
  min-width: 320px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  filter: brightness(0.65);
  transition: opacity 0.3s ease, filter 0.3s ease;
  box-sizing: border-box;
  cursor: pointer;
}

.shoppable-video-modal-slide.swiper-slide-active {
  opacity: 1;
  filter: brightness(1);
  cursor: default;
  z-index: 10;
}

/* Hide Play Overlay Buttons on Non-Active Peek Slides */
.shoppable-video-modal-slide:not(.swiper-slide-active) .shoppable-video-modal-player {
  display: none !important;
}

.shoppable-video-modal-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background-color: #000000;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

/* Active Card Top-Right Close (X) Button */
.shoppable-video-modal-card-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  z-index: 35 !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  outline: none;
  padding: 0;
  margin: 0;
}

.shoppable-video-modal-card-close svg {
  width: 14px !important;
  height: 14px !important;
  stroke: #ffffff !important;
  display: block !important;
}

.shoppable-video-modal-slide.swiper-slide-active .shoppable-video-modal-card-close {
  opacity: 1;
  visibility: visible;
}

.shoppable-video-modal-card-close:hover {
  background: rgba(0, 0, 0, 0.85) !important;
  transform: scale(1.1);
}

.shoppable-video-modal-card video,
.shoppable-video-modal-card img.shoppable-video-modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

/* ── Shoppable Product Card Overlay ─────────────────────── */
.shoppable-video-product-card {
  position: absolute;
  bottom: 18px;
  left: 14px;
  right: 14px;
  width: auto;
  background: rgba(20, 20, 20, 0.6) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 14px !important;
  padding: 10px 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  text-decoration: none !important;
  color: #ffffff !important;
  z-index: 25 !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  box-sizing: border-box !important;
}

.shoppable-video-product-card:hover {
  background: rgba(30, 30, 30, 0.88) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
}

.shoppable-product-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
}

.shoppable-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shoppable-product-info {
  flex-grow: 1;
  overflow: hidden;
  text-align: left;
}

.shoppable-product-title {
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.shoppable-product-price {
  font-size: 14px;
  font-weight: 400;
  color: #dddddd;
  line-height: 1.2;
}

/* Modal Nav Arrows (Positioned near active center slide) */
.shoppable-video-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  cursor: pointer;
  z-index: 50 !important;
  transition: all 0.25s ease;
}

.shoppable-video-modal-prev {
  left: calc(50% - 215px);
}

.shoppable-video-modal-next {
  right: calc(50% - 215px);
}

.shoppable-video-modal-nav:hover {
  background: rgba(0, 0, 0, 0.9) !important;
  transform: translateY(-50%) scale(1.12);
}

.shoppable-video-modal-nav.swiper-button-disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

/* ── Responsive Controls ────────────────────────────────── */
@media (max-width: 991px) {
  .shoppable-video-title {
    font-size: 26px;
  }
  .shoppable-video-card {
    height: 440px;
  }
  .shoppable-video-modal-container {
    height: 520px;
  }
  .shoppable-video-modal-slide {
    width: 290px !important;
  }
  .shoppable-video-modal-prev {
    left: calc(50% - 170px);
  }
  .shoppable-video-modal-next {
    right: calc(50% - 170px);
  }
}

@media (max-width: 767px) {
  .shoppable-video-title {
    font-size: 22px;
  }
  .shoppable-video-card {
    height: 380px;
    border-radius: 12px;
  }
  .shoppable-video-card video,
  .shoppable-video-card img.shoppable-video-fallback-img {
    border-radius: 12px;
  }
  .shoppable-video-player,
  .shoppable-video-modal-player {
    width: 44px;
    height: 44px;
  }
  .shoppable-video-player svg,
  .shoppable-video-modal-player svg {
    width: 16px !important;
    height: 16px !important;
  }
  .shoppable-video-tag-wrapper {
    bottom: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 12px;
  }
  .shoppable-video-modal-container {
    height: 78vh;
  }
  .shoppable-video-modal-slide {
    width: 82vw !important;
    max-width: 310px;
  }
  .shoppable-video-modal-close {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  .shoppable-video-modal-prev {
    left: 8px;
  }
  .shoppable-video-modal-next {
    right: 8px;
  }
}
