/* ========================================
   NEARBY VENUES SECTION
   ======================================== */

/* Global overflow prevention */
html,
body {
  overflow-x: hidden;
}

.nearby-venues {
  background-color: var(--main-color);
  margin-top: -10.5rem;
  margin-bottom: -1rem;
}

.nearby-venues .venue-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nearby-venues h2 {
  font-family: var(--primary-font);
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-color);
  margin: 0 0 1.5rem 0;
  position: relative;
}

.nearby-venues h2::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 2rem;
  height: 2px;
  background-color: var(--primary-color);
}

.separator-line {
  display: none;
}

.new-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: #e63946;
  color: #fff;
  padding: 0.35em 0.6em;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  line-height: 1;
  margin-left: 0.2rem;
}

.nearby-venues .venue-card,
.nearby-venues .venue-card * {
  text-decoration: none;
}

.nearby-venues .venue-list {
  margin-bottom: -0.8rem;
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* Default: Hide swiper on desktop, show grid */
.nearby-venues .swiper-container,
.nearby-venues .swiper {
  display: none;
  margin-bottom: -1rem;
}

.nearby-venues .venue-card {
  flex: 1 1 280px;
  border-radius: 4px;
  max-width: 490px;
  min-width: 280px;
  height: 410px;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 10px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  background: #fff;
  transition: transform 0.3s ease;
}

@media (max-width: 1040px) {
  .nearby-venues .venue-card {
    flex: 0 1 280px;
  }
}

.nearby-venues .venue-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  background-color: #ddd;
  opacity: 0;
  /* Keep image hidden initially */
  visibility: hidden;
  /* Ensure image doesn't take up space initially */
  transition: opacity 0.5s ease-in-out;
  flex-shrink: 0;
}

.nearby-venues .venue-image.loaded {
  opacity: 1;
  visibility: visible;
  /* Make image visible */
}

/* Skeleton Loader Styles for Nearby Venues */
.nearby-venues .venue-card.is-loading .venue-name,
.nearby-venues .venue-card.is-loading .venue-location,
.nearby-venues .venue-card.is-loading .venue-details,
.nearby-venues .venue-card.is-loading .venue-image,
.nearby-venues .venue-card.is-loading .distance-badge {
  display: none;
}

.nearby-venues .skeleton {
  background-color: #bcbcbc;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.nearby-venues .skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  height: 100%;
  width: 150%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  animation: nearbyShimmer 2s infinite;
}

@keyframes nearbyShimmer {
  0% {
    left: -150%;
  }

  100% {
    left: 150%;
  }
}

.nearby-venues .skeleton-image {
  height: 280px;
  width: 100%;
  border-radius: 4px 4px 0 0;
}

.nearby-venues .skeleton-text {
  height: 14px;
  margin-left: 1rem;
  margin-right: 1rem;
  margin-bottom: 15px;
}

.nearby-venues .skeleton-text.short {
  width: 40%;
  height: 20px;
  margin-top: 0.8rem;
}

.nearby-venues .skeleton-text.medium {
  width: 50%;
  height: 13px;
}

.nearby-venues .skeleton-text.long {
  width: 70%;
  height: 15px;
}

/* Venue Content Area */
.nearby-venues .venue-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1rem 0.3rem 1rem !important;
  min-height: 0;
  gap: 0 !important;
}

.nearby-venues .venue-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Venue Name - Most Prominent */
.nearby-venues .venue-card .venue-info .venue-name,
.nearby-venues .venue-name {
  font-family: var(--secondary-font) !important;
  font-size: 1.35rem !important;
  font-weight: 600 !important;
  color: #1a1a1a !important;
  text-decoration: none !important;
  margin: 0 0 0.4rem 0 !important;
  line-height: 1.3 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  padding: 0 !important;
}

/* Venue Location - Secondary */
.nearby-venues .venue-card .venue-info .venue-location,
.nearby-venues .venue-location {
  font-size: 0.9rem !important;
  color: #555 !important;
  font-weight: 400 !important;
  margin: 0 0 0.25rem 0 !important;
  text-transform: capitalize !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

/* Venue Details - Tertiary */
.nearby-venues .venue-card .venue-info .venue-details,
.nearby-venues .venue-details {
  font-size: 0.8rem !important;
  color: #777 !important;
  font-weight: 300 !important;
  margin: 0 !important;
  text-transform: capitalize !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 1.1 !important;
  padding: 0 !important;
}

.nearby-venues .distance-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: white;
  color: black;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Mobile Swiper Styles */
.nearby-venues .swiper-container,
.nearby-venues .swiper {
  width: 100%;
  padding: 0;
  overflow: visible;
  margin: 0;
}

/* Loading States for Nearby Venues */
.nearby-venues.loading .venue-card:not(.is-loading) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.nearby-venues.loading .venue-card.is-loading {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.nearby-venues.loaded .venue-card {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.nearby-venues.loaded .venue-card.is-loading {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.nearby-venues .swiper-slide {
  width: 280px;
  height: 335px;
  margin-right: 0;
  flex-shrink: 0;
}

.nearby-venues .swiper-slide:first-child {
  margin-left: 0;
}

.nearby-venues .swiper-slide.no-margin-right {
  margin-right: 0;
}

.nearby-venues .swiper-slide.margin-left {
  margin-left: 10px;
}

/* Tablet and smaller screens */
@media (max-width: 1024px) {
  .nearby-venues {
    margin-top: 1rem;
    margin-bottom: -0.8rem;
    padding-top: 0;
  }

  .nearby-venues .venue-container {
    padding: 0 1.5rem;
  }
}

/* Mobile and small tablets - Swiper activation */
@media (max-width: 1000px) {
  .nearby-venues {
    margin-top: 0.8rem;
    margin-bottom: -1rem;
    padding-top: 0;
  }

  .nearby-venues .venue-list {
    display: none !important;
    /* Hide grid layout */
  }

  .nearby-venues .swiper-container,
  .nearby-venues .swiper {
    display: block !important;
    /* Show swiper */
  }

  .nearby-venues .swiper-slide {
    width: 280px;
    flex-shrink: 0;
  }

  /* Very small screens (320px - 479px) */
  @media (max-width: 479px) {
    .nearby-venues .swiper-slide {
      width: 240px;
    }
  }

  /* Small screens (480px - 639px) */
  @media (min-width: 480px) and (max-width: 639px) {
    .nearby-venues .swiper-slide {
      width: 260px;
    }
  }

  /* Medium screens (640px - 767px) */
  @media (min-width: 640px) and (max-width: 767px) {
    .nearby-venues .swiper-slide {
      width: 280px;
    }
  }

  /* Large mobile/tablet (768px - 1000px) */
  @media (min-width: 768px) and (max-width: 1000px) {
    .nearby-venues .swiper-slide {
      width: 300px;
    }
  }

  .nearby-venues .venue-container {
    padding: 0 1.5rem;
  }

  .nearby-venues .venue-list {
    margin-bottom: -1rem;
  }

  .nearby-venues .swiper-container,
  .nearby-venues .swiper {
    padding-bottom: 0.1rem;
    margin-bottom: -1rem;
  }

  .nearby-venues .swiper-slide:first-child {
    margin-left: 0;
  }

  .nearby-venues {
    margin-bottom: 0;
  }
}

/* Mobile styles alignment with venue-listing.css */
@media (max-width: 768px) {
  .nearby-venues .venue-container {
    padding: 0 1.75rem;
  }
}

/* Small mobile styles alignment */
@media (max-width: 480px) {
  .nearby-venues .venue-container {
    padding: 0 1.5rem;
  }
}

.nearby-venues .venue-card {
  width: 450px;
  min-height: 410px;
  overflow: hidden;
}

.nearby-venues .venue-location {
  font-size: 0.8rem;
}

.nearby-venues .venue-details {
  font-size: 0.65rem;
}

.nearby-venues .distance-badge {
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  padding: 3px 6px;
}

.nearby-venues .venue-image {
  height: 280px;
}
