html,
body {
  height: 100%;
  margin: 0;
}
.wrapper {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.main-content {
  flex: 1;
}
body {
  font-family: "Poppins", sans-serif;
}
header .container {
  position: relative;
  z-index: 6;
}
header {
  z-index: 6;
}
.card-title {
  font-size: 1.25rem;
  font-weight: bold;
}
.status-badge {
  background-color: var(--corp-color);
  color: white;
  font-size: 0.9rem;
}
.card-price {
  color: var(--corp-color);
  font-weight: bold;
}
.card-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 5.5em;
  /* opcional para mayor consistencia */
}
.footer {
  padding: 20px;
}
.card:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.card-img-top {
  height: 200px;
  /* o el alto que prefieras */
  object-fit: cover;
  width: 100%;
}
.active > .page-link,
.page-link.active {
  z-index: 1 !important;
  color: var(--bs-pagination-active-color);
  background-color: var(--corp-color);
  border-color: var(--corp-color);
}
.page-link {
  color: black;
}
.form-label {
  color: white;
}
.form-contact-label {
  color: white;
}
header.bg-dark {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 300px;
  /* ajusta según la altura deseada */
  padding-bottom: 1rem;
  z-index: 10 !important;
}
.pagination {
  position: relative;
  z-index: 4 !important;
}
#scrollTopButton {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  background-color: var(--corp-color);
  color: white;
  border: none;
  outline: none;
  padding: 12px 16px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-size: 18px;
  transition: opacity 0.3s ease;
}
#scrollTopButton:hover {
  background-color: #333;
}
.filtros {
  background-color: var(--corp-color);
  padding: 1rem;
  border-radius: 10px;
}
.header-text {
  color: var(--corp-color);
}
.function-button {
  background-color: black;
  color: white;
  border: 1px solid white;
  border-radius: 5px;
  padding: 0.5rem;
  transition: all 0.3s ease;
}
.function-button:hover {
  font-weight: bold;
  transform: scale(1.05);
}
.see-more-btn:hover {
  background-color: var(--corp-color);
  color: white !important;
}
.request-form {
  background-color: var(--corp-color);
  color: white !important;
  border-radius: 5px;
  padding: 1rem;
  margin-bottom: 5rem;
}
#scrollBottomButton {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 999;
  background-color: var(--corp-color);
  color: white;
  border: none;
  outline: none;
  padding: 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-size: 18px;
  transition: opacity 0.3s ease;
}
#scrollBottomButton:hover {
  background-color: #333;
}
.cards-container {
  max-width: 90%;
}
.img-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}
.img-wrapper img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.1rem;
  padding: 1rem;
}
.field-bubble {
  position: absolute;
  z-index: 2000;
  max-width: 280px;
  background: #fff8e1;
  /* fondo tipo warning suave */
  border: 1px solid #ffca2c;
  /* borde ámbar */
  color: #5c3c00;
  /* texto oscuro */
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 0.875rem;
}
.field-bubble::after {
  content: "";
  position: absolute;
  left: 12px;
  top: -8px;
  /* flecha arriba */
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent #ffca2c transparent;
}
.field-bubble::before {
  content: "";
  position: absolute;
  left: 12px;
  top: -7px;
  border-width: 0 7px 7px 7px;
  border-style: solid;
  border-color: transparent transparent #fff8e1 transparent;
}
.price-mask ~ .invalid-feedback {
  display: none !important;
}
/* === Featured carousel compacto =================================== */
.featured-carousel {
  padding: 8px 0 6px;
  position: relative;
  z-index: 1;
  overflow: visible;
  margin-right: 3rem !important;
  margin-left: 3rem !important;
  /* deja que la tarjeta activa sobresalga */
}
/* --- Contenedor de scroll (el que SCROLLEA) ----------------------- */
.featured-carousel .scroll-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  /* permite ver el scale en vertical */
  padding-block: 16px;
  /* colchón para el scale */
  margin-block: -16px;
  /* compensa el layout */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  /* snap sobre el que scrollea */
}
.featured-carousel .scroll-wrapper::-webkit-scrollbar {
  display: none;
}
/* --- Pista: solo layout (NO scrollea) ------------------------------ */
.featured-carousel .track {
  display: flex;
  gap: 16px;
}
/* --- Slides -------------------------------------------------------- */
.featured-carousel .slide {
  flex: 0 0 auto;
  width: calc((100% - 16px) / 2);
  /* base: 2 por vista */
  scroll-snap-align: center;
  /* ancla al centro para destacar la activa */
  position: relative;
  z-index: 0;
  transition: transform 0.25s ease;
}
@media (min-width: 576px) {
  .featured-carousel .slide {
    width: calc((100% - 2 * 16px) / 3);
  }
}
/* 3 por vista */
@media (min-width: 768px) {
  .featured-carousel .slide {
    width: calc((100% - 3 * 16px) / 4);
  }
}
/* 4 por vista */
@media (min-width: 1200px) {
  .featured-carousel .slide {
    width: calc((100% - 4 * 16px) / 5);
  }
}
/* 5 por vista */
/* --- Tarjeta ------------------------------------------------------- */
.feat-card {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  /* mantiene esquinas al escalar */
  text-decoration: none;
  color: inherit;
  background: #f2f2f2;
  height: 130px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  will-change: transform;
}
@media (min-width: 576px) {
  .feat-card {
    height: 140px;
  }
}
@media (min-width: 768px) {
  .feat-card {
    height: 150px;
  }
}
@media (min-width: 1200px) {
  .feat-card {
    height: 160px;
  }
}
.feat-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
  will-change: transform, filter, opacity;
}
/* Hover suave (opcional) */
.feat-card:hover img {
  transform: scale(1.02);
}
.feat-card img:hover.feat-units {
  opacity: 1;
}
.sold-out-banner {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 0, 0, 0.8);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 5;
  pointer-events: none;
}
/* --- Overlay reducido --------------------------------------------- */
.feat-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px 10px;
  color: #fff;
  z-index: 5;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  font-size: 0.85rem;
}
.feat-units {
  position: absolute;
  inset: 0 0 0 auto;
  opacity: 0.8;
  padding: 8px 10px;
  color: #fff;
  font-size: 0.85rem;
  background: linear-gradient(
    to bottom,
    var(--corp-color),
    var(--corp-color),
    rgba(255, 0, 0, 0),
    rgba(255, 0, 0, 0)
  );
}
.feat-offmarket {
  position: absolute;
  inset: 0 0 0 auto;
  background-color: red;
  padding: 8px 10px;
  color: #fff;
  font-size: 0.85rem;
  opacity: 0.8;
  background: linear-gradient(
    to bottom,
    rgba(255, 0, 0, 0.8),
    rgba(255, 0, 0, 0.8),
    rgba(255, 0, 0, 0),
    rgba(255, 0, 0, 0)
  );
  text-align: right;
}
.feat-overlay .ref {
  font-weight: 600;
  margin-bottom: 1px;
}
/* --- Protagonismo: activa vs resto -------------------------------- */
/* Resto: más claros/atenuados y un pelín más pequeños */
.featured-carousel .slide:not(.is-active) .feat-card {
  opacity: 0.6;
  transform: scale(0.98);
}
.featured-carousel .slide:not(.is-active) .feat-card img {
  filter: grayscale(30%) saturate(0.75) brightness(0.88);
  opacity: 0.95;
}
/* Activa: nítida, por encima y con escala */
.featured-carousel .slide.is-active {
  z-index: 4;
}
.featured-carousel .slide.is-active .feat-card {
  opacity: 1;
  transform: translateZ(0) scale(1.05);
  transform-origin: center center;
  backface-visibility: hidden;
}
.featured-carousel .slide.is-active .feat-card img {
  transform: translateZ(0);
}
/* evita borrosidad */
/* --- Controles ----------------------------------------------------- */
.featured-carousel .swiper-controls {
  display: flex;
  /* siempre visibles */
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.title-container {
  gap: 1rem;
}
.featured-carousel .btn-nav {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  line-height: 28px;
  text-align: center;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex !important;
  /* fuerza visibilidad */
  align-items: center;
  justify-content: center;
}
/* --- Accesibilidad (reduce motion) -------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .feat-card,
  .feat-card img,
  .featured-carousel .slide {
    transition: none !important;
  }
}
@media (max-width: 1200px) {
  .non-mobile {
    display: none !important;
  }
  .feat-offmarket {
    opacity: 0.8;
    background: linear-gradient(
      to bottom,
      rgba(255, 0, 0, 0.8),
      rgba(255, 0, 0, 0)
    );
    width: 100%;
  }
  .featured-carousel {
    margin-bottom: 2rem;
  }
  .logo-home {
    max-height: 100px !important;
  }
  .locations-allowed {
    display: none;
  }
  .featured-carousel {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
  .featured-carousel .slide:not(.is-active) .feat-card .feat-overlay,
  .featured-carousel .slide:not(.is-active) .feat-card .feat-offmarket,
  .featured-carousel .slide:not(.is-active) .feat-card .feat-units {
    display: none;
  }
  .main-title {
    font-size: 22px;
  }
  .title-container {
    gap: 0rem !important;
  }
}

#filtersButton.active {
  background-color: var(--corp-color);
  color: #fff;
}
.page-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: grid;
  place-items: center;
  z-index: 2000;
  transition: opacity 0.25s ease;
}
.page-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.loader-content {
  text-align: center;
}
.loader-logo {
  max-height: 150px;
  object-fit: contain;
}
.loader-text {
  font-size: 2rem;
  color: #333;
  margin-top: 0.5rem;
}
/* Spinner */
.spinner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px solid #eee;
  border-top-color: var(--corp-color, #1ab394);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Estado inicial (colapsado): fondo claro, texto y borde corporativo */
#filtersButton.collapsed,
#contactButton.collapsed {
  background-color: #000000;
  color: white;
  border: 1px solid white;
}

/* Estado abierto (activo): fondo corporativo, texto blanco */
#filtersButton.active,
#contactButton.active {
  background-color: white;
  color: var(--corp-color);
  border: 1px solid var(--corp-color);
}
/* Compactar filtros en móviles */
@media (max-width: 1200px) {
  .loader-text {
    font-size: 1rem;
    color: #333;
    margin-top: 0.5rem;
  }
  .filtros {
    margin: 0 1rem !important;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
  }
  .filtros .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
  }
  .filtros .form-select,
  .filtros .form-control {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    height: auto;
  }
  /* Poner campos cortos en 2 columnas para ahorrar altura */
  .filtros .col-6,
  .filtros .col-sm-3,
  .filtros .col-md-2,
  .filtros .col-lg-1 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  /* Botones en una línea y pegados */
  .filtros .col-12.col-md-3.d-flex {
    justify-content: space-between !important;
    gap: 0.5rem !important;
  }
  .filtros .function-button,
  .filtros .btn.btn-secondary {
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
  }

  /* Dropdowns grandes (ubicación/estado) ocupan todo el ancho */
  .filtros .dropdown.w-100 .form-select {
    width: 100%;
  }
}
.bg-semitransparent {
  background-color: rgba(255, 255, 255, 0.5); /* blanco con 50% de opacidad */
}
.agent-item {
  padding: 0.25rem 0;   /* muy compacto */
  line-height: 1.3;
}

.agent-item .fw-bold {
  font-size: 0.95rem;   /* nombre más pequeño */
}

.agent-item .small {
  font-size: 0.8rem;
}
