@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root { 
  --primary: #fb9f2ee2;
  --dark: #333;
  --bg: #f0eaea;
  --round: 5px;
  --font: 'Poppins', sans-serif;
}

* {
  box-sizing: border-box;
  
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  font-family: "Poppins", sans-serif;
}

/* Layout para footer pegado al fondo en la página de terrenos */
html, body {
  height: 100%;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 0;
}

footer {
  margin-top: auto;
}

/* La sección principal de terrenos ocupa el espacio disponible */
#terrenos-disponibles {
  flex: 1 0 auto;
}

html {
  margin: 0;
  padding: 0;
}

.container {
  width: 85%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Header y Navegación */
header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--primary);
  color: white;
  transition: all 0.3s ease;
  padding: 0.3rem 0;
}

.logo {
  height: 4rem;
  transition: height 0.3s ease;
  border: 0.2rem solid black;
  border-radius: 0.5rem;
}

header.shrink .logo {
  height: 2.5rem;
}

header.shrink {
  padding: 0.1rem 0;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.2);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0;
}

nav {
  margin: 0.3rem -4.4rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  flex-direction: row;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: color .3s;
}

nav ul li a:hover {
  color: var(--dark);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  position: relative;
  background: none;
  color: white;
  border: none;
  cursor: pointer;
  z-index: 1101;
  font-size: 1.5rem;
}

.menu-toggle .bar {
  display: block;
  height: 0.2rem;
  width: 1.9rem;
  background-color: white;
  border-radius: 0.1rem;
  transition: all 0.3s ease;
  position: relative;
  transform-origin: center;
  margin: 0.2rem 0;
}

.menu-toggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translateY(0.5rem);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: rotate(-45deg) translateY(-0.5rem);
}

/* Buscador */
.buscador-inmuebles {
  background: #f7f7f7;
  padding: 2rem 0 1.5rem 0;
  text-align: center;
  margin-bottom: 1.9rem;
}

.buscador-inmuebles h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
  color: #222;
}

.buscador-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.9rem;
}

.buscador-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  justify-content: center;
}

.buscador-row select {
  min-width: 12.5rem;
  padding: 0.6rem 0.75rem;
  border: 0.06rem solid #ddd;
  border-radius: 0.4rem;
  font-size: 1rem;
}

.buscador-row input[type="text"] {
  min-width: 25rem;
  padding: 0.6rem 0.75rem;
  border: 0.06rem solid #ddd;
  border-radius: 0.4rem;
  font-size: 1rem;
}

.btn-buscar {
  background: #ff9800;
  color: #fff;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 0.4rem;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.precio-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
}

.precio-group select,
.precio-group input[type="text"] {
  min-width: 7.5rem;
  padding: 0.5rem 0.6rem;
  border: 0.06rem solid #ddd;
  border-radius: 0.4rem;
  font-size: 1rem;
}

.precio-group label {
  font-size: 0.95rem;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Estilos para resaltado de búsqueda */
.resaltado-busqueda {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
  border: 2px solid #ffc107;
  transition: all 0.3s ease;
}

/* Mensaje de búsqueda sin resultados */
.mensaje-busqueda {
  grid-column: 1 / -1;
  width: 100%;
  margin: 20px 0;
}

.mensaje-busqueda h3 {
  color: #666;
  margin-bottom: 10px;
}

.mensaje-busqueda p {
  color: #999;
  font-size: 1rem;
}

/* Galería de terrenos */
#terrenos h2 {
  text-align: left;
  font-size: 2rem;
  color: #000000;
  margin: 0.6rem 0;
  position: relative;
  padding: 1.25rem;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.6rem, 1fr));
  gap: 1.25rem;
}

.linea-decorativa {
  width: 80%;
  height: 0.3rem;
  background-color: var(--primary);
  margin: 5% auto;
  border-radius: 0.3rem;
}

.card {
  background: #fff;
  border-radius: 0.6rem;
  overflow: hidden;
  box-shadow: 0 0.1rem 0.5rem rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-0.3rem);
}

.card img {
  width: 100%;
  height: 11.25rem;
  object-fit: cover;
}

.card h3 {
  margin: 0.6rem;
  font-size: 1.2rem;
  color: #333;
  text-align: center;
}

.card p {
  margin: 0 0.6rem 0.9rem;
  font-size: 0.95rem;
  color: #666;
}

.card .precio {
  font-weight: bold;
  font-size: 1.1rem;
  color: #27ae60;
  text-align: center;
  margin: 0.6rem;
}

.card .card-actions {
  padding: 0.9rem;
  text-align: center;
}

.card .btn-comprar {
  width: 100%;
  padding: 0.75rem;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 0.4rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card .btn-comprar:hover {
  background: #229954;
  transform: translateY(-0.1rem);
  box-shadow: 0 0.25rem 0.75rem rgba(39, 174, 96, 0.3);
}

/* Secciones */
.section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 3.1rem 1.25rem;
  flex-wrap: wrap;
  background-color: #f2f2f2bb;
  border-radius: 0.9rem;
  margin: 1.9rem 1.25rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.304);
}

.cardd, .texto {
  flex: 1 1 25rem;
  max-width: 31.25rem;
}

.imagen {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.6rem rgba(0,0,0,0.15);
}

.texto h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.texto p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.texto a {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background-color: #f3a530;
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: bold;
  transition: background 0.3s ease;
}

.texto a:hover {
  background-color: #d58f22;
}

/* Modal para imagen ampliada */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  padding-top: 3.75rem;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-contenido {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80%;
  border-radius: 0.6rem;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

#caption {
  text-align: center;
  color: white;
  padding: 0.6rem;
  font-size: 1.1rem;
}

.cerrar {
  position: absolute;
  top: 1.25rem;
  right: 2.2rem;
  color: white;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
}

/* Botón scroll to home */
.scrollToHome {
  border-radius: 20px;
  background: linear-gradient(135deg, #f49d32, #ff6b35);
  bottom: 20px;
  color: #ffffff;
  display: none;
  font-size: 20px;
  height: 55px;
  line-height: 55px;
  padding: 0;
  position: fixed;
  right: 20px;
  text-align: center;
  width: 55px;
  z-index: 99999;
  box-shadow: 0 8px 25px rgba(244, 157, 50, 0.4);
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease-in-out;
}

.scrollToHome:hover {
  transform: translateY(-3px) scale(1.05);
  background: linear-gradient(135deg, #ff6b35, #e8890b);
  box-shadow: 0 12px 35px rgba(244, 157, 50, 0.6);
  color: #ffffff;
}

.scrollToHome:active {
  transform: translateY(-1px) scale(1.02);
  transition: all 0.1s ease;
}


/* Botón flotante de WhatsApp (para asegurar comportamiento en Terrenos) */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: white;
}

.whatsapp-float:hover {
  background-color: #20b954;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
}



/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

footer p {
    margin: 0 0 15px 0;
    font-size: 1rem;
    font-weight: 400;
}

.redes-sociales {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.redes-sociales a {
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
}

.redes-sociales a:hover {
    color: var(--primary);
    background: rgba(251, 159, 46, 0.1);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(251, 159, 46, 0.3);
}



/* Estilos para el carrusel de Chorrillos */
.carrusel-chorrillos {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.carrusel-container {
  position: relative;
  width: 100%;
  height: 18.75rem;
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.625rem rgba(0,0,0,0.15);
}

.carrusel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.carrusel-slide.active {
  opacity: 1;
}

.carrusel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.75rem;
}

.carrusel-indicadores {
  text-align: center;
  margin-top: 0.9375rem;
}

.indicador {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  background: #ccc;
  border-radius: 50%;
  margin: 0 0.3125rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.indicador.active {
  background: var(--primary);
}

.indicador:hover {
  background: #999;
}

/* Clases para funcionalidades dinámicas de terrenos */
.modal-visible {
  display: block !important;
}

/* Asegurar que el modal de compra se centre incluso con .modal-visible */
.modal-compra.modal-visible {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Responsividad */
@media (max-width: 50rem) {
  .buscador-row,
  .precio-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .buscador-row select,
  .buscador-row input[type="text"] {
    min-width: auto;
    width: 100%;
  }
  
  .galeria {
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    gap: 0.9rem;
  }
  
  .container {
    width: 90%;
  }
}

@media (max-width: 48rem) {
  /* Navegación móvil */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.533);
    padding: 1.9rem 1.25rem;
    transition: right 0.6s ease;
    z-index: 1000;
  }

  nav.show {
    right: 0;
  }

  .menu-toggle {
    display: block;
    position: fixed;
    top: 1.6rem;
    right: 0.75rem;
    z-index: 1101;
    font-size: 2rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
  }

  body.menu-abierto {
    overflow: hidden;
  }

  nav ul {
    flex-direction: column;
    gap: 1.25rem;
  }
  
  /* Buscador móvil */
  .buscador-inmuebles {
    padding: 1.25rem 0 0.9rem 0;
  }
  
  .buscador-inmuebles h1 {
    font-size: 1.5rem;
    margin-bottom: 0.9rem;
  }
  
  .buscador-form {
    padding: 0 1.2rem;
  }
  
  /* Galería móvil */
  .galeria {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 0 0.6rem;
  }
  
  #terrenos h2 {
    font-size: 1.5rem;
    padding: 0.9rem;
  }
  
  .container {
    width: 95%;
  }

  .section, .section.reverse {
    flex-direction: column;
    text-align: center;
    margin: 1.25rem 0.6rem;
    padding: 1.9rem 0.9rem;
  }
  
  .cardd, .texto {
    max-width: 100%;
    width: 100%;
  }
  
  .carrusel-chorrillos {
    max-width: 100%;
    width: 100%;
  }

  .carrusel-container {
    height: 15.625rem;
  }
  
  .carrusel-chorrillos {
    max-width: 100%;
    width: 100%;
    margin-bottom: 0;
  }
  
  .carrusel-indicadores {
    margin-top: 0.625rem;
    margin-bottom: 0;
  }

  .scrollToHome {
    width: 50px;
    height: 50px;
    font-size: 18px;
    line-height: 50px;
    border-radius: 18px;
    bottom: 18px;
    right: 18px;
  }
}

/* Footer responsivo */
@media (max-width: 768px) {
    footer {
        padding: 25px 15px;
    }
    
    footer p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .redes-sociales {
        gap: 15px;
    }
    
    .redes-sociales a {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    

}

/* Footer para móviles pequeños */
@media (max-width: 480px) {
    footer {
        padding: 20px 10px;
    }
    
    footer p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .redes-sociales {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .redes-sociales a {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    

}

@media (max-width: 30rem) {
  /* Header pequeño */
  .logo {
    height: 3.1rem;
  }
  
  header.shrink .logo {
    height: 2.2rem;
  }
  
  /* Buscador pequeño */
  .buscador-inmuebles h1 {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
  }
  
  .buscador-form {
    padding: 0 0.3rem;
  }
  
  .btn-buscar {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .precio-group select,
  .precio-group input[type="text"] {
    min-width: 6.25rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
  }
  
  /* Galería pequeña */
  .galeria {
    padding: 0 0.3rem;
    gap: 0.6rem;
  }
  
  .card {
    margin: 0 0.3rem;
  }
  
  .card h3 {
    font-size: 1rem;
    margin: 0.5rem;
  }

  .card p {
    font-size: 0.85rem;
    margin: 0 0.5rem 0.75rem;
  }
  
  .card img {
    height: 9.4rem;
  }

  .modal-contenido {
    max-width: 95%;
  }
  
  #terrenos h2 {
    font-size: 1.3rem;
    padding: 0.6rem;
  }
  
  .container {
    width: 98%;
  }

  .section {
    margin: 0.9375rem 0.3125rem;
    padding: 1.25rem 0.625rem;
    gap: 0.9375rem;
  }
  
  .carrusel-container {
    height: 12.5rem;
  }
  
  .carrusel-chorrillos {
    max-width: 100%;
    width: 100%;
    margin-bottom: 0;
  }
  
  .carrusel-indicadores {
    margin-top: 0.5rem;
    margin-bottom: 0;
  }
  
  .texto {
    margin-top: 0;
    padding-top: 0;
  }
  
  .texto h2 {
    font-size: 1.5rem;
    margin-top: 0;
  }
  
  .texto p {
    font-size: 1rem;
  }
}

@media (max-width: 22.5rem) {
  .buscador-inmuebles {
    padding: 0.9375rem 0 0.625rem 0;
  }
  
  .buscador-inmuebles h1 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  
  .galeria {
    padding: 0 0.125rem;
    gap: 0.5rem;
  }
  
  .card {
    margin: 0 0.125rem;
  }
  
  .card img {
    height: 8.125rem;
  }
  
  .section {
    margin: 0.625rem 0.125rem;
    padding: 0.9375rem 0.5rem;
    gap: 0.625rem;
  }
  
  .carrusel-container {
    height: 11.25rem;
  }
  
  .carrusel-indicadores {
    margin-top: 0.3125rem;
    margin-bottom: 0;
  }
  
  .texto h2 {
    font-size: 1.3rem;
  }
  
  .texto p {
    font-size: 0.9rem;
  }
  
  .container {
    width: 99%;
  }
}

@media (max-width: 480px) {
  .scrollToHome {
    width: 45px;
    height: 45px;
    font-size: 16px;
    line-height: 45px;
    border-radius: 15px;
    bottom: 15px;
    right: 15px;
  }

  .scrollToHome:hover {
    transform: translateY(-2px) scale(1.03);
  }
}

/* CALCULADORA DE FINANCIAMIENTO */
.calculadora-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 2.5rem 1.25rem;
  margin: 2.5rem 0;
  border-radius: 0.9rem;
  box-shadow: 0 0.6rem 1.9rem rgba(0,0,0,0.1);
}

.calculadora-section h2 {
  text-align: center;
  color: #333;
  margin-bottom: 0.6rem;
  font-size: 2.2rem;
}

.calculadora-section p {
  text-align: center;
  color: #666;
  margin-bottom: 1.9rem;
  font-size: 1.1rem;
}

.calculadora-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  max-width: 62.5rem;
  margin: 0 auto;
}

.calculadora-inputs {
  background: white;
  padding: 1.9rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.3rem 0.9rem rgba(0,0,0,0.08);
}

.input-group {
  margin-bottom: 1.6rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 0.125rem solid #e1e5e9;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: #f99109;
}

.input-group input[type="range"] {
  padding: 0;
  height: 0.5rem;
  background: #e1e5e9;
  border-radius: 0.25rem;
}

#cuota-inicial-valor {
  display: inline-block;
  margin-left: 0.6rem;
  font-weight: bold;
  color: #f99109;
}

.btn-calcular {
  width: 100%;
  background: linear-gradient(135deg, #f99109 0%, #d87e07 100%);
  color: white;
  border: none;
  padding: 0.9rem;
  border-radius: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-calcular:hover {
  transform: translateY(-0.125rem);
}

.calculadora-resultados {
  background: white;
  padding: 1.9rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.3rem 0.9rem rgba(0,0,0,0.08);
}

.calculadora-resultados h3 {
  text-align: center;
  margin-bottom: 1.6rem;
  color: #333;
}

.resultado-item {
  display: flex;
  justify-content: space-between;
  padding: 0.9rem 0;
  border-bottom: 0.06rem solid #f0f0f0;
}

.resultado-item.total {
  border-bottom: none;
  font-weight: bold;
  font-size: 1.2rem;
  color: #f99109;
  border-top: 0.125rem solid #f99109;
  margin-top: 0.6rem;
  padding-top: 1.25rem;
}



/* MODAL DE COMPRA */
.modal-compra {
  /* Centrado robusto usando grid para evitar desplazamientos laterales */
  display: grid;
  place-items: center;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  animation: modalFadeIn 0.3s ease-out;
}

.modal-compra-content {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  width: 480px;
  max-width: 95%;
  max-height: 90vh;
  position: relative;
  animation: slideIn 0.3s ease;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Garantiza centrado incluso si grid no aplica por alguna razón */
  margin-left: auto;
  margin-right: auto;
}

.modal-compra-header {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  padding: 20px 24px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-compra-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

/* Botón de cierre en header del modal de compra */
.close-compra {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
}

.close-compra:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.08);
}

.modal-compra-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.terreno-seleccionado {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  border-left: 4px solid #27ae60;
}

.terreno-seleccionado h3 {
  margin: 0 0 12px 0;
  color: #2c3e50;
  font-size: 16px;
  font-weight: 600;
}

.terreno-info p {
  margin: 6px 0;
  color: #555;
  font-size: 14px;
}

.datos-contacto-titulo h3 {
  margin: 8px 0 0;
  color: #333;
  font-size: 1rem;
  text-align: center;
}

.form-compra { flex: 1; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #27ae60;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.btn-cancelar,
.btn-enviar-compra {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.btn-cancelar {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.btn-cancelar:hover {
  background: #e0e0e0;
  color: #333;
}

.btn-enviar-compra {
  background: #27ae60;
  color: white;
}

.btn-enviar-compra:hover {
  background: #219a52;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Animación específica del modal de compra */
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .modal-compra-content {
    margin: 10% auto;
    width: 95%;
    height: auto;
    max-height: 90vh;
  }
  
  .modal-compra-body {
    padding: 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Clases para funcionalidades dinámicas de terrenos */
.modal-visible {
  display: block !important;
}

.search-no-results {
  text-align: center;
  padding: 40px;
  color: #666;
}

.search-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

@media (max-width: 480px) {
  .scrollToHome {
    width: 45px;
    height: 45px;
    font-size: 16px;
    line-height: 45px;
    border-radius: 15px;
    bottom: 15px;
    right: 15px;
  }

  .scrollToHome:hover {
    transform: translateY(-2px) scale(1.03);
  }
}

/* ESTILOS PARA MODALES */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: slideIn 0.3s;
}

.modal-large {
  max-width: 900px;
}

.modal-header {
  background: linear-gradient(135deg, #f99109 0%, #d87e07 100%);
  color: white;
  padding: 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.3s;
}

.close:hover {
  opacity: 0.7;
}

.modal-body {
  padding: 30px;
}



/* Estilos para modal de comparación */
.tabla-comparacion {
  overflow-x: auto;
}

.tabla-comparacion table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.tabla-comparacion th,
.tabla-comparacion td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.tabla-comparacion th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.comparacion-img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.comparacion-precio {
  color: #f99109;
  font-weight: bold;
  font-size: 1.1rem;
}

/* Estilos para modal de detalles */
.detalle-contenido {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.detalle-imagen img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
}

.detalle-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.detalle-precio {
  font-size: 2rem;
  font-weight: bold;
  color: #f99109;
}

.detalle-ubicacion,
.detalle-area {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-size: 1.1rem;
}

.detalle-descripcion {
  color: #333;
  line-height: 1.6;
}

.detalle-acciones {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.btn-contactar,
.btn-favorito-modal {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-contactar {
  background: #25d366;
  color: white;
}

.btn-contactar:hover {
  background: #20b954;
}





/* Responsive para modales */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .detalle-contenido {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .detalle-acciones {
    flex-direction: column;
  }
  
  .tabla-comparacion {
    font-size: 0.9rem;
  }
  
  .comparacion-img {
    width: 80px;
    height: 60px;
  }
}
