/* SCOPED STYLING: Only affects elements inside .related-scope */

/* Module Heading */
.related-scope .fancy-heading {
  font-size: 24px;
  font-weight: 800;
  color: #2196F3; /* Related Blue */
  letter-spacing: 0.02em;
  margin-top: 30px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.related-scope .fancy-heading i {
  color: #64B5F6;
  font-size: 1.1em;
  margin-right: 4px;
  vertical-align: middle;
}
.related-scope .fancy-heading::after {
  content: "";
  display: block;
  height: 4px;
  width: 48px;
  border-radius: 3px;
  background: linear-gradient(90deg, #2196F3 0%, #64B5F6 100%);
  position: absolute;
  left: 0;
  bottom: -10px;
}

/* CAROUSEL CONTAINER STYLING */
.related-scope .swiper-viewport {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin-bottom: 30px;
  background: transparent !important;
  padding: 10px 5px; 
  position: relative; 
}

/* Equal Height Logic for Slider - CRITICAL FIX */
.related-scope .swiper-wrapper {
    display: flex;
    height: auto !important;
    align-items: stretch; /* This forces all slides to match the tallest slide's height */
}
.related-scope .swiper-slide {
    height: auto !important;
    display: flex; 
    justify-content: center;
    box-sizing: border-box; /* Ensure padding doesn't break layout */
}

/* Product Card Improvements */
.related-scope .product-thumb {
  margin-bottom: 20px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #fff;
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%; /* Forces the card to fill the stretched slide */
  position: relative;
  min-height: 100%;
}

/* Remove bottom margin inside slider */
.related-scope .swiper-slide .product-thumb {
    margin-bottom: 0;
}

.related-scope .product-thumb:hover {
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  border-color: #2196F3;
  transform: translateY(-3px);
}

.related-scope .product-thumb .image {
  padding: 10px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 200px; /* Match Latest Module Height */
  display: flex;
  align-items: center;
  justify-content: center;
}
.related-scope .product-thumb .image img {
  border-radius: 4px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* Caption & Content */
.related-scope .product-thumb .caption {
  padding: 0 15px 15px;
  min-height: 120px;
  flex-grow: 1; /* Pushes the button group to the bottom */
  display: flex;
  flex-direction: column;
}

.related-scope .product-thumb .caption h4 {
    margin-top: 10px; 
    min-height: 20px; 
    margin-bottom: 5px; 
    overflow: hidden;
}
.related-scope .product-thumb .caption h4 a {
  color: #333;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  line-height: 1.4;
}
.related-scope .product-thumb .caption h4 a:hover {
  color: #2196F3;
}

.related-scope .product-thumb .price {
  color: #333;
  font-weight: 700;
  font-size: 16px;
  margin-top: auto;
  padding-top: 10px;
  margin-bottom: 5px;
}
.related-scope .product-thumb .price-new { color: #e53935; }
.related-scope .product-thumb .price-old { color: #999; font-weight: 400; text-decoration: line-through; }

/* Carousel Navigation Buttons */
.related-scope .swiper-pager .swiper-button-next,
.related-scope .swiper-pager .swiper-button-prev {
  background-size: 20px 20px;
  width: 40px !important;
  height: 40px !important;
  background-color: #fff !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  opacity: 0; 
  transition: all 0.3s ease;
  background-image: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  position: absolute;
}
.related-scope .swiper-pager .swiper-button-next::after {
  content: "\f105"; 
  font-family: FontAwesome;
  color: #555;
  font-size: 20px;
}
.related-scope .swiper-pager .swiper-button-prev::after {
  content: "\f104"; 
  font-family: FontAwesome;
  color: #555;
  font-size: 20px;
}

.related-scope .swiper-viewport:hover .swiper-button-next,
.related-scope .swiper-viewport:hover .swiper-button-prev {
  opacity: 1;
}

.related-scope .swiper-pager .swiper-button-next:hover,
.related-scope .swiper-pager .swiper-button-prev:hover {
  background-color: #2196F3 !important;
}
.related-scope .swiper-pager .swiper-button-next:hover::after,
.related-scope .swiper-pager .swiper-button-prev:hover::after {
  color: #fff;
}

.related-scope .swiper-pager .swiper-button-next { right: -10px; }
.related-scope .swiper-pager .swiper-button-prev { left: -10px; }

/* BUTTON GROUP STYLING */
.related-scope .product-thumb .button-group {
  background-color: #f8f9fa;
  border-top: 1px solid #eee;
  display: flex;
  width: 100%;
  padding: 0;
  margin: 0;
  margin-top: auto;
}
.related-scope .product-thumb .button-group button {
  border: none;
  background: transparent;
  color: #666;
  padding: 12px 5px;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  border-right: 1px solid #e5e5e5;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 45px;
  line-height: 1;
  width: 100%;
}
.related-scope .product-thumb .button-group button:last-child {
  border-right: none;
}
.related-scope .product-thumb .button-group button:hover {
  background: #2196F3;
  color: #fff;
}

/* Specific Widths for Buttons */
.related-scope .product-thumb .button-group button:nth-of-type(1) {
  flex: 0 0 60%;
  width: 60%;
}
.related-scope .product-thumb .button-group button:nth-of-type(1) i {
  margin-right: 5px;
}
.related-scope .product-thumb .button-group button:nth-of-type(2),
.related-scope .product-thumb .button-group button:nth-of-type(3) {
  flex: 0 0 20%;
  width: 20%;
  font-size: 14px;
}

/* MOBILE FIXES */
@media (max-width: 767px) {
  .related-scope .fancy-heading { font-size: 19px; }
  .related-scope .fancy-heading::after { width: 32px; }
  
  .related-scope .product-thumb .caption {
     padding: 0 10px 10px;
  }
  .related-scope .product-thumb .button-group button {
     padding: 8px 2px;
     font-size: 10px;
  }
  
  /* Swiper Arrows Mobile Override */
  .related-scope .swiper-pager .swiper-button-next, 
  .related-scope .swiper-pager .swiper-button-prev { 
      opacity: 1 !important;
      width: 32px !important; 
      height: 32px !important; 
      background-color: rgba(255, 255, 255, 0.9) !important;
      border: 1px solid #eee !important;
  }
  
  .related-scope .swiper-pager .swiper-button-next::after,
  .related-scope .swiper-pager .swiper-button-prev::after {
      font-size: 16px;
      color: #333;
  }

  .related-scope .swiper-pager .swiper-button-next { right: 0px; }
  .related-scope .swiper-pager .swiper-button-prev { left: 0px; }
}