/* ===== RESETEO BÁSICO Y VARIABLES ===== */
:root {
    /* Colores Corporativos (NUEVOS) */
    --color-primario: #002868;   /* Azul oscuro: rgb(0, 40, 104) */
    --color-secundario: #436ba7; /* Azul medio: rgb(67, 107, 167) */
    --color-acento: #aa8a67;     /* Marrón claro: rgb(170, 138, 103) */
    --color-fondo: #ffffff;
    --color-texto: #333333;      /* Mantenemos un gris oscuro para texto por legibilidad */
    --color-texto-claro: #f5f5f5;

    /* Fuentes */
    --fuente-titulos: 'Montserrat', sans-serif;
    --fuente-cuerpo: 'Lato', sans-serif;

    /* Estilos consistentes */
    --border-radius: 10px;
    --box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    --box-shadow-hover: 0 8px 25px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--fuente-cuerpo);
    color: var(--color-texto);
    background-color: var(--color-fondo);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--color-secundario);
}

ul {
    list-style: none;
}

h1, h2, h3, h4 {
    font-family: var(--fuente-titulos);
    font-weight: 700;
    color: var(--color-primario);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    padding: 4rem 0;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-family: var(--fuente-titulos);
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-acento);
    color: var(--color-fondo);
    border: 2px solid var(--color-acento);
}
.btn-primary:hover {
    background-color: #967859; /* Tono más oscuro del acento (marrón) */
    border-color: #967859;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-secundario);
    border: 2px solid var(--color-secundario);
}
.btn-secondary:hover {
    background-color: var(--color-secundario);
    color: var(--color-fondo);
}

/* ===== HEADER Y NAVEGACIÓN ===== */
.main-header {
    background-color: var(--color-fondo);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo a {
    font-family: var(--fuente-titulos);
    font-size: 1.25rem;
    color: var(--color-primario);
    display: block; /* Para que los logos se apilen bien */
}
.logo-img {
    max-height: 60px; /* Ajusta la altura de tu logo */
    width: auto;
}

/* Lógica de logos: Ocultar el móvil por defecto */
.logo-mobile {
    display: none;
}
.logo-desktop {
    display: block;
}


.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu-item {
    margin-left: 1.5rem;
}

.nav-menu-link {
    color: var(--color-primario);
    font-family: var(--fuente-titulos);
    font-weight: 600;
    padding: 0.5rem;
    position: relative;
}

.nav-menu-link:hover, .nav-menu-link.active {
    color: var(--color-secundario);
}

.nav-menu-link.nav-link-button {
    background-color: var(--color-acento);
    color: var(--color-fondo);
    padding: 0.5rem 1rem;
    border-radius: 5px;
}
.nav-menu-link.nav-link-button:hover {
    background-color: #967859; /* Tono más oscuro del acento */
    color: var(--color-fondo);
}

.nav-toggle {
    display: none; /* Oculto en desktop */
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--color-primario);
    cursor: pointer;
}

/* ===== HERO SECTION ===== */
.hero {
    /* Superposición actualizada al nuevo color primario */
    background: linear-gradient(rgba(0, 40, 104, 0.8), rgba(0, 40, 104, 0.8)), url(https://via.placeholder.com/1920x1080.png?text=Finca+en+Caicedonia) no-repeat center center/cover;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-texto-claro);
}

.hero h1 {
    color: var(--color-fondo);
    font-size: 3rem;
}
.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
}

.search-filters select, .search-filters button {
    padding: 0.75rem 1rem;
    font-family: var(--fuente-cuerpo);
    font-size: 1rem;
    border: none;
    border-radius: 5px;
}

.search-filters select {
    min-width: 200px;
    color: var(--color-texto);
}

.search-filters button {
    background-color: var(--color-acento);
    color: var(--color-fondo);
    cursor: pointer;
}

/* ===== FEATURED PROJECTS (INMUEBLES) ===== */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.featured-card {
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative; /* Para las etiquetas */
}
.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

/* Contenedor para la imagen para forzar proporción */
.card-image-container {
    width: 100%;
    aspect-ratio: 4 / 3; /* Proporción 4:3 */
    overflow: hidden;
    background-color: #eee;
}

.featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-card:hover img {
    transform: scale(1.05);
}

.featured-card .card-content {
    padding: 1.5rem;
}

.featured-card h3 {
    color: var(--color-secundario); /* Azul medio */
    font-size: 1.25rem;
    /* Acortar texto si es muy largo */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-acento); /* Marrón claro */
    margin-bottom: 0.5rem;
}
.card-details {
    display: flex;
    flex-wrap: wrap; 
    gap: 1.2rem; /* Más separación */
    margin: 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #555;
}
.card-details span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.card-details i {
    color: var(--color-primario);
}

/* Etiqueta para TIPO de inmueble (Ej. Finca) */
.card-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--color-primario); /* Azul oscuro */
    color: var(--color-fondo);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-family: var(--fuente-titulos);
    font-weight: 600;
    z-index: 2;
}

/* Estilos para cuando el inmueble está VENDIDO */
.featured-card.is-sold {
    opacity: 0.8;
}

/* Letrero de "VENDIDO" */
.card-status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 40, 104, 0.7); /* Fondo azul oscuro (nuevo) */
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-family: var(--fuente-titulos);
    font-weight: 700;
    z-index: 3;
    opacity: 0; /* Oculto por defecto */
    transition: opacity 0.3s ease;
    /* La imagen de fondo no se agranda */
    transform: scale(1.01); 
}
.featured-card.is-sold .card-status-overlay {
    opacity: 1;
}

/* ===== ABOUT US (QUIÉNES SOMOS) ===== */
.about-us {
    background-color: #f9f9f9;
}
.about-us .container {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.about-content {
    flex: 1;
    min-width: 300px;
}

.about-image {
    flex: 1;
    min-width: 300px;
}

.about-image img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* ===== WHY INVEST (POR QUÉ INVERTIR) ===== */
.why-invest {
    text-align: center;
}
.why-invest .subtitle {
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    font-size: 1.1rem;
}
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.reason-item {
    padding: 1.5rem;
}
.reason-item i {
    font-size: 3rem;
    color: var(--color-secundario); /* Azul medio */
    margin-bottom: 1rem;
}

/* ===== SERVICES (SERVICIOS ADICIONALES) ===== */
.services {
    background-color: var(--color-primario); /* Azul oscuro */
    color: var(--color-texto-claro);
    text-align: center;
}
.services h2 {
    color: var(--color-fondo);
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.service-item i {
    font-size: 2.5rem;
    color: var(--color-acento); /* Marrón claro (mejor contraste que azul medio) */
    margin-bottom: 1rem;
}
.service-item h3 {
    color: var(--color-fondo);
}

/* ===== FOOTER ===== */
.main-footer {
    background-color: var(--color-primario); /* Azul oscuro */
    color: var(--color-texto-claro);
    padding-top: 3rem;
}
.main-footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.footer-col h3 {
    color: var(--color-acento); /* Marrón claro (mejor contraste) */
    margin-bottom: 1.5rem;
}
.footer-col p {
    margin-bottom: 0.5rem;
}
.footer-col a {
    color: var(--color-texto-claro);
    transition: color 0.3s ease;
}
.footer-col a:hover {
    color: var(--color-acento); /* Marrón claro (mejor contraste) */
}
.social-links a {
    font-size: 1.5rem;
    margin-right: 1rem;
}
.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================================= */
/* ===== PÁGINA DE INMUEBLE (INMUEBLE.PHP) ===== */
/* ============================================= */
.property-container { 
    padding: 4rem 0; 
}
.property-layout { 
    display: grid; 
    grid-template-columns: 3fr 2fr; /* 60% Galería, 40% Detalles */
    gap: 2.5rem; 
    margin-top: 2rem; 
    align-items: start; 
}
.property-gallery { 
    position: relative; 
    width: 100%;
    min-height: 400px; /* Asegura un espacio mínimo */
}
.property-details { 
    background: #fdfdfd; 
    padding: 2rem; 
    border-radius: var(--border-radius); 
    border: 1px solid #eee; 
    position: sticky; 
    top: 100px; /* 80px del header + 20px de espacio */
    box-shadow: var(--box-shadow);
}
.property-details h1 { 
    color: var(--color-primario); 
    font-size: 2.5rem; 
    margin-bottom: 0.5rem; 
    line-height: 1.2; 
}
.property-price { 
    font-size: 2.2rem; 
    font-weight: 700; 
    color: var(--color-acento); /* Marrón claro */
    margin-bottom: 1.5rem; 
}
.property-specs { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 1.5rem; 
    margin: 1.5rem 0; 
    padding: 1rem 0; 
    border-top: 1px solid #eee; 
    border-bottom: 1px solid #eee; 
    font-size: 1.1rem; 
    color: #555; 
}
.property-specs span { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; 
}
.property-specs i {
    color: var(--color-primario);
}
.property-description h3 { 
    color: var(--color-secundario); /* Azul medio */
    margin-bottom: 1rem; 
}
        
/* ==== INICIO DE LA CORRECCIÓN (REEMPLAZA TU CÓDIGO) ==== */

/* 1. Este es el NUEVO contenedor que SÍ está en tu inmueble.php */
.swiper-main-container {
    width: 100%;
    aspect-ratio: 4 / 3; /* Aquí va la proporción (desktop) */
    border-radius: var(--border-radius);
    overflow: hidden; /* Asegura que el swiper no se salga */
    background: #eee;
    margin-bottom: 10px;
    position: relative; /* Para el icono de enlarge */
}

/* 2. El Swiper AHORA solo ocupa el 100% de su padre (SIN 'aspect-ratio') */
.swiper-main { 
    width: 100%; 
    height: 100%;
    /* Se quitan todas las demás reglas de 'aspect-ratio', 'background', etc. */
}
/* ==== FIN DE LA CORRECCIÓN ==== */


.swiper-main .swiper-slide { 
    cursor: pointer; 
    text-align: center; 
    background: #f9f9f9; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}
/* El 'a' dentro del slide para Fancybox */
.swiper-main .swiper-slide a {
    display: block;
    width: 100%;
    height: 100%;
}
.swiper-main .swiper-slide img { 
    display: block; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}
.swiper-button-next, .swiper-button-prev { 
    color: var(--color-acento); 
}
.swiper-pagination-bullet-active { 
    background: var(--color-acento); 
}

/* Miniaturas */
.swiper-thumbs {
    height: 100px;
}
.swiper-thumbs .swiper-slide {
    width: 25%;
    height: 100%;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.3s ease;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid transparent;
}
.swiper-thumbs .swiper-slide:hover {
    opacity: 1;
}
.swiper-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border: 3px solid var(--color-acento); /* Marrón claro */
}
.swiper-thumbs .swiper-slide img {
    display: block; 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

/* Ajustado para que se posicione sobre el NUEVO contenedor */
.enlarge-icon { 
    position: absolute; 
    top: 1rem; 
    right: 1rem; 
    z-index: 10; 
    background: rgba(0, 0, 0, 0.5); 
    color: white; 
    padding: 0.75rem; 
    border-radius: 50%; 
    font-size: 1rem; 
    pointer-events: none; 
}
        

/* ============================================= */
/* ===== ESTILOS RESPONSIVOS (MOBILE) ===== */
/* ============================================= */

@media (max-width: 900px) { 
    /* Reglas para Tablet (Página Inmueble) */
    .property-layout { 
        grid-template-columns: 1fr; /* Apila las columnas */
        gap: 1.5rem; 
    } 
    .property-details { 
        position: static; /* Desactiva el "sticky" en tablet/móvil */
    } 
    
    /* ==== CAMBIO RESPONSIVE ==== */
    .swiper-main-container { 
        aspect-ratio: 16 / 9; /* Proporción para tablet */
    } 
}

@media (max-width: 768px) {
    /* AJUSTE DE TEXTO HERO */
    h1 { font-size: 2.0rem; } /* Reducido de 2.2rem */
    .hero h1 { font-size: 2.2rem; } /* Reducido de 2.5rem */

    /* ===== LÓGICA DE LOGO MÓVIL ===== */
    .logo-desktop {
        display: none; /* Oculta el logo grande */
    }
    .logo-mobile {
        display: block; /* Muestra el logo-icono */
        max-height: 50px; /* Ajusta la altura del icono */
    }

    /* ===== NAVEGACIÓN MÓVIL ===== */
    .nav {
        position: fixed;
        top: 80px; /* Debajo del header */
        left: 0;
        width: 100%;
        background-color: var(--color-fondo);
        transform: translateX(-100%);
        transition: transform 0.3s ease-out;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        z-index: 999; /* Asegura que esté sobre el contenido */
    }
    
    .nav.active {
        transform: translateX(0);
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-menu-item {
        margin: 0;
    }

    .nav-menu-link {
        display: block;
        padding: 1.5rem;
        text-align: center;
        border-bottom: 1px solid #eee;
    }

    .nav-menu-link.nav-link-button {
        margin: 1rem;
    }

    .nav-toggle {
        display: block; /* Muestra el botón de hamburguesa */
    }

    /* ===== OTROS AJUSTES MÓVILES ===== */
    .search-filters {
        flex-direction: column;
    }
    .search-filters select, .search-filters button {
        width: 100%;
    }

    .about-us .container {
        flex-direction: column;
    }
    /* Invierte el orden en la sección 'Por qué nosotros' */
    #por-que-nosotros .container {
        flex-direction: column-reverse;
    }
    .about-image {
        order: -1; /* Mueve la imagen arriba en móvil (Quiénes Somos) */
    }
    #por-que-nosotros .about-image {
        order: 0; /* Lo resetea para la segunda sección */
    }

    /* ===== RESPONSIVE PÁGINA INMUEBLE ===== */
    .property-container { padding: 2rem 0; } 
    .property-details h1 { font-size: 2rem; } 
    .property-price { font-size: 1.8rem; } 
    .property-specs { gap: 1rem; font-size: 1rem; } 
    .map-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    #map { 
        height: 300px; 
    } 
    
    /* ==== CAMBIO RESPONSIVE ==== */
    .swiper-main-container { 
        aspect-ratio: 16 / 9; /* Proporción para móvil */
    } 
    .swiper-thumbs { height: 80px; }
}

/* ================================================================
== ESTILOS PARA EL MAPA Y LA SECCIÓN ==
================================================================
*/
.map-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee; /* Separador visual */
}
.map-section h2 {
    margin-bottom: 1.5rem;
}
#map { 
    height: 400px; 
    width: 100%; 
    border-radius: var(--border-radius, 10px); 
    border: 1px solid #ddd; 
    z-index: 1; /* Asegura que se vea bien */
}