/* ========================================
   SIMILAR PROPERTIES CAROUSEL
   ======================================== */

.similar-properties-wrapper {
  max-width: var(--container-max, 1280px);
  margin: 4rem auto 2rem;
  padding: 0 var(--container-padding, 2rem);
}

.similar-properties-wrapper.hidden {
  display: none;
}

.similar-properties-header {
  text-align: center;
  margin-bottom: 2rem;
}

.similar-properties-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--tn-slate-900, #0f172a);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.similar-properties-header p {
  font-size: 1rem;
  color: var(--tn-slate-500, #64748b);
}

.similar-carousel-container {
  position: relative;
  margin-bottom: 2rem;
  overflow: visible;
}

.similar-carousel {
  display: flex;
  gap: 1.5rem;
  overflow-x: scroll;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding: 1rem 0;
  min-height: 1px;
}

.similar-carousel::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Card styling */
.similar-card {
  min-width: 300px;
  max-width: 300px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.similar-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border-color: #16a34a;
}

.similar-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.similar-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.similar-card-body {
  padding: 1.25rem;
}

.similar-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tn-slate-800, #1e293b);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.similar-card-location {
  font-size: 0.85rem;
  color: var(--tn-slate-500, #64748b);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.similar-card-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #16a34a;
  margin-bottom: 0.75rem;
}

.similar-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--tn-slate-600, #475569);
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.similar-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Navigation buttons */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: var(--tn-slate-700, #334155);
}

.carousel-nav:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.3);
}

.carousel-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
  left: -24px;
}

.carousel-next {
  right: -24px;
}

/* Dots navigation */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}

.carousel-dot.active {
  background: #16a34a;
  width: 24px;
  border-radius: 4px;
}

.carousel-dot:hover:not(.active) {
  background: #94a3b8;
}

/* Responsive */
@media (max-width: 1024px) {
  .carousel-nav {
    display: none;
  }
  
  .similar-carousel {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }
  
  .similar-card {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }
}

@media (max-width: 768px) {
  .similar-properties-wrapper {
    margin: 2rem auto 1rem;
    padding: 0 1rem;
  }
  
  .similar-properties-header h2 {
    font-size: 1.5rem;
  }
  
  .similar-card {
    min-width: 280px;
    max-width: 280px;
  }
  
  .similar-card-image {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .similar-card {
    min-width: 90vw;
    max-width: 90vw;
  }
}

/* Auto-scroll animation pause on hover */
.similar-carousel:hover {
  scroll-behavior: auto;
}
