/* ===== Nearby Carousel ===== */
.nearby-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nearby-section h2 {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 2rem;
  font-weight: 700;
}

.nearby-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-inline: clamp(12px, 6vw, 56px);
  scroll-padding-inline: clamp(12px, 6vw, 56px);
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.nearby-rail::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.place-card {
  flex: 0 0 min(85%, 520px);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.place-card:hover {
  box-shadow: var(--shadow-elegant);
  transform: translateY(-4px);
}

.place-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.place-card:hover .place-img {
  transform: scale(1.05);
}

.place-info {
  padding: 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.place-info h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.place-info p {
  color: var(--muted-foreground);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1;
}

.place-distance {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  background: var(--primary-soft);
  color: var(--foreground);
  text-decoration: none;
  transition: all 0.2s ease;
  width: fit-content;
}

.place-distance:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== Floating Navigation Arrows ===== */
.nearby-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  user-select: none;
}

.nearby-btn:hover {
  background: var(--primary-soft);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.nearby-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.nearby-btn.prev {
  left: 0.75rem;
}

.nearby-btn.next {
  right: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .place-card {
    flex: 0 0 min(90%, 420px);
  }
  
  .place-img {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .nearby-btn {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }
  
  .nearby-btn.prev {
    left: 0.5rem;
  }
  
  .nearby-btn.next {
    right: 0.5rem;
  }
  
  .place-card {
    flex: 0 0 min(92%, 360px);
  }
  
  .place-img {
    height: 180px;
  }
  
  .place-info {
    padding: 1rem 1.25rem;
  }
}

/* Edge gradients for visual depth */
.nearby-wrapper::before,
.nearby-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.8;
}

.nearby-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--background) 0%, transparent 100%);
}

.nearby-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--background) 0%, transparent 100%);
}

@media (max-width: 768px) {
  .nearby-wrapper::before,
  .nearby-wrapper::after {
    width: 40px;
  }
}