/*
 * /properties (WP template "Properties", post-313.css) and the filter widgets shared with /map-listing:
 * search box + sidebar filters (docs/design/components/{search-bar,select,range-slider,checkbox-list,sort-dropdown}.md),
 * results heading, inline cards list, empty state, pagination spacing.
 */
[hidden] {
  display: none !important;
}

/* ---------- Two columns: filters 33.33 % / results 66.67 % (tablet 40 / 60, mobile stacked) ---------- */
.listing {
  padding-top: 25px;
}
.listing__sidebar {
  width: 33.333%;
  padding: 20px 15px 15px;
}
.listing__main {
  width: 66.667%;
  padding: 15px;
}
.listing__frame {
  display: block;
  width: 100%;
}
turbo-frame[aria-busy='true'] .property-results {
  opacity: 0.6;
  transition: opacity 0.2s;
}

/* ---------- Filters sidebar ---------- */
.filters {
  width: 100%;
}
.filters__box {
  margin-bottom: 60px;
  padding: 38px 40px 50px;
  background-color: var(--color-secondary);
  transition: background 0.3s, border 0.3s, border-radius 0.3s, box-shadow 0.3s;
}
.filters__box-title {
  margin-bottom: calc(var(--widget-spacing) + 16px);
  color: var(--color-white);
}
.filters__group {
  display: flex;
  flex-direction: column;
  margin-bottom: 34.5px;
}
.filters__group > .select-field {
  margin-top: 5.5px;
  margin-bottom: 5.5px;
}
.filters__group > .filter-label + .select-field {
  margin-top: 6px;
}
.filters__box .filter-label {
  color: var(--gray-400);
}
.filters__apply {
  display: block;
  width: 100%;
  text-align: left;
}
.filters__title {
  margin-bottom: calc(var(--widget-spacing) + 28px);
}

.filter-label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  color: var(--gray-700);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
}
.filter-label--group {
  margin-bottom: 0;
}

/* Native selects: 12px text, white, 1px #DDDEDF, two 4px gradient triangles as the arrow (select.md). */
.select {
  display: block;
  width: 100%;
  padding: 9px 16px;
  border: 1px solid var(--color-field-border);
  border-radius: 0;
  background-color: var(--color-white);
  background-image: linear-gradient(45deg, transparent 50%, var(--color-select-arrow) 0), linear-gradient(135deg, var(--color-select-arrow) 50%, transparent 0);
  background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 16px) calc(50% + 2px);
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 400;
  line-height: var(--lh-small);
  white-space: pre;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s;
}
.select:focus,
.select:focus-visible,
.sorting__select:focus,
.sorting__select:focus-visible {
  outline: auto 3px var(--color-text);
}
.select-field--page {
  margin-bottom: var(--widget-spacing);
  padding-bottom: 22px;
}
.select-field--page .filter-label {
  color: var(--gray-700);
}

/* ---------- Price range (two overlaid range inputs) ---------- */
.price-filter {
  margin-bottom: calc(var(--widget-spacing) + 16px);
}
.price-filter .filter-label {
  margin-bottom: 15px;
}
.price-filter__slider {
  --low: 0%;
  --high: 100%;
  position: relative;
  height: 2px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}
.price-filter__track {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  transform: translateY(-50%);
  background-color: var(--gray-300);
}
.price-filter__track-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent var(--low), var(--color-secondary) 0, var(--color-secondary) var(--high), transparent 0) no-repeat 0 100% / 100% 100%;
}
.price-filter__input {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 12px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  background: transparent;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s;
}
.price-filter__input--min { z-index: 21; }
.price-filter__input--max { z-index: 20; }
.price-filter__input::-webkit-slider-runnable-track {
  height: 12px;
  background: transparent;
  -webkit-appearance: none;
}
.price-filter__input::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background-color: var(--color-secondary);
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
}
.price-filter__input::-moz-range-track {
  height: 12px;
  background: transparent;
}
.price-filter__input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background-color: var(--color-secondary);
  cursor: pointer;
  pointer-events: auto;
}
.price-filter__input:focus-visible {
  outline: none;
}
.price-filter__input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(0, 133, 242, 0.4);
}
.price-filter__input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(0, 133, 242, 0.4);
}
.price-filter__values {
  margin-top: -13px;
  color: var(--color-text);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  text-align: left;
}

/* ---------- Checkbox lists (Amenidades, Condición, Tipo) ---------- */
.checklist {
  min-width: 0;
  margin: 0 0 var(--widget-spacing);
  padding: 0 0 22px;
  border: 0;
}
.filters > .checklist:last-child {
  margin-bottom: 0;
}
.checklist .filter-label {
  width: 100%;
  margin-bottom: 15px;
}
.checklist__rows {
  display: flex;
  flex-direction: column;
  margin: -5px -2.5px;
}
.checklist__item {
  position: relative;
  display: flex;
  align-items: center;
  margin: 5px 2.5px;
  color: var(--gray-700);
  cursor: pointer;
}
.checklist[data-expanded='false'] .checklist__item--extra {
  display: none;
}
.checklist__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.checklist__decorator {
  position: relative;
  display: block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin-right: 10px;
  overflow: hidden;
  border: 1px solid var(--gray-300);
  background-color: var(--color-white);
  color: var(--color-white);
}
.checklist__decorator svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  opacity: 0;
}
.checklist__input:checked + .checklist__decorator {
  border-color: var(--color-checkbox-checked);
  background-color: var(--color-checkbox-checked);
}
.checklist__input:checked + .checklist__decorator svg {
  opacity: 1;
}
.checklist__input:focus-visible + .checklist__decorator {
  box-shadow: 0 0 0 3px rgba(0, 133, 242, 0.4);
}
.checklist__label {
  color: var(--color-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.checklist__toggle {
  margin: 0;
  padding: 12px 0 0;
  border: 0;
  background: none;
  color: var(--color-primary);
  font-size: var(--fs-button-sm);
  font-weight: 700;
  line-height: var(--lh-button-sm);
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}
.checklist__toggle:hover {
  color: var(--color-secondary);
}

/* ---------- Results ---------- */
.listing__heading {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
}
.listing__title {
  margin-right: 30px;
  margin-bottom: var(--widget-spacing);
}
.sorting {
  display: flex;
  flex: 0 0 259px;
  align-items: center;
  max-width: 259px;
  padding: 8px 0;
}
.sorting__label {
  margin-right: 8px;
  color: var(--gray-700);
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: var(--lh-body);
  white-space: nowrap;
}
.sorting__select {
  width: 140px;
  max-width: 140px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-select-arrow) 0), linear-gradient(135deg, var(--color-select-arrow) 50%, transparent 0);
  background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 16px) calc(50% + 2px);
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  box-shadow: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 40px;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s;
}

.listing__items {
  width: calc(100% + 30px);
  margin: 12px -15px calc(var(--widget-spacing) + 12px);
}
.listing__item {
  padding: 15px;
}
.no-results {
  margin: 12px 0 calc(var(--widget-spacing) + 12px);
  color: var(--color-text);
}
.listing__pagination {
  padding: 0 0 78px;
}

@media (max-width: 1024px) and (min-width: 768px) {
  .listing__sidebar { width: 40%; }
  .listing__main { width: 60%; }
}

@media (max-width: 1024px) {
  .filters__box { margin-bottom: 40px; padding: 30px; }
  .listing__heading { flex-wrap: wrap; }
  .listing__title { width: 100%; margin-right: 0; margin-bottom: var(--widget-spacing); }
  .sorting { flex-basis: 100%; width: 100%; max-width: 100%; }
  .listing__pagination { padding-bottom: 50px; }
}

@media (max-width: 767px) {
  .listing__sidebar,
  .listing__main { width: 100%; }
  .listing__pagination { padding-bottom: 30px; }
}
