/**************** PROPERTIES LIST ****************/
.properties-list {
  display: block;
}

.property-card__header {
  display: flex;
  flex-flow: nowrap column;
  align-items: start;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0.5rem;
}

.properties-list__title {
  font-size: var(--size-h2);
  margin: 0 0 2.5rem 0;
}

.properties-list__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem;
}

@media (width<=1200px) {
  .properties-list__grid {
    gap: 2rem;
  }
}

@media (width<=1024px) {
  .properties-list__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width<=768px) {
  .properties-list__grid {
    grid-template-columns: 1fr;
  }
  .property-card__image {
    max-height: 350px;
    object-fit: cover;
  }
}

/* Loader overlay for AJAX results */
.postsList {
  position: relative;
}
.postsList.loading {
  filter: blur(0.5px);
}
.loaderWrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.6);
  z-index: 5;
}
.loader {
  width: 44px;
  height: 44px;
  border: 3px solid #ddd;
  border-top-color: var(--principal);
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}
@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

/* Aplicar el mismo grid al listado generado por el shortcode */
.postsList.propiedad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem;
}

@media (width<=959px) {
  .properties-list__grid {
    gap: 1rem;
  }
  .postsList.propiedad {
    gap: 1rem;
  }
}

/**************** PROPERTY CARD ****************/
.property-card {
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.property-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.property-card__link {
  display: grid;
  grid-template-rows: auto 1fr;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.property-card__media {
  position: relative;
  overflow: hidden;
}

.property-card__image {
  max-width: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.property-card__title {
  font-size: var(--size-h5);
  line-height: 1.25;
  margin: 0;
  color: var(--negro);
  font-weight: 600;
}

.property-card__badge {
  font-size: var(--size-psmall);
  text-transform: uppercase;
  line-height: 1;
  padding: 0.75rem;
  border-radius: 2px;
  background: var(--principal);
  color: var(--blanco);
}

.property-card__title-price {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.property-card__meta {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0.5rem;
  padding: 0 1.5rem 1.5rem;
}

.property-card__price {
  font-weight: 600;
  font-size: var(--size-h3);
  color: #423e38;
}

.property-card__price-suffix,
.property-card__unit {
  font-size: 1rem;
  font-weight: 400;
}

.property-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.property-card__fact {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.property-card__label {
  font-size: var(--size-psmall);
  color: #666;
}

.property-card__value {
  font-size: 1.065rem;
  font-weight: 500;
  color: var(--negro);
}

.property-card__icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.property-card__icon--bedrooms {
  background-image: url("/wp-content/uploads/2025/10/dormitorios-2025-10-30-dormitorios.svg");
}

.property-card__icon--bathrooms {
  background-image: url("/wp-content/uploads/2025/10/banos-2025-10-30-banos.svg");
}

.property-card__icon--sqm {
  background-image: url("/wp-content/uploads/2025/10/metros-2025-10-30-metros.svg");
}

.property-card__icon--floor {
  background-image: url("/wp-content/uploads/2025/10/piso-2025-10-30-piso.svg");
}

@media (width<=500px) {
  .property-card__price {
    font-size: 1.6rem;
  }
}

@media (width<=425px) {
  .properties-list__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .postsList.propiedad {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .property-card__header,
  .property-card__meta {
    padding: 0.5rem;
  }

  .property-card__title-price {
    gap: 0;
  }
}

/**************** PROPERTY FILTERS ****************/
.property-filters {
  background: var(--gris);
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
}

.property-filters__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.property-filters__field {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.property-filters__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--negro);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.property-filters__input {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: var(--size-p);
  background: var(--blanco);
  color: var(--negro);
}

.property-filters__input:focus {
  outline: none;
  border-color: var(--principal);
}

/* Ranges */
.property-filters__range-wrap {
  position: relative;
  top: -2px;
}
.property-filters__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 48px;
  /* background: #e9e9e9; */
  border-radius: 100vmax;
  outline: none;
  padding: 8px 12px;
  border: 2px solid var(--secundario);
}
.property-filters__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--principal);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--principal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.property-filters__range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--principal);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
}
.property-filters__range-output {
  font-weight: 600;
  color: var(--negro);
}

.property-filters__range-bubble {
  position: absolute;
  top: 70px;
  left: 0;
  transform: translateY(-50%);
  background: #fff;
  color: var(--negro);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 4px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  white-space: nowrap;
}

/* Ocultar select nativo cuando se use custom select */
.is-native-hidden {
  display: none;
}

/* Custom Select */
.custom-select-wrapper {
  position: relative;
}
.custom-select {
  position: relative;
  width: 100%;
  font-size: var(--size-p);
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: var(--blanco);
  color: var(--negro);
  cursor: pointer;
  font-size: var(--size-p);
  transition: border-color 0.2s ease;
  min-height: 44px;
}

.custom-select-trigger:hover {
  border-color: var(--principal);
}

.custom-select-trigger:focus {
  outline: none;
  border-color: var(--principal);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.custom-select-value {
  flex: 1;
  text-align: left;
}

.custom-select-arrow {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.custom-select-arrow img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.custom-select--open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select--open .custom-select-arrow::before {
  border-top-color: var(--principal);
}

.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--blanco);
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  margin-top: -1px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  padding: 4px 0;
}

.custom-select--open .custom-select-options {
  max-height: 300px;
  opacity: 1;
  visibility: visible;
  overflow-y: auto;
}

.custom-select-option {
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  font-size: var(--size-p);
  color: var(--negro);
  transition: background-color 0.2s ease;
}

.custom-select-option:hover {
  background-color: var(--gris);
}

.custom-select-option[data-selected="true"] {
  background-color: var(--principal);
  color: var(--blanco);
  font-weight: 600;
}

/* === Replica estilos tipo gene-list-container adaptados al bloque de filtros === */
.custom-select-wrapper {
  position: relative;
  display: inline-block;
  min-width: 100%;
}

.custom-select {
  position: relative;
  background: #fff;
  border: 2px solid var(--secundario);
  border-radius: 100vmax;
  cursor: pointer;
  transition: border-color 0.3s ease;
  user-select: none;
  font-size: 20px;
  color: #2b2a2a;
  font-weight: 600;
}

.custom-select:hover {
  border-color: var(--secundario);
}

/* Soportar ambos toggles: --open y .open */
.custom-select--open,
.custom-select.open {
  border-color: var(--secundario);
}

.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 20px;
  border-radius: 100vmax;
  color: #2b2a2a;
  font-weight: 600;
  border: 0;
}

.custom-select-value {
  flex: 1;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.2;
}

.custom-select-arrow {
  margin-left: 8px;
  font-size: 16px;
  color: #666;
  transition: transform 0.3s ease;
}

.custom-select--open .custom-select-arrow,
.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid var(--secundario);
  border-radius: 16px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.custom-select--open .custom-select-options,
.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-option {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #2b2a2a;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.custom-select-option:last-child {
  border-bottom: none;
}
.custom-select-option:hover {
  background-color: #f8f9fa;
}

/* Soporta data-selected y clase selected */
.property-filters .custom-select-option[data-selected="true"] {
  background-color: #a5e46126;
}
.property-filters .custom-select-option.selected {
  background-color: #a5e46126;
}
.property-filters .custom-select-option.selected:hover {
  background-color: #6bb31a;
  color: #fff;
}

/* Scrollbar del desplegable */
.custom-select-options::-webkit-scrollbar {
  width: 10px;
}
.custom-select-options::-webkit-scrollbar-thumb {
  background: #e1e1e1;
  border-radius: 10px;
  display: none !important;
}
.custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}

.property-filters__features {
  margin-bottom: 1.5rem;
  grid-column: span 2;
}

.property-filters__checkboxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0.5rem;
  gap: 0.5rem 1rem;
}

.property-filters__checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--size-psmall);
  cursor: pointer;
}

.property-filters__checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.property-filters__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  grid-column: span 1;
  align-items: center;
  justify-content: flex-end;
}

.property-filters__submit {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 100vmax;
  font-size: var(--size-p);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.property-filters__submit:hover {
  background: var(--secundario);
}

.property-filters__reset {
  background: transparent;
  color: var(--negro);
  border: 1px solid var(--negro);
  border-radius: 100vmax;
  font-size: var(--size-p);
  text-decoration: none;
  transition: all 0.2s ease;
}

.property-filters__reset:hover {
  background: var(--negro);
  color: var(--blanco);
}

@media (width<=959px) {
  .property-filters__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width<=500px) {
  .property-filters {
    padding: 1rem;
  }
  .property-filters__grid {
    grid-template-columns: 1fr;
  }
  .property-filters__checkboxes {
    grid-template-columns: 1fr;
  }
}

/***************** SINGLE PROPERTY PAGE ****************/
.property-price {
  font-weight: 600;
  font-size: var(--size-h3);
  color: #423e38;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.property-price__suffix {
  font-size: 0.9rem;
}

.single-propiedad .image_frame,
.single-propiedad .image_frame * {
  min-width: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* Single Property Gallery */
.property-gallery__image {
  margin: 0 1rem;
  border-radius: 10px;
}

.property-gallery .slick-dots {
  display: flex;
  gap: 0.75rem;
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.property-gallery .slick-dots button {
  font-size: 0;
  background-color: #fff;
  padding: 0;
  min-width: 14px;
  min-height: 14px;
  border-radius: 100vmax;
  opacity: 0.8;
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
}

.property-gallery .slick-dots button:hover {
  background-color: #fff;
}

.property-gallery .slick-dots .slick-active button {
  min-width: 18px;
  min-height: 18px;
  opacity: 1;
}

/* Relacionadas */
.single-propiedad .properties-list__title {
  font-size: var(--size-h2);
  text-align: center;
}
