/* =========================================
   RESET Y ESTILOS GENERALES
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #fff;
    color: #333;
}

/* =========================================
   HEADER - MENÚ PRINCIPAL
========================================= */

header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 80px;
    background: rgb(255, 255, 255);
    backdrop-filter: blur(12px);
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
}

/* =========================================
   LOGO
========================================= */

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 55px;
}

.logo h2 {
    color: #167d36;
}

.logo p {
    font-size: 13px;
    color: #666;
}

/* =========================================
   MENÚ PRINCIPAL
========================================= */

nav {
    display: flex;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 15px;
}

nav ul li {
    position: relative;
}

nav ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #167d36;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 30px;
    transition: all .35s ease;
}

nav ul li a:hover {
    background: #167d36;
    color: #fff;
    box-shadow: 0 8px 20px rgba(22, 125, 54, .25);
    transform: translateY(-2px);
}

nav ul li a:hover svg {
    fill: #fff;
}

/* =========================================
   DROPDOWN
========================================= */

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    list-style: none;
    padding: 8px 0;
    display: none;
    z-index: 999;
}

.dropdown-content li {
    width: 100%;
}

.dropdown-content li a {
    display: block;
    color: #444;
    padding: 14px 20px;
    border-radius: 0;
    font-weight: 500;
    transition: .3s;
}

.dropdown-content li a:hover {
    background: #22b455;
    color: #fff;
    transform: none;
    box-shadow: none;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: menuFade .25s ease;
}

/* =========================================
   ANIMACIÓN DEL MENÚ
========================================= */

@keyframes menuFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   SECCIÓN 1 - BANNER PRINCIPAL
========================================= */

.section_1 {
    height: 100vh;
    background-image: url('../img/7.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Capa oscura sobre la imagen de fondo del eslogan, para que el texto siempre se lea */
.section_1.tiene-fondo {
    position: relative;
}

.section_1.tiene-fondo::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.section_1.tiene-fondo .overlay {
    position: relative;
    z-index: 2;
}

.overlay {
    background: rgba(255, 255, 255, 0.058);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    color: white;
    text-shadow: -6px 6px 12px rgba(0, 0, 0, .55);
    padding: 20px;
}

.overlay h1 {
    font-size: 70px;
    margin-bottom: 20px;
    text-shadow: -4px 4px 8px rgba(0, 0, 0, .5);
}

.overlay p {
    font-size: 24px;
    margin-bottom: 40px;
    text-shadow: -4px 4px 8px rgba(0, 0, 0, .5);
    background: rgba(0, 0, 0, .55);
    border-radius: 20px;
    padding: 0px 20px 0px 20px;
}

.btn {
    padding: 18px 45px;
    background: #167d36;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    transition: .4s;
}

.btn:hover {
    background: #0f5c29;
}

/* =========================================
   SECCIONES CON FONDO
========================================= */

.section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px;
    color: white;
}

.section_2 {
    background: url('../img/5.jpg');
    background-size: cover;
    background-attachment: fixed;
}

.section_3 {
    background: url('../img/6.jpg');
    background-size: cover;
    background-attachment: fixed;
}

.section_4 {
    background: url('../img/9.jpg');
    background-size: cover;
    background-attachment: fixed;
}

.contenido {
    background: rgba(0, 0, 0, .55);
    padding: 60px;
    border-radius: 20px;
    max-width: 900px;
}

.contenido h2 {
    font-size: 45px;
    margin-bottom: 25px;
}

.contenido p {
    font-size: 20px;
    line-height: 35px;
}

/* =========================================
   SERVICIOS
========================================= */

.servicios {
    display: flex;
    gap: 35px;
    margin-top: 40px;
}

.servicio {
    background: white;
    color: #222;
    padding: 30px;
    border-radius: 15px;
    flex: 1;
    transition: .4s;
}

.servicio:hover {
    transform: translateY(-10px);
}

/* =========================================
   SECCIÓN DE INMUEBLES - CORREGIDA
========================================= */

.inmuebles {
    padding: 120px 5%;
    background: #f4f9f5;
}

.titulo-seccion {
    text-align: center;
    margin-bottom: 60px;
}

.titulo-seccion h2 {
    font-size: 45px;
    color: #167d36;
    margin-bottom: 15px;
}

.titulo-seccion p {
    font-size: 18px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================
   CONTENEDOR DE INMUEBLES
========================================= */

#contenedor-inmuebles {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 300px;
}

/* =========================================
   GRID DE CARDS
========================================= */

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 20px 0;
}

/* =========================================
   CADA CARD
========================================= */

.card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .12);
    transition: all 0.4s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, .2);
}

.card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

/* =========================================
   INFORMACIÓN DE LA CARD - TEXTO EN NEGRO
========================================= */

.card .info {
    padding: 25px 30px 30px;
    background: #ffffff;
}

.card .info h3 {
    color: #167d36;
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}

.card .info p {
    color: #333333;
    margin-bottom: 5px;
    font-size: 15px;
}

.card .info p strong {
    color: #555555;
}

.card .info h4 {
    color: #167d36;
    font-size: 22px;
    font-weight: 700;
    margin: 10px 0 5px 0;
}

.card .info button {
    padding: 12px 35px;
    background: #167d36;
    border: none;
    color: #ffffff;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.card .info button:hover {
    background: #0f5c29;
    transform: scale(1.05);
}

/* =========================================
   ESTADO DE CARGA
========================================= */

.cargando {
    text-align: center;
    padding: 60px 20px;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #167d36;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   MENSAJES DE ERROR Y SIN INMUEBLES
========================================= */

.error-mensaje,
.sin-inmuebles {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.error-mensaje p {
    color: #c0392b;
    font-size: 18px;
    margin-bottom: 20px;
}

.error-mensaje button {
    padding: 12px 40px;
    background: #167d36;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.error-mensaje button:hover {
    background: #0f5c29;
    transform: scale(1.05);
}

.sin-inmuebles p {
    color: #666;
    font-size: 20px;
}

/* =========================================
   VISTA LISTA - PROPIEDAD EN LISTA
========================================= */

.propiedad-lista {
    display: flex;
    gap: 30px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .12);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.propiedad-lista:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, .2);
}

.propiedad-lista .imagen {
    flex: 0 0 300px;
    height: 250px;
    overflow: hidden;
}

.propiedad-lista .imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.propiedad-lista:hover .imagen img {
    transform: scale(1.05);
}

.propiedad-lista .detalle {
    flex: 1;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.propiedad-lista .detalle h2 {
    color: #167d36;
    font-size: 24px;
    margin-bottom: 10px;
}

.propiedad-lista .detalle p {
    color: #333333;
    margin-bottom: 5px;
    font-size: 15px;
}

.propiedad-lista .detalle h3 {
    color: #167d36;
    font-size: 28px;
    margin: 15px 0;
}

.propiedad-lista .detalle button {
    align-self: flex-start;
    padding: 12px 40px;
    background: #167d36;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.propiedad-lista .detalle button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(22, 125, 54, 0.4);
}

/* =========================================
   SELECTOR DE VISTA (GRID / LISTA)
========================================= */

.vista-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.vista-btn {
    padding: 12px 30px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
}

.vista-btn:hover {
    background: #e0e0e0;
}

.vista-btn.active {
    background: #167d36;
    color: #ffffff;
    border-color: #167d36;
    box-shadow: 0 5px 15px rgba(22, 125, 54, 0.3);
}

/* =========================================
   ICONOS HORIZONTALES EN LAS CARDS
========================================= */

.card .info .iconos {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.card .info .iconos span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
    font-size: 14px;
}

/* =========================================
   FOOTER
========================================= */

footer {
    padding: 40px 30px;
    text-align: center;
}

/* =========================================
   FOOTER DINAMICO
========================================= */

.pie-contenido {
    max-width: 1100px;
    margin: 0 auto;
}

.pie-columnas {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 40px;
    text-align: center;
    justify-items: center;
    padding-bottom: 30px;
}

.pie-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pie-col h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.pie-col h4 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: .75;
    margin-bottom: 16px;
}

.pie-descripcion {
    opacity: .85;
    font-size: 14px;
    line-height: 22px;
    max-width: 300px;
    margin: 0 auto 20px;
}

.pie-enlace {
    display: block;
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    opacity: .85;
    margin-bottom: 12px;
    transition: opacity .25s, transform .25s;
}

.pie-enlace:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.pie-dato {
    font-size: 14px;
    opacity: .85;
    margin-bottom: 12px;
    line-height: 20px;
}

.pie-redes {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.pie-redes a {
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    opacity: .95;
    transition: background .25s, transform .25s;
}

.pie-redes a:hover {
    background: rgba(255, 255, 255, .3);
    transform: translateY(-3px);
}

.pie-linea {
    height: 1px;
    background: rgba(255, 255, 255, .2);
    margin-bottom: 20px;
}

.pie-copyright {
    text-align: center;
    font-size: 13px;
    opacity: .75;
}

/* =========================================
   BOTON FLOTANTE DE WHATSAPP
========================================= */

.wsp-flotante {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    z-index: 1000;
    animation: wsp-pulso 2.2s infinite;
    transition: transform .25s;
}

.wsp-flotante:hover {
    transform: scale(1.08);
}

@keyframes wsp-pulso {
    0% { box-shadow: 0 8px 24px rgba(0, 0, 0, .25), 0 0 0 0 rgba(37, 211, 102, .5); }
    70% { box-shadow: 0 8px 24px rgba(0, 0, 0, .25), 0 0 0 14px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 8px 24px rgba(0, 0, 0, .25), 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 480px) {
    .wsp-flotante {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
    }
}

/* =========================================
   RESPONSIVE - TABLETS
========================================= */

@media (max-width: 992px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .propiedad-lista {
        flex-direction: column;
    }

    .propiedad-lista .imagen {
        flex: 0 0 200px;
        height: 200px;
    }
}

/* =========================================
   RESPONSIVE - CELULARES
========================================= */

@media (max-width: 768px) {
    header {
        padding: 20px;
        flex-direction: column;
        height: auto;
    }

    nav {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul {
        flex-direction: column;
        gap: 5px;
    }

    .dropdown-content {
        position: static;
        display: block;
        box-shadow: none;
        background: transparent;
        padding-left: 20px;
    }

    .overlay h1 {
        font-size: 40px;
    }

    .overlay p {
        font-size: 18px;
    }

    .servicios {
        flex-direction: column;
    }

    .section {
        height: auto;
        padding: 120px 20px;
    }

    .inmuebles {
        padding: 80px 15px;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px 0;
    }

    #contenedor-inmuebles {
        padding: 0 5px;
    }

    .card .info {
        padding: 20px;
    }

    .card img {
        height: 200px;
    }

    .propiedad-lista .detalle {
        padding: 20px;
    }

    .propiedad-lista .detalle h2 {
        font-size: 20px;
    }

    .propiedad-lista .detalle h3 {
        font-size: 22px;
    }

    .vista-selector {
        flex-wrap: wrap;
        gap: 10px;
    }

    .vista-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .pie-columnas {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
    }

    .pie-descripcion {
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }

    .pie-redes {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .overlay h1 {
        font-size: 30px;
    }

    .overlay p {
        font-size: 16px;
        padding: 0 10px;
    }

    .btn {
        padding: 14px 30px;
        font-size: 16px;
    }

    .contenido {
        padding: 30px 20px;
    }

    .contenido h2 {
        font-size: 30px;
    }

    .contenido p {
        font-size: 16px;
        line-height: 28px;
    }

    .titulo-seccion h2 {
        font-size: 30px;
    }

    .card .info h3 {
        font-size: 18px;
    }

    .card .info h4 {
        font-size: 20px;
    }

    .propiedad-lista .detalle h2 {
        font-size: 18px;
    }
}