/**
 * Native carousel styles
 */

/* Center main site logo on mobile */
@media (max-width: 767px) {
  a[rel="home"] {
    display: block !important;
    text-align: center !important;
    margin: 0 auto !important;
    width: 100% !important;
  }
  
  a[rel="home"] img,
  img[src*="instalogomainhead"] {
    display: inline-block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    height: auto !important;
  }
}

.appraisal-carousel-wrapper {
  width: 100%;
  margin: 0 auto 20px;
  position: relative;
  overflow: hidden;
}

.appraisal-carousel-slider {
  display: block;
  width: 100%;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  min-height: 120px;
}

.carousel-track {
  display: flex;
  transition: transform 0.3s ease;
  width: 100%;
  align-items: flex-start;
  height: auto;
}

.carousel-slide {
  flex: 0 0 auto;
  padding: 0 5px;
  outline: none;
  vertical-align: top;
  box-sizing: border-box;
}

/* Carousel slide container with aspect ratio */
.carousel-slide {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #f9fafb;
}

/* Fixed height container for consistent display */
.carousel-slide .field-content,
.carousel-slide a {
  display: block;
  position: relative;
  width: 100%;
  height: 180px; /* Fixed height instead of padding-bottom */
  overflow: hidden;
}

/* Ensure images are properly sized and consistent */
.carousel-slide img,
.carousel-slide .field-content img,
.carousel-slide .field-content ul li img {
  position: relative !important; /* Changed from absolute */
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: 8px;
  transition: transform 0.3s ease;
  transform: none !important; /* Ensure no transforms cutting off images */
}

.carousel-slide:hover img {
  transform: scale(1.05);
}

/* Semi-transparent overlay for title/category */
.carousel-slide::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 1;
  border-radius: 0 0 8px 8px;
}

/* Title styling on overlay */
.carousel-slide .slide-title {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  z-index: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Remove list styles */
.carousel-slide ul,
.carousel-slide li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Navigation */
.carousel-nav {
  margin-top: 10px;
  position: relative;
  clear: both;
  height: auto;
}

.carousel-prev,
.carousel-next {
  display: none !important; /* Hide arrows since dots are sufficient */
}

/* Arrow styles removed - using dots only */

/* Simple dots like standard pagination */
.carousel-dots {
  text-align: center;
  margin: 10px 0 5px;
  padding: 0;
}

.carousel-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 6px;
  padding: 0;
  background-color: #ddd;
  border: 1px solid #bbb;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.carousel-dot:hover {
  background-color: #999;
}

.carousel-dot.active {
  background-color: #666;
  width: 12px;
  height: 12px;
}

/* Desktop styles (≥1200px) - 4 items */
@media (min-width: 1200px) {
  .appraisal-carousel-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
  }
  
  .carousel-wrapper {
    min-height: 250px;
  }
  
  .carousel-slide {
    width: calc(25% - 15px) !important; /* 4 items with spacing */
    margin: 0 7.5px;
  }
  
  .carousel-track {
    margin: 0 -7.5px;
  }
}

/* Large Tablet (992-1199px) - 3 items */
@media (min-width: 992px) and (max-width: 1199px) {
  .carousel-wrapper {
    min-height: 225px;
  }
  
  .carousel-slide {
    width: calc(33.333% - 15px) !important; /* 3 items with spacing */
    margin: 0 7.5px;
  }
}

/* Small Tablet (768-991px) - 2 items */
@media (min-width: 768px) and (max-width: 991px) {
  .carousel-wrapper {
    min-height: 240px;
  }
  
  .carousel-slide {
    width: calc(50% - 15px) !important; /* 2 items with spacing */
    margin: 0 7.5px;
  }
}

/* Mobile (≤767px) - 1 item with peek */
@media (max-width: 767px) {
  .appraisal-carousel-wrapper {
    padding: 0 15px;
    overflow: visible;
  }
  
  .carousel-wrapper {
    min-height: 280px;
    padding-bottom: 40px;
  }
  
  .carousel-slide {
    width: calc(100% - 30px) !important; /* 1 item with side padding for peek */
    margin: 0 15px;
  }
  
  /* Larger text on mobile */
  .carousel-slide .slide-title {
    font-size: 15px;
    bottom: 12px;
  }
  
  .carousel-nav {
    position: relative;
    z-index: 10;
  }
  
  .carousel-dots {
    padding: 10px 0;
    display: block !important;
    visibility: visible !important;
    position: relative;
    margin: 10px 0 0;
  }
  
  .carousel-dot {
    display: inline-block !important;
    visibility: visible !important;
    width: 8px;
    height: 8px;
    margin: 0 4px;
  }
  
  .carousel-dot.active {
    width: 10px;
    height: 10px;
  }
}