.cl-home-search {
  --clhs-header-offset: 0px;
  --clhs-gap: 1.5rem;
  --clhs-map-width: 58%;
  --clhs-left-width: 42%;
  --clhs-grid-columns: 2;
  --clhs-card-bg: #fff;
  --clhs-card-cols: 2;
  --clhs-card-aspect-ratio: 16 / 9;
  --clhs-card-border-color: #d8e0e8;
  --clhs-card-radius: 12px;
  --clhs-card-shadow: 0 4px 16px rgba(17, 34, 51, 0.06);
  --clhs-card-title-font-family: inherit;
  --clhs-card-title-size: 1.125rem;
  --clhs-card-meta-size: 0.9rem;
  margin: 1rem 0;
  display: grid;
  gap: 1rem;
}

.cl-home-search.is-loading .clhs-results-region {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.clhs-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--clhs-gap);
  align-items: start;
}

.clhs-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.clhs-results-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.clhs-results-region {
  display: grid;
  gap: 0.95rem;
}

.clhs-preview-indicator {
  margin: 0;
  padding: 0.5rem 0.72rem;
  border: 1px solid #c9dbe8;
  border-left: 4px solid #0f5b89;
  border-radius: 8px;
  background: #f2f8fc;
  color: #27465d;
  font-size: 0.81rem;
  font-weight: 600;
  line-height: 1.35;
}

.clhs-map-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.clhs-map-panel {
  position: relative;
  height: 360px;
}

.clhs-map-wrapper .clhs-map-panel .clhs-map {
  height: 100%;
  min-height: 360px;
}

.clhs-map-toggle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #c5d0da;
  background: #fff;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font-weight: 600;
}

.clhs-map {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #e8edf2;
  border: 1px solid #d4dde5;
}

.cl-home-search-form {
  margin: 0;
}

.clhs-filter-container {
  background: #fff;
  border: 1px solid #e4e9ef;
  border-radius: 10px;
  padding: 1.1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.clhs-filters {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.95rem;
}

.clhs-row {
  margin: 0;
}

.clhs-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

.clhs-active-filters:not(.is-hidden) {
  margin-bottom: 0.8rem;
}

.clhs-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #c5d0da;
  background: #fff;
  color: #243746;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.clhs-filter-pill-remove {
  border: 0;
  background: transparent;
  color: #0f5b89;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.clhs-filter-pill-remove:hover,
.clhs-filter-pill-remove:focus-visible {
  color: #093d5d;
}

.clhs-row-primary,
.clhs-row-home-type {
  display: grid;
  gap: 0.45rem;
}

.clhs-filters label {
  font-size: 0.76rem;
  margin-bottom: 0;
  font-weight: 600;
  color: #314b61;
  line-height: 1.3;
}

.clhs-form input,
.clhs-form select {
  min-height: 40px;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  line-height: 1.3;
}

.cl-home-search-field {
  display: grid;
  gap: 0.35rem;
}

.cl-home-search-field input:not([type="checkbox"]),
.cl-home-search-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c5d0da;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.cl-home-search-field input:not([type="checkbox"]):focus-visible,
.cl-home-search-field select:focus-visible {
  border-color: var(--brand-primary, #0f5b89);
  box-shadow: 0 0 0 3px rgba(15, 91, 137, 0.18);
  outline: none;
}

.clhs-form input[type="checkbox"] {
  width: auto;
  min-height: 0;
  padding: 0;
}

.clhs-row-core {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr;
  gap: 0.85rem;
  align-items: end;
}

.clhs-home-type-row {
  display: flex;
  gap: 0.55rem;
}

.clhs-filters .clhs-home-type-btn {
  flex: 1;
  border: 1px solid #d7dde3;
  background: #f9fbfd;
  color: #243746;
  opacity: 1;
  padding: 0.52rem 0.75rem;
  border-radius: 6px;
  font-size: 0.87rem;
  text-align: center;
  min-height: 40px;
  font-weight: 600;
  line-height: 1.2;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.clhs-filters .clhs-home-type-btn:hover {
  border-color: var(--brand-primary, #0f5b89);
  background: #f2f8fc;
}

.clhs-filters .clhs-home-type-btn.is-active {
  border: 1px solid var(--brand-primary, #0f5b89);
  background: #eaf4fb;
  color: #0a4a70;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(15, 91, 137, 0.12);
}

.clhs-filters .clhs-home-type-btn:focus-visible,
.clhs-advanced-toggle-link:focus-visible,
.clhs-submit-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 91, 137, 0.2);
  border-color: var(--brand-primary, #0f5b89);
}

.clhs-row-actions {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 0.1rem;
}

.clhs-sort-field {
  min-width: 170px;
}

.clhs-advanced-toggle-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #c5d0da;
  border-radius: 8px;
  background: #fff;
  color: #1f4460;
  padding: 0.45rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.clhs-advanced-toggle-link:hover {
  border-color: var(--brand-primary, #0f5b89);
  color: #0a4a70;
  background: #f7fbff;
}

.clhs-submit-btn {
  white-space: nowrap;
  align-self: end;
  margin: 0;
  min-height: 40px;
  padding: 0.5rem 1rem;
}

.clhs-advanced-panel {
  margin-top: 0;
  padding-top: 0.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
}

.is-hidden {
  display: none;
}

.clhs-results-count {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #243746;
}

.clhs-result-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f5b89;
}

.cl-home-search-grid {
  display: grid;
  grid-template-columns: repeat(var(--clhs-grid-columns, var(--clhs-card-cols, 2)), minmax(0, 1fr));
  gap: 1rem;
}

.clhs-card {
  position: relative;
  border: 1px solid var(--clhs-card-border-color);
  border-radius: var(--clhs-card-radius);
  overflow: hidden;
  background: var(--clhs-card-bg);
  box-shadow: var(--clhs-card-shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.clhs-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.clhs-card-main {
  display: grid;
}

.clhs-card-link:focus-visible {
  outline: 2px solid rgba(15, 91, 137, 0.85);
  outline-offset: -2px;
}

.clhs-card-actions {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.clhs-card-actions:empty {
  display: none;
}

.clhs-card-media {
  position: relative;
  aspect-ratio: var(--clhs-card-aspect-ratio);
  background: #edf2f7;
  border-bottom: 1px solid #e3e9ef;
}

.clhs-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #edf2f7;
}

.clhs-card-image-placeholder {
  height: 100%;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 0.8rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #4f6476;
  background: linear-gradient(180deg, #f2f6fa 0%, #e6edf5 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
}

.clhs-card-body {
  padding: 0.95rem 1rem 1rem;
  display: grid;
  gap: 0.45rem;
}

.clhs-card-price {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #123a56;
}

.clhs-card-title {
  margin: 0;
  font-family: var(--clhs-card-title-font-family);
  font-size: var(--clhs-card-title-size);
  line-height: 1.35;
  font-weight: 600;
  color: #132f44;
}

.clhs-card-locality {
  font-size: 0.86rem;
  line-height: 1.35;
  color: #4a5f71;
}

.clhs-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem 0.5rem;
  font-size: var(--clhs-card-meta-size);
  line-height: 1.35;
  color: #32495b;
}

.clhs-card-meta-token {
  display: inline-flex;
  align-items: center;
}

.clhs-card-meta-token:not(:last-child)::after {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #90a0ae;
  margin-left: 0.5rem;
}

.cl-home-search .clhs-card {
  background: var(--clhs-card-bg);
  border-radius: var(--clhs-card-radius);
}

.cl-home-search .clhs-card-title {
  margin: 0;
  font-family: var(--clhs-card-title-font-family);
  font-size: var(--clhs-card-title-size);
  line-height: 1.35;
  color: #132f44;
}

.cl-home-search .clhs-card-meta {
  margin: 0;
  font-size: var(--clhs-card-meta-size);
  line-height: 1.4;
  color: #32495b;
}

.clhs-card-status {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(15, 91, 137, 0.2);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f5b89;
  font-weight: 600;
  background: rgba(15, 91, 137, 0.08);
}

.cl-home-search-grid .clhs-card:hover,
.cl-home-search-grid .clhs-card:focus-within {
  border-color: #9db0c0;
  box-shadow: 0 10px 24px rgba(17, 34, 51, 0.11);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .clhs-card,
  .cl-home-search-grid [data-listing-id].is-marker-pulse,
  .clhs-map-point-icon,
  .clhs-map .clhs-map-cluster-badge {
    transition: none;
    animation: none;
  }

  .cl-home-search-grid .clhs-card:hover,
  .cl-home-search-grid .clhs-card:focus-within,
  .clhs-map .clhs-map-cluster-icon:hover .clhs-map-cluster-badge,
  .leaflet-marker-icon.clhs-map-point-icon.clhs-marker-active {
    transform: none;
  }
}

.clhs-message-title {
  margin: 0 0 0.3rem;
  color: #15384f;
  font-size: 1rem;
}

.clhs-message-body {
  margin: 0;
  color: #2a4355;
  font-size: 0.92rem;
}

.clhs-message-hint {
  margin: 0.45rem 0 0;
  color: #4f687b;
  font-size: 0.84rem;
}

.cl-home-search-grid [data-listing-id].is-hover-linked {
  outline: 2px solid #0f5b89;
  outline-offset: 1px;
}

.cl-home-search-grid [data-listing-id].is-marker-pulse {
  animation: clhs-card-pulse 0.9s ease;
}

@keyframes clhs-card-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 91, 137, 0.45);
  }
  80% {
    box-shadow: 0 0 0 14px rgba(15, 91, 137, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 91, 137, 0);
  }
}

.leaflet-marker-icon.clhs-marker-active {
  filter: brightness(1.04) drop-shadow(0 0 10px rgba(15, 91, 137, 0.68));
}

.clhs-map-point-icon {
  transition: transform 0.16s ease, filter 0.16s ease;
}

.leaflet-marker-icon.clhs-map-point-icon.clhs-marker-active {
  transform: scale(1.15);
}

.clhs-map .clhs-map-cluster-icon {
  background: transparent;
  border: 0;
}

.clhs-map .clhs-map-cluster-badge {
  min-width: 40px;
  height: 40px;
  padding: 0 0.45rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: linear-gradient(180deg, #0f5b89 0%, #0b476b 100%);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.clhs-map .clhs-map-cluster-icon:hover .clhs-map-cluster-badge,
.clhs-map .clhs-map-cluster-icon:focus-within .clhs-map-cluster-badge {
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.31);
}

.clhs-map-popup-wrapper {
  max-height: 320px;
  overflow: hidden;
}

.clhs-map-popup-wrapper .clhs-card {
  max-width: 260px;
  box-shadow: none;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transform: none;
}

.clhs-map-popup-wrapper .clhs-card-body {
  padding: 0.55rem 0.75rem 0.65rem;
  gap: 0.3rem;
}

.clhs-map-popup-wrapper .clhs-card-title {
  font-size: 0.9rem;
  line-height: 1.25;
}

.clhs-map-popup-wrapper .clhs-card-meta {
  font-size: 0.8rem;
  gap: 0.28rem 0.35rem;
}

.clhs-map-popup-wrapper .clhs-card-image {
  height: 140px;
  object-fit: cover;
}

.clhs-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 30, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 1150;
}

.clhs-bottom-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.clhs-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 50vh;
  background: #fff;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.2);
  transform: translateY(108%);
  transition: transform 0.24s ease;
  z-index: 1200;
  overflow: hidden;
  pointer-events: none;
}

.clhs-bottom-sheet.is-open {
  transform: translateY(0);
  pointer-events: auto;
}

.clhs-bottom-sheet-handle {
  width: 42px;
  height: 4px;
  margin: 8px auto 6px;
  border-radius: 999px;
  background: rgba(16, 36, 54, 0.25);
}

.clhs-bottom-sheet-content {
  max-height: calc(50vh - 18px);
  overflow: auto;
  padding: 0 10px 10px;
}

.clhs-bottom-sheet-content .clhs-card {
  max-width: 100%;
  box-shadow: none;
  transform: none;
}

.clhs-map .leaflet-top,
.clhs-map .leaflet-bottom {
  z-index: 650;
}

.clhs-map .clhs-community-overlay {
  color: #0f5b89;
  fill: none;
  stroke: #0f5b89;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.clhs-map .leaflet-top.leaflet-left {
  top: 8px;
  left: 8px;
}

.clhs-map .leaflet-control {
  pointer-events: auto;
}

.clhs-map .leaflet-control-zoom {
  margin: 0;
}

.cl-home-search-pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cl-home-search-pagination a,
.cl-home-search-pagination span {
  border: 1px solid #c5d0da;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  text-decoration: none;
}

.cl-home-search-pagination .is-disabled {
  opacity: 0.55;
}

.clhs-infinite-controls {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.clhs-load-more {
  border: 1px solid #c5d0da;
  border-radius: 999px;
  padding: 0.45rem 1.25rem;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}

.clhs-load-more:disabled {
  opacity: 0.6;
  cursor: default;
}

.clhs-infinite-sentinel {
  width: 100%;
  height: 1px;
}

.cl-home-search-error,
.cl-home-search-empty,
.cl-home-search-debug {
  border: 1px solid #d5dfe8;
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(17, 34, 51, 0.04);
}

.cl-home-search-empty {
  border-color: #d8e2eb;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.cl-home-search-error {
  border-color: #e2c3c3;
  background: #fff7f7;
}

.cl-home-search-debug dl {
  margin: 0.5rem 0 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.cl-home-search-debug dt {
  font-weight: 600;
}

.cl-home-search.clhs-card-border-none .clhs-card {
  border: none;
  box-shadow: 0 2px 10px rgba(17, 34, 51, 0.05);
}

.cl-home-search.clhs-card-border-subtle .clhs-card {
  border-width: 1px;
  box-shadow: 0 4px 16px rgba(17, 34, 51, 0.06);
}

.cl-home-search.clhs-card-border-prominent .clhs-card {
  border-width: 2px;
  border-color: #9fb0be;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
  .clhs-layout {
    grid-template-columns: minmax(380px, var(--clhs-left-width)) minmax(0, var(--clhs-map-width));
  }

  .clhs-results-pane {
    padding-right: 0.35rem;
  }

  .clhs-map-wrapper {
    position: sticky;
    top: var(--clhs-header-offset);
    height: calc(100vh - var(--clhs-header-offset));
    max-height: calc(100vh - var(--clhs-header-offset));
  }

  .clhs-map-panel {
    height: 100%;
    max-height: calc(100vh - var(--clhs-header-offset));
  }

  .clhs-map-wrapper .clhs-map-panel .clhs-map {
    min-height: 100%;
  }

  .clhs-map-toggle {
    display: none;
  }

  .cl-home-search-grid {
    grid-template-columns: repeat(var(--clhs-grid-columns, var(--clhs-card-cols, 2)), minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .clhs-filter-container {
    padding: 1rem;
  }

  .clhs-map-panel {
    height: 320px;
  }

  .clhs-map-panel .clhs-map {
    min-height: 320px;
  }

  .clhs-map-panel.is-hidden-mobile {
    display: none;
  }

  .clhs-row-core {
    grid-template-columns: 1fr 1fr;
  }

  .clhs-row-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.6rem;
  }

  .clhs-sort-field {
    width: 100%;
    min-width: 0;
  }

  .clhs-submit-btn {
    width: 100%;
  }

  .clhs-advanced-toggle-link {
    width: 100%;
  }

  .cl-home-search-pagination {
    display: none;
  }

  .cl-home-search-grid {
    grid-template-columns: 1fr;
  }

  .cl-home-search.clhs-force-pagination .cl-home-search-pagination {
    display: flex;
  }

  .cl-home-search.clhs-force-pagination .clhs-infinite-controls {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .clhs-home-type-row {
    flex-wrap: wrap;
  }

  .clhs-row-core {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .clhs-filters .clhs-home-type-btn {
    flex: 1 1 calc(50% - 0.3rem);
  }
}
