@media (min-width: 781px) {
.ad-carousel-section {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 35px auto;
}

.carousel-main {
  position: relative;
  width: 100%;
  height: 480px;
  background: #f4f4f4;
  border-radius: 10px;
  overflow: hidden;
}

.carousel-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 22px;
  border-radius: 6px;
}

.carousel-btn:hover {
  background: rgba(0,0,0,0.65);
}

.carousel-btn.prev {
  left: 12px;
}

.carousel-btn.next {
  right: 12px;
}

.carousel-thumbs {
  display: flex;
  justify-content: center; 
  gap: 9px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.carousel-thumbs img {
  width: 110px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.carousel-main img {
  cursor: pointer;
}

.carousel-thumbs img.active-thumb {
  border-color: #0b4e0b;
}
}


@media (max-width: 780px) {
  /* Mobile Version (Max 780px) */
.ad-carousel-section {
  width: 100%;
  max-width: 100%; /* Occupy full width on mobile */
  margin: 0 auto 20px auto;
}

.carousel-main {
  position: relative;
  width: 100%;
  height: 320px; /* Reduced height to keep content "above the fold" */
  background: #f4f4f4;
  border-radius: 0; /* Full-bleed look often looks better on mobile */
  overflow: hidden;
  /* Optimization for touch transitions */
  touch-action: pan-y; 
}

.carousel-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3); /* Lighter background for mobile */
  color: #fff;
  border: none;
  padding: 8px 12px; /* Smaller footprint */
  cursor: pointer;
  font-size: 18px;
  border-radius: 4px;
  /* Ensure buttons don't block the start of a swipe gesture */
  z-index: 2; 
}

.carousel-btn.prev {
  left: 5px;
}

.carousel-btn.next {
  right: 5px;
}

.carousel-thumbs {
  display: flex;
  justify-content: flex-start; /* Start from left so user knows to scroll right */
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto; /* Enables horizontal swiping for thumbnails */
  padding: 0 10px 10px 10px;
  
  /* Modern scroll snapping for a premium feel */
  scroll-snap-type: x mandatory;
  
  /* Hide scrollbar for a cleaner look */
  scrollbar-width: none; 
  -ms-overflow-style: none;
}

.carousel-thumbs::-webkit-scrollbar {
  display: none;
}

.carousel-thumbs img {
  width: 90px; /* Smaller thumbnails to show more of the sequence */
  height: 65px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid transparent;
  flex-shrink: 0;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}

.carousel-thumbs img.active-thumb {
  border-color: #0b4e0b;
}
}