/* SCOPED STYLING: Only affects elements inside .special-scope */

/* Module Heading */
.special-scope .fancy-heading {
  font-size: 24px; 
  font-weight: 800;
  color: #e53935; /* Special Red */
  letter-spacing: 0.02em;
  margin-top: 30px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.special-scope .fancy-heading .fa-bolt {
  color: #ff9800; 
  font-size: 1.1em; 
  margin-right: 4px;
  vertical-align: middle;
}
.special-scope .fancy-heading::after {
  content: "";
  display: block;
  height: 4px;
  width: 48px;
  border-radius: 3px;
  background: linear-gradient(90deg, #e53935 0%, #ff9800 100%);
  position: absolute;
  left: 0;
  bottom: -10px;
}

/* Carousel Container Styling */
.special-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 */
.special-scope .swiper-wrapper {
    display: flex;
    height: auto !important; 
}
.special-scope .swiper-slide {
    height: auto !important;
    display: flex; 
    justify-content: center;
}

/* Product Card Improvements - SCOPED */
.special-scope .product-thumb {
  margin-bottom: 20px;
  border: 1px solid #e5e5e5;
  border-radius: 6px; 
  background: #fff;
  transition: all 0.3s ease;
  overflow: hidden;
  
  /* CRITICAL FIXES FOR EQUAL HEIGHT */
  display: flex;
  flex-direction: column;
  width: 100%; 
  height: 100%; /* Stretches to fill the flex column */
  min-height: 100%;
  position: relative;
}

/* 
   FIX: Grid Layout Stability 
   Corrected Selector: .special-scope.row-flex (No space)
*/
.special-scope.row-flex > div {
    display: flex;
    flex-direction: column;
}

.special-scope .swiper-slide .product-thumb {
    margin-bottom: 0;
}
.special-scope .product-thumb:hover {
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  border-color: #e53935;
  transform: translateY(-3px);
}
.special-scope .product-thumb .image {
  padding: 10px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 200px; 
  display: flex;
  align-items: center;
  justify-content: center;
}
.special-scope .product-thumb .image img {
  border-radius: 4px; 
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- COUNTDOWN TIMER --- */
.special-scope .countdown-timer {
  position: absolute;
  bottom: 12px; 
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px; 
}
.special-scope .countdown-timer .timer-box {
  background: #ffffff;
  color: #333;
  border-radius: 4px;
  padding: 4px 2px;
  min-width: 40px; 
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15); 
  border-bottom: 2px solid #e53935; 
}
.special-scope .countdown-timer .timer-num {
  font-weight: 800; 
  font-size: 14px;
  line-height: 1.1;
  color: #e53935; 
  display: block;
  margin-bottom: 1px;
}
.special-scope .countdown-timer .timer-label {
  font-size: 8px;
  text-transform: uppercase;
  color: #777;
  font-weight: 600;
  display: block;
  letter-spacing: 0.5px;
}
.special-scope .countdown-timer.expired {
   background: #f8f9fa; 
   border: 1px solid #ddd;
   border-radius: 4px;
   padding: 5px 12px;
   font-size: 11px;
   font-weight: bold;
   color: #999;
   width: auto;
   box-shadow: none;
   display: block; 
   text-align: center;
}

/* Caption & Content */
.special-scope .product-thumb .caption {
  padding: 0 15px 15px;
  min-height: 120px; 
  flex-grow: 1; 
  display: flex;
  flex-direction: column;
}

.special-scope .product-thumb .caption h4 { 
    margin-top: 10px; 
    min-height: 20px; 
    margin-bottom: 5px; 
    overflow: hidden;
}
.special-scope .product-thumb .caption h4 a {
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  line-height: 1.4;
}
.special-scope .product-thumb .caption h4 a:hover {
  color: #e53935;
}
.special-scope .product-thumb .price {
  font-weight: 700;
  font-size: 16px;
  margin-top: auto; 
  padding-top: 10px;
  margin-bottom: 5px;
}
.special-scope .product-thumb .price-new { color: #e53935; }
.special-scope .product-thumb .price-old { color: #999; font-weight: 400; text-decoration: line-through; }

/* Carousel Navigation Buttons */
.special-scope .swiper-pager .swiper-button-next,
.special-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;
}
.special-scope .swiper-pager .swiper-button-next::after {
  content: "\f105"; font-family: FontAwesome; color: #555; font-size: 20px;
}
.special-scope .swiper-pager .swiper-button-prev::after {
  content: "\f104"; font-family: FontAwesome; color: #555; font-size: 20px;
}
.special-scope .swiper-viewport:hover .swiper-button-next,
.special-scope .swiper-viewport:hover .swiper-button-prev {
  opacity: 1;
}
.special-scope .swiper-pager .swiper-button-next:hover,
.special-scope .swiper-pager .swiper-button-prev:hover {
  background-color: #e53935 !important;
}
.special-scope .swiper-pager .swiper-button-next:hover::after,
.special-scope .swiper-pager .swiper-button-prev:hover::after {
  color: #fff;
}
.special-scope .swiper-pager .swiper-button-next { right: -10px; }
.special-scope .swiper-pager .swiper-button-prev { left: -10px; }

/* BUTTON GROUP STYLING */
.special-scope .product-thumb .button-group {
  margin-top: auto; 
  background-color: #f8f9fa;
  border-top: 1px solid #eee;
  display: flex; 
  width: 100%;
  padding: 0;
  margin: 0;
}
.special-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;
}
.special-scope .product-thumb .button-group button:last-child {
  border-right: none;
}
.special-scope .product-thumb .button-group button:hover {
  background: #e53935;
  color: #fff;
}
.special-scope .product-thumb .button-group button:nth-of-type(1) {
  flex: 0 0 60%; width: 60%;
}
.special-scope .product-thumb .button-group button:nth-of-type(1) i {
  margin-right: 5px; 
}
.special-scope .product-thumb .button-group button:nth-of-type(2),
.special-scope .product-thumb .button-group button:nth-of-type(3) {
  flex: 0 0 20%; width: 20%; font-size: 14px; 
}

/* 
   FLEXBOX ROW FIX 
   Corrected Selector: .special-scope.row-flex (No space)
   This enables the 2-column flex layout to work properly.
*/
.special-scope.row-flex {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}
.special-scope.row-flex > [class*='col-'] {
    display: flex;
    flex-direction: column;
}

/* TILE TRANSITION STYLES */
.tile-transition-item {
    transition: opacity 0.5s ease-in-out;
    height: 100%; 
    display: flex;
    flex-direction: column;
}
.tile-transition-item.fading-out { opacity: 0; }


/* =========================================
   RESPONSIVE & MOBILE FIXES (2 PER ROW)
   ========================================= */
@media (max-width: 767px) {
  /* 1. FORCE 2 COLUMNS: Override default theme 100% width */
  .special-scope .product-layout {
      width: 50% !important;
      float: none !important; /* Let Flexbox handle it */
      max-width: 50% !important;
      flex: 0 0 50%;
  }

  /* 2. Header Adjustments */
  .special-scope .fancy-heading { font-size: 18px; } 
  .special-scope .fancy-heading::after { width: 32px; }
  
  /* 3. Swiper Arrows */
  .special-scope .swiper-pager .swiper-button-next, 
  .special-scope .swiper-pager .swiper-button-prev { 
      opacity: 1 !important;
      width: 30px !important; 
      height: 30px !important; 
      background-color: rgba(255, 255, 255, 0.9) !important;
      border: 1px solid #eee !important;
  }
  .special-scope .swiper-pager .swiper-button-next::after,
  .special-scope .swiper-pager .swiper-button-prev::after {
      font-size: 14px; color: #333;
  }
  .special-scope .swiper-pager .swiper-button-next { right: 0px; }
  .special-scope .swiper-pager .swiper-button-prev { left: 0px; }
  
  /* 4. Product Card Spacing - Compact for 2 Columns */
  .special-scope .product-thumb {
     margin-bottom: 10px; 
  }
  .special-scope .product-thumb .caption {
     padding: 0 5px 8px; /* Very tight padding */
     min-height: 80px;   
  }
  .special-scope .product-thumb .caption h4 {
      font-size: 12px; /* Smaller font */
      margin-top: 5px;
      min-height: 32px;
  }
  
  /* 5. Button Group - Hide Text */
  .special-scope .product-thumb .button-group button {
     padding: 6px 0;
     font-size: 10px; 
  }
  .special-scope .product-thumb .button-group button span {
      display: none; /* Hide "Add to Cart" text */
  }
  .special-scope .product-thumb .button-group button i {
      margin-right: 0;
      font-size: 12px;
  }
  
  /* 6. Countdown Timer - Compact */
  .special-scope .countdown-timer {
     bottom: 48px; 
     gap: 1px;
     width: 90%;
  }
  .special-scope .countdown-timer .timer-box {
     min-width: 20px;
     padding: 2px 0;
     flex: 1;
  }
  .special-scope .countdown-timer .timer-num {
     font-size: 10px;
  }
  .special-scope .countdown-timer .timer-label {
      font-size: 6px;
  }
  
  /* 7. Image Container */
  .special-scope .product-thumb .image {
      min-height: 120px; 
      padding: 5px;
  }
}