/* Stacked Carousel CSS - Updated with Improved Design */
/* This file contains all CSS for the stacked carousel implementation */

/* ===== BASE STACKED CAROUSEL STYLES ===== */

/* Common stacked carousel wrapper with increased padding for navigation */
.carousel-wrapper[data-carousel-type="stacked"] {
  position: relative;
  width: 100%;
  margin: 20px auto 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-wrapper[data-carousel-type="stacked"] .swiper {
  width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.carousel-wrapper[data-carousel-type="stacked"] .swiper-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  z-index: 1;
  display: flex;
  transition-property: transform;
  transition-timing-function: var(
    --swiper-wrapper-transition-timing-function,
    initial
  );
  box-sizing: content-box;
}

.carousel-wrapper[data-carousel-type="stacked"] .swiper-slide {
  display: flex;
  flex-direction: column;
  height: auto;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  position: relative;
  transition: all 0.3s ease;
}

/* ===== DESKTOP STACKED CAROUSEL (IMPROVED FIXED 3 SLIDES) ===== */
@media (min-width: 992px) {
  .carousel-wrapper[data-carousel-type="stacked"] {
    max-width: 70vw;
    padding: 0 120px; /* Increased space for better navigation positioning */
    overflow: visible;
  }

  .carousel-wrapper[data-carousel-type="stacked"] .swiper {
    overflow: visible;
    pointer-events: none; /* Disable swiper interactions */
  }

  .carousel-wrapper[data-carousel-type="stacked"] .swiper-wrapper {
    align-items: center !important; /* Center alignment for scaling effect */
    justify-content: center !important;
    gap: 25px !important; /* Increased gap between slides */
    transform: none !important; /* No swiper transforms */
    transition: none !important; /* No swiper transitions */
  }

  /* Base slide styling - decreased size */
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-slide {
    width: 280px !important; /* Decreased from 400px */
    height: 500px !important; /* Fixed height for consistency */
    flex-shrink: 0 !important;
    opacity: 1 !important;
    transform: scale(0.85) !important; /* Side slides are smaller */
    z-index: 1 !important;
    pointer-events: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  }

  /* Middle slide is larger and more prominent */
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-slide:nth-child(2) {
    transform: scale(1) !important; /* Normal size for middle slide */
    z-index: 2 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
  }

  /* Hide slides beyond the first 3 */
  .carousel-wrapper[data-carousel-type="stacked"]
    .swiper-slide:nth-child(n + 4) {
    display: none !important;
  }

  /* Ensure first 3 slides are always visible with proper scaling */
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-slide:nth-child(1),
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-slide:nth-child(3) {
    display: flex !important;
    opacity: 1 !important;
    width: 280px !important;
    height: 500px !important;
    transform: scale(0.85) !important; /* Side slides smaller */
  }

  .carousel-wrapper[data-carousel-type="stacked"] .swiper-slide:nth-child(2) {
    display: flex !important;
    opacity: 1 !important;
    width: 280px !important;
    height: 500px !important;
    transform: scale(1) !important; /* Middle slide normal size */
  }

  /* Video containers - improved with fixed dimensions */
  .carousel-wrapper[data-carousel-type="stacked"] .reel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    background-color: #000;
    border-radius: 12px;
  }

  /* Videos - same styling as normal carousel */
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-slide video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    background-color: #000;
    border-radius: 12px;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  /* Enhanced Stacked Navigation Buttons */
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-prev,
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 55px !important; /* Larger buttons */
    height: 55px !important;
    background: rgba(
      255,
      255,
      255,
      0.95
    ) !important; /* More opaque background */
    color: #333 !important; /* Darker text for better contrast */
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    transition: all 0.3s ease !important;
    font-size: 22px !important;
    font-weight: bold !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    font-family: Arial, sans-serif !important;
    backdrop-filter: blur(10px) !important;
  }

  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-prev {
    left: 35px !important; /* Better positioning */
  }

  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-next {
    right: 35px !important; /* Better positioning */
  }

  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-prev:hover,
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-next:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
  }

  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-prev:active,
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-next:active {
    transform: translateY(-50%) scale(0.95) !important;
  }

  /* Button focus states for accessibility */
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-prev:focus,
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-next:focus {
    outline: 2px solid #007aff !important;
    outline-offset: 2px !important;
  }

  /* Hide any default swiper navigation on desktop */
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-button-prev,
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-button-next {
    display: none !important;
  }
}

/* ===== PRODUCT INFO SECTION (BOTTOM POSITIONED LIKE NORMAL) ===== */
.carousel-wrapper[data-carousel-type="stacked"] .product-info-section {
  display: none;
}

.carousel-wrapper[data-carousel-type="stacked"]
  .product-info-section[data-product-id] {
  display: block;
  padding: 8px; /* Reduced from 12px */
  background: #ffffff;
  border-top: 1px solid #eee;
  position: relative;
  padding-top: 28px; /* Reduced from 40px */
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 8px 8px;
  pointer-events: auto !important;
  /* Remove hover-based transforms - always show */
  transform: none !important;
  opacity: 1 !important;
  transition: none !important;
}

.carousel-wrapper[data-carousel-type="stacked"] .product-image-container {
  position: absolute;
  top: -28px; /* Reduced from -40px */
  left: 8px; /* Reduced from 15px */
  width: 56px; /* Reduced from 80px (30% smaller) */
  height: 56px; /* Reduced from 80px (30% smaller) */
  border: 2px solid #ffffff; /* Reduced from 3px */
  border-radius: 6px; /* Reduced from 8px */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: #ffffff;
  overflow: hidden;
}

.carousel-wrapper[data-carousel-type="stacked"] .product-info-content {
  display: flex;
  flex-direction: column;
  gap: 8px; /* Reduced from 12px */
  margin-left: 2px;
  width: 100%;
  min-width: 0;
  text-align: left;
  padding-top: 6px; /* Reduced from 10px */
}

.carousel-wrapper[data-carousel-type="stacked"] .product-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.carousel-wrapper[data-carousel-type="stacked"]
  .product-info-section[data-product-id]
  .product-info-content
  .product-title {
  width: 100% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 12px !important; /* Reduced from 16px */
  font-weight: 600 !important;
  color: #333 !important;
  display: block !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.carousel-wrapper[data-carousel-type="stacked"] .price {
  margin: 4px 0 0 0; /* Reduced from 8px */
  color: #e74c3c;
  font-weight: 600;
  font-size: 14px; /* Reduced from 18px */
}

.carousel-wrapper[data-carousel-type="stacked"] .sale-badge {
  position: absolute;
  top: 10px; /* Reduced from 15px */
  right: 10px; /* Reduced from 15px */
  padding: 4px 8px; /* Reduced from 6px 12px */
  border-radius: 12px; /* Reduced from 15px */
  font-size: 10px; /* Reduced from 12px */
  font-weight: bold;
  background: #e74c3c;
  color: white;
  z-index: 10;
}

/* ===== ADD TO CART BUTTON (SMALLER FOR STACKED) ===== */
.carousel-wrapper[data-carousel-type="stacked"] .add-to-cart-btn {
  padding: 6px 12px; /* Reduced from 10px 20px */
  border-radius: 4px; /* Reduced from 6px */
  border: none;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
  transition: all 0.2s ease;
  box-sizing: border-box;
  font-size: 11px; /* Reduced from 14px */
  text-align: center;
  pointer-events: auto !important;
  background: #3498db;
  color: white;
}

.carousel-wrapper[data-carousel-type="stacked"] .add-to-cart-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

.carousel-wrapper[data-carousel-type="stacked"] .add-to-cart-btn:active {
  transform: translateY(0);
}

/* ===== LOADING AND ERROR STATES ===== */
.carousel-wrapper[data-carousel-type="stacked"] .reel-container.loading {
  background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
    linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  animation: loading-stripes 1s linear infinite;
}

@keyframes loading-stripes {
  0% {
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  }
  100% {
    background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px;
  }
}

.carousel-wrapper[data-carousel-type="stacked"] .reel-container.error {
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
}

.carousel-wrapper[data-carousel-type="stacked"] .loading-slide,
.carousel-wrapper[data-carousel-type="stacked"] .error-slide {
  height: 500px; /* Match slide height */
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-wrapper[data-carousel-type="stacked"] .loading,
.carousel-wrapper[data-carousel-type="stacked"] .error-message {
  text-align: center;
  padding: 20px;
  color: #666;
  background: #f8f8f8;
  border-radius: 8px;
  width: 100%;
}

/* ===== VIDEO LOADING INDICATOR ===== */
.carousel-wrapper[data-carousel-type="stacked"] .video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 20px;
  display: none;
}

.carousel-wrapper[data-carousel-type="stacked"]
  .reel-container.loading
  .video-loading {
  display: block;
}

/* ===== MANUAL PLAY BUTTON ===== */
.carousel-wrapper[data-carousel-type="stacked"] .manual-play-btn {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: rgba(0, 0, 0, 0.7) !important;
  color: white !important;
  border-radius: 50% !important;
  width: 65px !important;
  height: 65px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 24px !important;
  cursor: pointer !important;
  z-index: 100 !important;
  border: 3px solid white !important;
  transition: all 0.3s ease !important;
  pointer-events: auto !important;
}

.carousel-wrapper[data-carousel-type="stacked"] .manual-play-btn:hover {
  background: rgba(0, 0, 0, 0.9) !important;
  transform: translate(-50%, -50%) scale(1.1) !important;
}

/* ===== MOBILE STACKED CAROUSEL ===== */
@media (max-width: 991px) {
  .carousel-wrapper[data-carousel-type="stacked"] {
    max-width: 100%;
    padding: 0 20px;
    margin: 10px auto;
  }

  .carousel-wrapper[data-carousel-type="stacked"] .swiper {
    overflow: hidden;
    pointer-events: auto; /* Enable touch on mobile */
  }

  .carousel-wrapper[data-carousel-type="stacked"] .swiper-wrapper {
    display: flex;
    transition-property: transform;
    gap: 15px;
  }

  .carousel-wrapper[data-carousel-type="stacked"] .swiper-slide {
    width: 280px !important;
    height: 450px !important;
    flex-shrink: 0;
    pointer-events: auto;
    transform: scale(1) !important; /* No scaling on mobile */
  }

  /* Hide stacked navigation on mobile */
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-prev,
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-next {
    display: none !important;
  }

  /* Show mobile pagination */
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-pagination {
    display: block !important;
    position: relative !important;
    margin-top: 15px !important;
  }

  .carousel-wrapper[data-carousel-type="stacked"] .reel-container {
    height: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
  }

  .carousel-wrapper[data-carousel-type="stacked"] .manual-play-btn {
    width: 55px !important;
    height: 55px !important;
    font-size: 20px !important;
  }

  /* Show product info directly on mobile */
  .carousel-wrapper[data-carousel-type="stacked"] .product-info-section {
    position: relative !important;
    bottom: auto !important;
    transform: none !important;
    opacity: 1 !important;
    margin-top: 15px !important;
  }
}

/* Extra small mobile */
@media (max-width: 480px) {
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-slide {
    width: 260px !important;
    height: 420px !important;
  }
}

/* ===== RESPONSIVE DESKTOP ADJUSTMENTS ===== */
@media (min-width: 992px) and (max-width: 1199px) {
  .carousel-wrapper[data-carousel-type="stacked"] {
    max-width: 75vw;
  }
}

@media (min-width: 1200px) {
  .carousel-wrapper[data-carousel-type="stacked"] {
    max-width: 65vw;
  }
}

/* Very large screens */
@media (min-width: 1440px) {
  .carousel-wrapper[data-carousel-type="stacked"] {
    max-width: 60vw;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-prev,
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-next,
  .carousel-wrapper[data-carousel-type="stacked"] .add-to-cart-btn,
  .carousel-wrapper[data-carousel-type="stacked"] .manual-play-btn,
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-slide {
    transition: none !important;
  }
}

/* High contrast mode */
@media (forced-colors: active) {
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-prev,
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-next,
  .carousel-wrapper[data-carousel-type="stacked"] .add-to-cart-btn,
  .carousel-wrapper[data-carousel-type="stacked"] .manual-play-btn {
    border: 2px solid currentColor !important;
  }
}

/* ===== SPIN ANIMATION FOR LOADING ===== */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== HIDE MOBILE ELEMENTS ON DESKTOP ===== */
@media (min-width: 992px) {
  .carousel-wrapper[data-carousel-type="stacked"] .swiper-pagination,
  .carousel-wrapper[data-carousel-type="stacked"] .mobile-pagination {
    display: none !important;
  }
}

/* ===== HIDE DESKTOP ELEMENTS ON MOBILE ===== */
@media (max-width: 991px) {
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-prev,
  .carousel-wrapper[data-carousel-type="stacked"] .stacked-nav-next {
    display: none !important;
  }
}
/* Hide ALL product info in stacked carousel by default */
.carousel-wrapper[data-carousel-type="stacked"] .product-info-section {
  display: none !important;
}

/* Only show on center slide (2nd slide = index 1) when it has product data */
.carousel-wrapper[data-carousel-type="stacked"]
  .swiper-slide:nth-child(2)
  .product-info-section[data-product-id] {
  display: block !important;
}
/* ADD ONLY THESE TARGETED CSS RULES - NO REEL CHANGES */

/* Increase z-index ONLY for product images - no position/transform changes */
.carousel-wrapper[data-carousel-type="stacked"] .product-image-container {
  z-index: 1000 !important;
}

.carousel-wrapper[data-carousel-type="stacked"] .product-thumbnail,
.carousel-wrapper[data-carousel-type="stacked"] .product-image {
  z-index: 1001 !important;
}

.carousel-wrapper[data-carousel-type="stacked"] .product-info-section img,
.carousel-wrapper[data-carousel-type="stacked"] .product-image-container img {
  z-index: 1002 !important;
}

/* REMOVE THESE LINES FROM THE PREVIOUS CSS - THEY AFFECT REEL POSITION:
   - NO perspective rules
   - NO transform-style rules  
   - NO translateZ transforms
   - NO position: relative changes
   - NO transform rules
*/
