/* ==================== 1. TU CÓDIGO BASE (HEADER) ==================== */
body, html { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Figtree', sans-serif; overflow-x: hidden; background-color: #f8f9fa;}
#header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; background: transparent; display: flex; justify-content: center; align-items: center; padding: 15px 0; transition: background 0.3s ease, box-shadow 0.3s ease; height: 60px; }
#header.scrolled { background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); backdrop-filter: blur(5px); }
.header-content { display: flex; justify-content: space-between; align-items: center; width: 90%; max-width: 1200px; }
#logo img { height: 50px; }
#mainNav ul { display: flex; list-style: none; gap: 40px; }
#mainNav a { color: #fff; font-size: 18px; font-weight: 700; transition: color 0.3s ease; text-decoration: none; position: relative; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
#header.scrolled #mainNav a { color: #333; text-shadow: none; }
#mainNav a::after { content: ''; position: absolute; bottom: -8px; left: 0; width: 0; height: 2px; background-color: #890000; transition: width 0.3s ease; }
#mainNav a:hover::after, #mainNav a.active::after { width: 100%; }
.overlay-movil { height: 100%; width: 0; position: fixed; z-index: 2000; left: 0; top: 0; background-color: rgba(0,0,0, 0.95); overflow-x: hidden; transition: 0.5s; }
.overlay-movil-content { position: relative; top: 25%; width: 100%; text-align: center; margin-top: 30px; }
.overlay-movil a { padding: 8px; text-decoration: none; font-size: 36px; color: #818181; display: block; transition: 0.3s; }
.overlay-movil a:hover { color: #f1f1f1; }
.overlay-movil .closebtn { position: absolute; top: 20px; right: 45px; font-size: 60px; cursor: pointer; color: white; }
button-menu { display: none; font-size: 24px; color: #ffffff; background-color: #6f0000; border: none; padding: 10px 15px; border-radius: 5px; cursor: pointer; }
@media screen and (max-width: 800px) {
    /* Ocultar menú de escritorio */
    #mainNav { 
        display: none !important; 
        
    }
    
    /* Mostrar botón hamburguesa */
    button-menu { 
        display: block; 
    }

    /* --- ESTO ES LO NUEVO: LOGO MÁS PEQUEÑO --- */
    #logo img {
        height: 30px; /* Antes era 50px, ahora 35px en celular */
        transition: height 0.3s ease; /* Para que el cambio sea suave */
    }

    /* Opcional: Si quieres que la barra del menú sea un poco más delgada en celular */
    #header {
        height: 50px; 
        background: rgba(255, 255, 255, 1);
    }
}

/* ==================== 2. ESTILOS INMOBILIARIA ==================== */

.hero-inmobiliaria {
    position: relative;
    min-height: 100vh;
    height: auto;
    background-image: url('https://images.unsplash.com/photo-1560448204-e02f11c3d0e2?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-top: -80px;
    padding-top: 80px;
    padding-bottom: 0px;
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.6); /* Un poco más oscuro para leer mejor */
    width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 60px;
}

/* CAMBIO 1: Agregado margin-top para bajar el título */
.hero-overlay h1 { 
    font-size: 3rem; 
    margin-bottom: 20px; 
    margin-top: 60px; /* Aquí está el cambio */
    text-shadow: 0 2px 10px rgba(0,0,0,0.8); 
}

/* CAMBIO 2: Cuadro de descripción más ancho */
.descripcion-intro {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px; /* Más espacio interno */
    border-radius: 10px;
    max-width: 1200px; /* ANTES: 900px. AHORA: 1200px (Más ancho) */
    width: 95%; /* Ocupa casi todo el ancho en pantallas medianas */
    margin-bottom: 30px;
    text-align: left;
    color: #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.intro-texto { font-size: 1.1rem; line-height: 1.7; margin-bottom: 25px; }
.servicios-lista h3 { color: #890000; margin-bottom: 15px; font-size: 1.4rem; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.servicios-lista ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; } /* Lista en 2 columnas si cabe */
.servicios-lista li { margin-bottom: 8px; font-size: 1rem; display: flex; align-items: flex-start; }
.servicios-lista i { color: #27ae60; margin-right: 10px; margin-top: 5px; }

/* BUSCADOR */
.buscador-container {
    background: white; padding: 25px; border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 95%; max-width: 1200px; /* También lo hice más ancho para que coincida */
}
.grupo-inputs { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
select, .input-filtro {
    padding: 12px; border: 1px solid #ddd; border-radius: 5px;
    flex: 1; min-width: 180px; font-size: 1rem; color: #333;
}
#btn-buscar {
    background-color: #890000; color: white; border: none; padding: 12px 30px;
    border-radius: 5px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: background 0.3s;
}
#btn-buscar:hover { background-color: #5a0000; }

/* RESULTADOS */
.resultados-section { max-width: 1200px; margin: 50px auto; padding: 0 20px; }
.grid-propiedades { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; margin-top: 30px; }
.card {
    background: white; border-radius: 12px; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); transition: transform 0.3s ease;
    border: 1px solid #eee; display: flex; flex-direction: column; cursor: pointer;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.15); }
.card-img-container { height: 220px; position: relative; overflow: hidden; }
.card-img-container img { width: 100%; height: 100%; object-fit: cover; }
.badge-operacion {
    position: absolute; top: 15px; left: 15px; padding: 5px 12px;
    border-radius: 4px; color: white; font-weight: bold; font-size: 0.8rem; text-transform: uppercase;
}
.badge-venta { background-color: #27ae60; }
.badge-renta { background-color: #e67e22; }
.card-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-categoria { color: #7f8c8d; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.card-title { font-size: 1.2rem; color: #2c3e50; font-weight: 700; margin: 0 0 10px 0; }
.card-price { font-size: 1.4rem; color: #890000; font-weight: 800; margin-bottom: 10px; }
.card-location { color: #666; font-size: 0.9rem; margin-bottom: 15px; display: flex; align-items: center; gap: 5px; }
.card-features { display: flex; justify-content: space-between; border-top: 1px solid #f1f1f1; padding-top: 15px; color: #555; font-size: 0.9rem; }
.loading { width: 100%; text-align: center; padding: 40px; font-size: 1.2rem; color: #666; }

/* ==================== ESTILOS PÁGINA DETALLE (CAMBIO 3) ==================== */

.detalle-page { background-color: #f7f7f7; padding-top: 80px; }

.contenedor-detalle {
    max-width: 1200px; /* Un poco más ancho */
    margin: 20px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

/* Header del Detalle */
.detalle-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    border-bottom: 1px solid #eee; padding-bottom: 20px; margin-bottom: 30px;
}
.titulos h1 { margin: 0 0 10px 0; color: #333; font-size: 2.2rem; }
.ubicacion { color: #666; margin-bottom: 15px; font-size: 1.2rem; }
.etiquetas .tag { display: inline-block; padding: 6px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: bold; margin-right: 5px; }
.tag.gris { background: #eee; color: #555; }
.tag.rojo { background: #890000; color: white; }
.precio-bloque h2 { color: #890000; font-size: 2.5rem; margin: 0; font-weight: 800; }

/* CAMBIO 3 CLAVE: Grid Principal en Columna */
.detalle-grid { 
    display: flex; 
    flex-direction: column; /* ESTO PONE LA GALERÍA ARRIBA */
    gap: 40px; 
}
.col-galeria, .col-info { width: 100%; } /* Asegura que ocupen todo el ancho */

/* Galería (Ahora arriba) */
.imagen-principal-container {
    height: 500px; /* Más alta para que luzca arriba */
    background: #000; position: relative; border-radius: 8px; overflow: hidden;
}
.imagen-principal-container img { width: 100%; height: 100%; object-fit: contain; }
.btn-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.5); color: white; border: none; padding: 15px; cursor: pointer; font-size: 24px; transition: 0.3s;
}
.btn-nav:hover { background: rgba(0,0,0,0.8); }
.prev { left: 0; } .next { right: 0; }
.tira-miniaturas { display: flex; gap: 10px; margin-top: 15px; overflow-x: auto; padding-bottom: 5px; }
.tira-miniaturas img {
    width: 100px; height: 75px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.6; transition: 0.3s;
}
.tira-miniaturas img.active, .tira-miniaturas img:hover { opacity: 1; border: 2px solid #890000; }

/* Info (Ahora abajo) */
.features-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Se adapta mejor */
    gap: 15px; margin-bottom: 30px;
}
.feature-box {
    background: #f9f9f9; padding: 20px; border-radius: 8px; text-align: center;
    border: 1px solid #eee; transition: 0.3s;
}
.feature-box:hover { background: #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border-color: #ddd; }
.feature-box i { font-size: 1.8rem; color: #890000; display: block; margin-bottom: 10px; }
.feature-box span { font-weight: 800; font-size: 1.2rem; display: block; color: #333; }
.feature-box small { color: #777; font-size: 0.9rem; text-transform: uppercase; }

.extras-box {
    background: #fff3f3; padding: 25px; border-radius: 8px; border: 1px solid #ffcccc; margin-bottom: 30px;
}
.extras-box h3 { font-size: 1.2rem; color: #890000; margin-bottom: 10px; margin-top: 15px; }
.extras-box h3:first-child { margin-top: 0; }
.extras-box p { font-size: 1.1rem; color: #444; }

.descripcion-box h3 { border-bottom: 2px solid #890000; display: inline-block; margin-bottom: 15px; font-size: 1.5rem; color: #333; }
.descripcion-box p { line-height: 1.8; color: #555; margin-bottom: 40px; font-size: 1.1rem; white-space: pre-line; /* Respeta saltos de línea de la BD */ }

.btn-contacto-grande {
    display: block; background: #25D366; color: white; text-align: center; font-size: 1.3rem; font-weight: bold;
    padding: 20px; border-radius: 10px; text-decoration: none; transition: background 0.2s, transform 0.2s;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}
.btn-contacto-grande:hover { background: #1ebe57; transform: translateY(-3px); }
.btn-contacto-grande i { margin-right: 10px; font-size: 1.5rem; }

@media (max-width: 800px) {
    .hero-overlay h1 { font-size: 2rem; margin-top: 80px; }
    .descripcion-intro { padding: 25px; }
    .detalle-header { flex-direction: column; }
    .precio-bloque { margin-top: 15px; }
    .imagen-principal-container { height: 300px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- ESTILOS PARA SERVICIOS Y EXTRAS (TIPO CHIPS) --- */
.contenedor-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* CAMBIO: Pastillas (Chips) blancas con borde sutil y sombra */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff; /* Fondo blanco */
    color: #333;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600; /* Un poco más gordita la letra */
    border: 1px solid #e0e0e0; /* Borde gris claro */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Sombrita sutil */
    transition: all 0.2s ease;
}

.chip:hover {
    background-color: #f9fafb; /* Blanco apenas gris al pasar el mouse */
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.chip i {
    color: #343434; /* Iconos en tu color rojo corporativo para resaltar */
}

/* ... Títulos ... */
.titulo-detalle {
    font-size: 1.2rem;
    color: #890000;
    margin-top: 25px;
    margin-bottom: 5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* CAMBIO: El contenedor grande ahora es gris claro en vez de rojo */
.extras-box {
    background: #f8f9fa; /* Gris muy claro y limpio */
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef; /* Borde gris sutil */
    margin-bottom: 30px;
}


/* --- FORMULARIO DE CONTACTO (Estilo Tarjeta) --- */
.contacto-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    margin-top: 30px;
}

.contacto-card h3 {
    color: #006b3f; /* Verde oscuro elegante */
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 800;
}

.fila-doble {
    display: flex; gap: 10px; margin-bottom: 10px;
}

.input-form {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
    background: #fdfdfd;
    outline: none;
    transition: 0.3s;
    margin-bottom: 10px;
    font-family: 'Figtree', sans-serif;
    box-sizing: border-box; /* Importante para que no se salga */
}

.input-form:focus {
    border-color: #006b3f;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 107, 63, 0.1);
}

.mensaje-container label {
    display: block; font-size: 0.85rem; color: #888; margin-bottom: 5px; margin-left: 5px;
}

.btn-enviar-wa {
    width: 100%;
    background-color: #008f53; /* Verde WhatsApp */
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.btn-enviar-wa:hover {
    background-color: #006b3f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 143, 83, 0.3);
}

/* --- NUEVA DISTRIBUCIÓN (GRID SUPERIOR E INFERIOR) --- */

/* Superior: Galería (Izq) - Info (Der) */
.detalle-grid-superior {
    display: flex;
    gap: 40px;
    margin-bottom: 50px; /* Espacio antes del mapa */
}
.col-galeria, .col-info { width: 100%; }

/* Inferior: Mapa (Izq) - Contacto (Der) */
.detalle-grid-inferior {
    display: flex;
    gap: 40px;
    align-items: start; /* Alineados arriba */
    border-top: 1px solid #eee;
    padding-top: 40px;
}
.col-mapa { flex: 1.5; } /* El mapa ocupa un poco más */
.col-contacto { flex: 1; }

/* Ajuste del formulario para que encaje bien en la columna */
.contacto-card { margin-top: 0; } /* Quitamos margen superior extra */

/* --- RESPONSIVE PARA EL DETALLE --- */
@media (max-width: 900px) {
    .detalle-grid-superior, 
    .detalle-grid-inferior {
        flex-direction: column; /* En celular uno debajo de otro */
    }
    .col-mapa, .col-contacto { width: 100%; }
}

/* --- MENÚ VISIBLE EN DETALLE (MÓVIL) --- */
#nav-detalle-visible {
    display: block !important; /* Fuerza que se vea siempre */
}
#nav-detalle-visible ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}
#nav-detalle-visible a {
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- ESTRUCTURA DE LA PÁGINA DETALLE --- */

/* 1. Galería (Full Width) */
.seccion-galeria-full {
    margin-bottom: 40px;
    text-align: center;
}
.imagen-principal-container {
    height: 500px;
    background: #000;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}
/* Centrar miniaturas */
.tira-miniaturas.centered {
    justify-content: center;
}

/* 2. Info y Descripción (Full Width) */
.seccion-info-full {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee; /* Línea divisoria sutil */
}

/* 3. Sección Inferior (Mapa Izq | Contacto Der) */
.detalle-grid-inferior {
    display: flex;
    gap: 40px;
    align-items: start;
}
.col-mapa { flex: 1.5; } /* Mapa un poco más ancho */
.col-contacto { flex: 1; }

/* Ajustes Responsive */
@media (max-width: 900px) {
    .detalle-grid-inferior {
        flex-direction: column; /* En celular, uno abajo del otro */
    }
    .col-mapa, .col-contacto { width: 100%; }
    .imagen-principal-container { height: 300px; }
}