/* ------------------------------------------------------------------
   Flexxistay "near you" UI
   Shared by the landing page strip (index.php) and the listing page
   distance badges / sort control (hotel-main-page.php).
   ------------------------------------------------------------------ */

/* ---------- Landing page: nearby hotels strip ---------- */

.nearby-hotels {
  --nearby-ink: #0f172a;
  --nearby-muted: #64748b;
  --nearby-line: rgba(99, 102, 241, 0.14);
  position: relative;
  padding: 34px 20px 10px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.nearby-hotels[hidden] {
  display: none !important;
}

.nearby-hotels__inner {
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8ff 100%);
  border: 1px solid var(--nearby-line);
  border-radius: 28px;
  padding: 28px 26px 26px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.06);
}

.nearby-hotels__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 6px;
}

.nearby-hotels__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1 0%, #f59e0b 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nearby-hotels__title {
  margin: 0;
  font-size: clamp(1.35rem, 3.4vw, 1.9rem);
  line-height: 1.2;
  color: var(--nearby-ink);
  font-weight: 800;
}

.nearby-hotels__sub {
  margin: 8px 0 0;
  color: var(--nearby-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.nearby-hotels__status {
  display: block;
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--nearby-muted);
  min-height: 1.2em;
}

.nearby-hotels__status[data-tone='ready'],
.nearby-hotels__status:empty {
  display: none;
}

.nearby-hotels__status[data-tone='loading']::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid rgba(99, 102, 241, 0.28);
  border-top-color: #6366f1;
  border-radius: 50%;
  vertical-align: -2px;
  animation: nearby-spin 0.8s linear infinite;
}

@keyframes nearby-spin {
  to { transform: rotate(360deg); }
}

.nearby-hotels__enable {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1 0%, #f59e0b 100%);
  color: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nearby-hotels__enable:hover,
.nearby-hotels__enable:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.32);
}

.nearby-hotels__enable[hidden] {
  display: none;
}

.nearby-hotels__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.nearby-hotels__foot {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nearby-hotels__note {
  color: var(--nearby-muted);
  font-size: 0.92rem;
}

.nearby-hotels__cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nearby-hotels__cta:hover,
.nearby-hotels__cta:focus-visible {
  transform: translateY(-2px);
  background: #1e293b;
}

.nearby-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.nearby-card:hover,
.nearby-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(76, 29, 149, 0.12);
  border-color: rgba(99, 102, 241, 0.24);
}

.nearby-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #eef2ff 0%, #fef3c7 100%);
  overflow: hidden;
}

.nearby-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nearby-card__distance {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  backdrop-filter: blur(4px);
}

.nearby-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nearby-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--nearby-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.nearby-card__area {
  margin: 0;
  font-size: 0.85rem;
  color: var(--nearby-muted);
}

.nearby-card__price {
  margin: 6px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #b45309;
}

.nearby-card__price span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--nearby-muted);
}

@media (max-width: 640px) {
  .nearby-hotels {
    padding: 26px 14px 6px;
  }

  .nearby-hotels__inner {
    padding: 22px 18px 20px;
    border-radius: 24px;
  }

  .nearby-hotels__grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }

  .nearby-card__body {
    padding: 12px 13px 14px;
  }

  .nearby-hotels__foot {
    flex-direction: column;
    align-items: stretch;
  }

  .nearby-hotels__cta {
    justify-content: center;
  }
}

/* ---------- Listing page: distance badges + sort control ---------- */

.hotel-distance-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: #4338ca;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.hotel-distance-badge i {
  font-size: 0.72rem;
}

.hotel-header-row .hotel-distance-badge,
.hotel-title-wrap .hotel-distance-badge {
  margin-left: 8px;
  vertical-align: middle;
}

.nearby-optin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: #fff;
  color: #4338ca;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nearby-optin:hover,
.nearby-optin:focus-visible {
  background: #eef2ff;
  transform: translateY(-1px);
}

.nearby-optin[hidden] {
  display: none;
}

.nearby-optin.is-active {
  background: linear-gradient(135deg, #6366f1 0%, #f59e0b 100%);
  border-color: transparent;
  color: #fff;
}

.nearby-optin.is-filtering {
  background: #0f172a;
  border-color: transparent;
  color: #fff;
}

.nearby-optin:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.results-nearby-row[hidden] {
  display: none !important;
}

.results-nearby-row .hotel-distance-badge {
  background: transparent;
  border: none;
  color: #64748b;
  font-weight: 600;
  padding-left: 0;
}

.results-nearby-row .nearby-optin {
  padding: 6px 12px;
  font-size: 0.78rem;
}

/*
 * The nearby control shares the sort row with the label and the sort select.
 * Allowing that row to wrap means the extra control can never push the row
 * wider than a narrow phone viewport - it simply moves onto its own line.
 */
.sort-by-section {
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .sort-by-section {
    row-gap: 8px;
  }

  .sort-by-section .nearby-optin {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
}

.sort-by-section .nearby-sort-note {
  color: #64748b;
  font-size: 0.78rem;
  margin-left: 6px;
}

@media (max-width: 640px) {
  .hotel-distance-badge {
    font-size: 0.72rem;
    padding: 3px 9px;
  }
}
