/* ─── v4.2 "Digital Curator" Color Overrides ───────────────────── */
:root {
  --owf-primary:        #005bc1;
  --owf-primary-hover:  #004faa;
  --owf-primary-light:  rgba(0, 91, 193, 0.08);
  --owf-primary-light-border: rgba(0, 91, 193, 0.22);
  --owf-primary-ghost:  rgba(0, 91, 193, 0.15);
  --owf-surface:        #ffffff;
  --owf-surface-muted:  #f9f9fb;
  --owf-text:           #2d3338;
  --owf-text-secondary: #6b7280;
}

:root {
  --page-bg: var(--site-color-bg); /* #f2f4f6 via token */
  --page-accent: var(--site-color-surface-muted);
  --panel-bg: rgba(249, 249, 251, 0.70); /* 70% opacity, spec */
  --panel-border: var(--site-outline-var);
  --surface: rgba(255, 255, 255, 0.98);
  --surface-soft: rgba(249, 249, 251, 0.96);
  --ink-950: var(--owf-text);
  --ink-800: var(--owf-text-secondary);
  --ink-600: var(--site-color-text-tertiary);
  --ink-400: var(--site-gray-300);
  --line: var(--site-outline-var); /* outline-var ghost */
  --accent: var(--owf-primary);
  --accent-soft: var(--owf-primary-light);
  --shadow-lg: 0 24px 48px rgba(45, 51, 56, 0.06); /* ambient shadow */
  --shadow-md: 0 18px 48px rgba(45, 51, 56, 0.04);
  --radius-panel: 32px; /* 2rem */
  --radius-lg: 32px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --map-height-mobile: 41vh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  overflow: hidden;
  background: var(--page-bg);
  color: var(--ink-950);
  font-family: var(--site-font-sans);
}

.site-where-stay-page__frame {
  height: 100svh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.8rem;
  padding: 12px 1.55rem 1.55rem;
  box-sizing: border-box;
  overflow: hidden;
}

.site-where-stay-page__topbar {
  display: flex;
  align-items: center;
  min-height: 58px;
  margin-bottom: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  padding: 0;
  gap: 1.55rem;
}

.panel {
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.panel-inner,
.map-wrapper {
  height: 100%;
  min-height: 0;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.panel-list .panel-inner {
  background: rgba(255, 255, 255, 0.98);
}

.panel-inner {
  display: flex;
  flex-direction: column;
  gap: 1.45rem;
  padding: 1.7rem;
  overflow: hidden;
}

.panel-inner::-webkit-scrollbar {
  width: 0.8rem;
}

.panel-inner::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(45, 51, 56, 0.14);
  background-clip: content-box;
}

.map-wrapper {
  overflow: hidden;
  position: relative;
}

.page-header {
  display: grid;
  gap: 0.8rem;
}

.eyebrow,
.filters-label,
.results-label,
.field-label,
.filter-group-label {
  margin: 0;
  color: var(--ink-600);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-header h1 {
  line-height: 1.05;
}

.filters-panel,
.results-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.filters-panel {
  background: var(--surface-soft);
}

.results-section {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.filters-panel {
  --filters-panel-padding: 0.78rem;
  display: grid;
  gap: 0.85rem;
  padding: var(--filters-panel-padding);
}

.filters-panel.is-collapsed .filters-content {
  display: none;
}

.filters-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.filters-actions {
  --filter-action-size: 44px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.ghost-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--filter-action-size);
  height: var(--filter-action-size);
  padding: 0 0.95rem;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-950);
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease;
}

.ghost-button.hidden {
  display: none !important;
}

.icon-button {
  width: var(--filter-action-size);
  height: var(--filter-action-size);
  min-height: var(--filter-action-size);
  padding: 0;
  flex: 0 0 var(--filter-action-size);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-950);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.ghost-button:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 51, 56, 0.16);
}

.filter-group {
  display: grid;
  gap: 0.8rem;
}

.filters-content {
  display: grid;
  gap: 0.85rem;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink-800);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.5rem 0.82rem;
  transition: all 160ms ease;
}

.filter-chip.is-active {
  background: var(--owf-primary);
  border-color: transparent;
  color: #fff;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: end;
}

.field {
  display: grid;
  gap: 0.42rem;
}

.field-control {
  appearance: none;
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink-950);
  padding: 0.58rem 0.82rem;
}

.field-slider {
  display: grid;
  grid-template-rows: auto minmax(2.5rem, 1fr);
  gap: 0.18rem;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.slider-head strong {
  color: var(--ink-600);
  font-size: 0.78rem;
  font-weight: 500;
}

.distance-slider {
  width: 100%;
  appearance: none;
  height: 0.45rem;
  align-self: center;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--owf-primary) 0%, rgba(45, 51, 56, 0.14) 0%);
  outline: none;
}

.distance-slider::-webkit-slider-thumb {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 0;
  border-radius: 50%;
  background: var(--owf-primary);
  box-shadow: 0 6px 16px rgba(0, 91, 193, 0.28);
  cursor: pointer;
}

.distance-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border: 0;
  border-radius: 50%;
  background: var(--owf-primary);
  box-shadow: 0 6px 16px rgba(0, 91, 193, 0.28);
  cursor: pointer;
}

.results-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0;
}

.results-head {
  display: flex;
  align-items: center;
  padding: 0;
}

.results-grid-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-lg);
  padding: 0;
}

.results-section.is-compact {
  flex: 0 0 auto;
  min-height: auto;
}

.results-section.is-compact .results-grid-wrapper {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

.results-section.is-compact .results-grid {
  height: auto;
  overflow: visible;
}

.results-grid {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.2rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  grid-auto-rows: max-content;
  align-content: start;
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-lg);
}

.results-grid::-webkit-scrollbar {
  width: 0.8rem;
}

.results-grid::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(45, 51, 56, 0.14);
  background-clip: content-box;
}

.property-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card-media {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 1 / 0.78;
  overflow: hidden;
  background: linear-gradient(135deg, #dbe4e8, #f6f8f8);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .property-card:hover .card-image {
    transform: scale(1.03);
  }
}

.property-card:focus-within .card-body,
.property-card.is-selected .card-body {
  background: var(--owf-primary-light);
}

.property-card.is-selected {
  border-color: var(--owf-primary-light-border);
  box-shadow: 0 22px 58px rgba(0, 91, 193, 0.12);
}

.badge-row {
  position: absolute;
  inset: 0.7rem 0.7rem auto 0.7rem;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  max-width: calc(100% - 3rem);
}

.number-badge,
.source-badge,
.distance-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.4rem 0.72rem;
  box-shadow: 0 12px 24px rgba(45, 51, 56, 0.06);
}

.number-badge {
  justify-content: center;
  min-width: 2rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink-950);
}

.property-card.is-selected .number-badge {
  background: var(--owf-primary);
  color: #fff;
}

.source-badge,
.distance-badge {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-950);
}

.gallery-controls {
  position: absolute;
  inset: auto 0.7rem 0.7rem auto;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.gallery-button,
.gallery-counter {
  min-width: 1.9rem;
  min-height: 1.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-950);
  box-shadow: 0 10px 24px rgba(45, 51, 56, 0.06);
}

.gallery-button {
  position: relative;
  z-index: 4;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
}

.gallery-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  font-size: 0.74rem;
  font-weight: 800;
}

.card-body {
  position: relative;
  display: grid;
  gap: 0.78rem;
  flex: 1 1 auto;
  padding: 1.08rem 1.08rem 0;
  background: rgba(255, 255, 255, 0.98);
}

.card-headline {
  display: grid;
  gap: 0.28rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.card-type,
.card-title,
.card-rating,
.card-subtitle,
.card-specs,
.card-price {
  margin: 0;
}

.card-type {
  color: var(--ink-600);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.card-title {
  font-family: var(--site-font-headline);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.22;
  min-height: calc(1 * 1.22em);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.card-rating {
  color: var(--ink-950);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.card-rating.is-missing {
  display: block;
}

.rating-balls {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.22rem;
}

.rating-ball {
  --fill: 0%;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  border: 1px solid rgba(45, 51, 56, 0.14);
  background: linear-gradient(
    90deg,
    var(--owf-primary) 0%,
    var(--owf-primary) var(--fill),
    rgba(45, 51, 56, 0.10) var(--fill),
    rgba(45, 51, 56, 0.10) 100%
  );
}

.rating-label {
  color: var(--ink-800);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.card-subtitle {
  color: var(--ink-800);
  font-size: 0.92rem;
  line-height: 1.5;
  min-height: calc(1 * 1.5em);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.card-specs {
  color: var(--ink-600);
  font-size: 0.88rem;
  line-height: 1.5;
  min-height: calc(2 * 1.5em);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-price {
  margin: 0;
  color: var(--ink-950);
  font-size: 0.82rem;
  font-weight: 400;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.card-price strong {
  font-size: 0.96rem;
  font-weight: 800;
}

.card-price span {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-800);
  white-space: nowrap;
}

/* ─── Card Footer: price + book button aligned horizontally ──── */
.card-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 1rem 0 1.12rem;
}

.card-actions {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

.primary-link {
  position: relative;
  z-index: 6;
  pointer-events: auto;
  justify-self: start;
  align-self: start;
  min-height: auto !important;
  font-size: 0.75rem !important;
  font-weight: 800;
  line-height: 1.4 !important;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-link:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 91, 193, 0.22);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(45, 51, 56, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  padding: 2rem 1.2rem;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state p {
  margin-top: 0.6rem;
  color: var(--ink-800);
  line-height: 1.55;
}

.map-canvas {
  width: 100%;
  height: 100%;
}

.leaflet-container {
  background: #dbe4e8;
  font-family: var(--site-font-sans);
}

.house-marker,
.property-marker {
  transform: translate(-50%, -100%);
}

.house-marker span,
.property-marker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  min-height: 2.35rem;
  border-radius: 999px;
  padding: 0 0.78rem;
  box-shadow: 0 12px 28px rgba(45, 51, 56, 0.14);
  font-size: 0.84rem;
  font-weight: 800;
}

.house-marker span {
  background: var(--owf-primary);
  color: #fff;
}

.property-marker span {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink-950);
}

.property-marker.is-selected span {
  background: var(--owf-primary);
  color: #fff;
}

.map-popup {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 21rem;
  border: 1px solid var(--owf-primary-light-border);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 58px rgba(0, 91, 193, 0.12);
}

.leaflet-popup-content-wrapper {
  background: transparent;
  border-radius: 22px;
  box-shadow: none;
  overflow: visible;
  padding: 0;
}

.leaflet-popup-content {
  margin: 0;
}

.leaflet-popup-tip-container {
  display: none;
}

.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.98);
}

.map-popup-media {
  position: relative;
  aspect-ratio: 1 / 0.78;
  overflow: hidden;
  border-radius: 0;
  background: linear-gradient(135deg, #dbe4e8, #f6f8f8);
}

.map-popup-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-popup-controls {
  position: absolute;
  inset: auto 0.55rem 0.55rem auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.map-popup-controls .gallery-button,
.map-popup-controls .gallery-counter {
  min-width: 1.85rem;
  min-height: 1.85rem;
}

.map-popup-headline {
  display: contents;
}

.map-popup .card-body {
  padding: 0.70rem 0.9rem 0;
  gap: 0.22rem;
  background: rgba(255, 255, 255, 0.98);
}

.map-popup .card-headline {
  gap: 0.12rem;
}

.map-popup .badge-row {
  justify-content: flex-end;
}

.map-popup .meta-badges {
  max-width: 100%;
}

.map-popup .card-title,
.map-popup .card-subtitle,
.map-popup .card-specs {
  min-height: 0;
}

.map-popup .card-subtitle,
.map-popup .card-specs {
  line-height: 1.4;
}

.map-popup .card-specs {
  margin-top: 0.32rem;
}

.map-popup .card-footer {
  min-height: auto;
  padding: 0.50rem 0 0.50rem;
}

.map-popup .primary-link {
  color: #fff !important;
}

.map-popup .primary-link:hover {
  background: var(--owf-primary-hover);
  transform: none;
  box-shadow: none;
}

.leaflet-control-layers {
  border: 1px solid rgba(45, 51, 56, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 40px rgba(45, 51, 56, 0.08);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  overflow: hidden;
}

.leaflet-control-layers-toggle {
  width: 42px;
  height: 42px;
}

.leaflet-control-layers-expanded {
  padding: 0.8rem 0.9rem;
  color: var(--ink-950);
}

.leaflet-control-layers-selector {
  accent-color: var(--owf-primary);
}

@media (max-width: 1160px) {
  .page-shell {
    grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .page-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, var(--map-height-mobile)) minmax(0, 1fr);
    padding: 0;
    gap: 1rem;
  }

  .panel-map {
    order: 1;
  }

  .panel-list {
    order: 2;
  }

  .panel-inner {
    overflow-y: auto;
  }

  .map-wrapper {
    position: relative;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .results-grid-wrapper {
    overflow: visible;
    flex: 0 0 auto;
  }

  .results-section {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .site-where-stay-page__frame {
    height: 100svh;
    padding: 12px 1rem 1rem;
  }

  .panel-inner {
    padding: 1.2rem;
  }

  .page-header h1 {
    font-size: 1.85rem;
  }

  .filters-topline {
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .filters-actions {
    --filter-action-size: 36px;
    width: 100%;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .ghost-button {
    padding: 0 0.74rem;
    font-size: 0.88rem;
  }

  .icon-button {
    font-size: 0.95rem;
  }

  .results-grid {
    gap: 0.85rem;
  }

  .card-headline {
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (max-width: 430px) {
  .results-grid {
    grid-template-columns: 1fr;
  }

  .badge-row {
    gap: 0.5rem;
  }

  .meta-badges {
    max-width: calc(100% - 2.5rem);
  }
}
