/* ==========================================================================
   1. CONFIGURACIÓN GENERAL Y RESET
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Roboto', sans-serif; line-height: 1.6; color: #333; background-color: #fdfdfd; }

.contenedor { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
img { max-width: 100%; height: auto; }

/* ==========================================================================
   2. NAVEGACIÓN (HEADER)
   ========================================================================== */
.top-bar { background-color: #004a8c; color: white; padding: 8px 0; font-size: 0.85rem; }
.contenedor-flex { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.navbar { 
    background: #fff; 
    padding: 15px 0; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.logo img { height: 55px; width: auto; }
.menu { display: flex; list-style: none; }
.menu li { margin-left: 25px; }
.menu li a { text-decoration: none; color: #333; font-weight: 500; transition: color 0.3s; }
.menu li a:hover, .menu li a.activo { color: #004a8c; }

.menu-mobile { display: none; font-size: 1.5rem; cursor: pointer; color: #004a8c; }

/* ==========================================================================
   3. HERO Y BUSCADOR (HOME)
   ========================================================================== */
.hero-principal {
    position: relative;
    height: 70vh;
    background: url('img/fondo-home.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); }
.contenido-hero { position: relative; z-index: 2; width: 90%; max-width: 900px; }
.contenido-hero h1 { font-size: 3rem; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }

.buscador-flotante {
    background: white;
    padding: 10px;
    border-radius: 50px;
    display: flex;
    gap: 10px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.grupo-input { flex: 1; display: flex; align-items: center; padding: 0 20px; border-right: 1px solid #eee; }
.grupo-input:last-child { border-right: none; }
.grupo-input i { color: #004a8c; margin-right: 10px; }
.grupo-input select, .grupo-input input { border: none; width: 100%; outline: none; font-size: 1rem; color: #555; background: transparent; }

.btn-buscar-principal {
    background: #004a8c;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}
.btn-buscar-principal:hover { background: #003366; }

/* ==========================================================================
   4. GRID DE PROPIEDADES (TARJETAS)
   ========================================================================== */
.propiedades-home { padding: 60px 0; }
.encabezado-seccion { text-align: center; margin-bottom: 50px; }
.linea-adorno { width: 60px; height: 4px; background: #004a8c; margin: 15px auto; }

.grid-propiedades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.card-inmueble {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}
.card-inmueble:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.15); }

.card-img { position: relative; height: 210px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.badge-operacion {
    position: absolute;
    top: 15px; right: 15px;
    background: #004a8c;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.card-info { padding: 20px; }
.tipo-txt { color: #004a8c; font-size: 0.75rem; text-transform: uppercase; font-weight: bold; letter-spacing: 1px; }
.card-info h3 { margin: 10px 0; font-size: 1.2rem; color: #222; }
.precio-card { font-size: 1.3rem; color: #28a745; font-weight: 700; margin-bottom: 15px; }

.btn-detalles {
    display: block;
    text-align: center;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 500;
    transition: 0.3s;
    border: 1px solid #ddd;
}
.btn-detalles:hover { background: #004a8c; color: white; border-color: #004a8c; }

/* ==========================================================================
   5. PÁGINA DE DETALLE Y GALERÍA
   ========================================================================== */
.breadcrumb { background-color: #f4f7f9; padding: 15px 0; margin-bottom: 30px; border-bottom: 1px solid #e1e8ed; }
.breadcrumb a { color: #004a8c; text-decoration: none; font-weight: 500; }
.breadcrumb .separador { margin: 0 10px; color: #999; }

.contenedor-detalle { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.foto-principal { width: 100%; max-height: 500px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 25px rgba(0,0,0,0.1); margin-bottom: 20px; }
.foto-principal img { width: 100%; height: 100%; object-fit: cover; }

.galeria-fotos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.foto-miniatura { 
    width: 100%; height: 80px; object-fit: cover; border-radius: 8px; cursor: pointer; 
    transition: 0.2s; border: 2px solid transparent; 
}
.foto-miniatura:hover { border-color: #004a8c; transform: scale(1.05); }

.btn-compartir-wa {
    display: inline-flex; align-items: center; gap: 10px;
    background-color: #25d366; color: white; padding: 12px 25px;
    border-radius: 50px; text-decoration: none; font-weight: bold; margin: 20px 0;
}

/* ==========================================================================
   6. NOSOTROS, CONTACTO Y TASACIONES
   ========================================================================== */
.seccion-nosotros, .seccion-contacto { padding: 60px 0; }
.grid-dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }

.contenedor-tasacion { max-width: 700px; margin: 50px auto; padding: 40px; background: #f9f9f9; border-radius: 15px; border: 1px solid #eee; }
.form-tasacion input, .form-tasacion select, .form-tasacion textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; margin-bottom: 15px; }

.btn-enviar { background-color: #004a8c; color: white; padding: 15px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; width: 100%; }

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.footer-principal { background-color: #333; color: #fff; padding: 60px 0 0 0; margin-top: 50px; }
.columna-footer { flex: 1; padding: 0 20px; margin-bottom: 30px; }
.columna-footer h3 { margin-bottom: 20px; border-bottom: 2px solid #004a8c; display: inline-block; padding-bottom: 5px; }
.columna-footer ul { list-style: none; }
.columna-footer a { color: #ccc; text-decoration: none; transition: 0.3s; }
.columna-footer a:hover { color: #fff; }

.barra-derechos { background-color: #222; padding: 20px 0; text-align: center; font-size: 0.85rem; color: #aaa; }

.whatsapp-btn {
    position: fixed; bottom: 30px; right: 30px;
    background-color: #25d366; color: #fff;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 35px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 1000;
}

/* ==========================================================================
   8. ADMIN Y RESPONSIVE
   ========================================================================== */
.btn-eliminar { background: #dc3545; color: white; padding: 5px 10px; text-decoration: none; border-radius: 4px; }

@media (max-width: 768px) {
    .menu { display: none; }
    .menu-mobile { display: block; }
    .hero-principal h1 { font-size: 2rem; }
    .buscador-flotante { flex-direction: column; border-radius: 20px; padding: 20px; }
    .grupo-input { border-right: none; border-bottom: 1px solid #eee; padding: 10px 0; }
    .grid-dos-col { grid-template-columns: 1fr; }
    .contenedor-flex { flex-direction: column; text-align: center; }
}

.barra-derechos {
    background-color: #222;
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.85rem;
    color: #aaa;
}

@media (max-width: 768px) {
    .barra-derechos .contenedor-flex {
        flex-direction: column; /* Se apilan uno abajo del otro en el celu */
        text-align: center;
    }
}

@media (max-width: 768px) {
    .menu {
        display: none; /* Oculto por defecto en móvil */
        flex-direction: column;
        background-color: #fff;
        position: absolute;
        top: 80px; /* Ajustá según el alto de tu navbar */
        left: 0;
        width: 100%;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        padding: 20px 0;
        z-index: 999;
    }

    /* Esta es la clase que activa el JavaScript */
    .menu.show {
        display: flex;
    }

    .menu li {
        margin: 15px 0;
        text-align: center;
    }
}

/* ==========================================
   Ajustes para la Galería de Detalle
   ========================================== */

/* Asegura que el contenedor grande tenga un tamaño controlado */
.foto-principal {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 15px auto;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

/* Evita que la foto grande se estire o se deforme */
#visor-grande {
    width: 100%;
    height: 450px; /* Altura fija sugerida para que no ocupe toda la pantalla */
    object-fit: cover; /* Truco clave: recorta la imagen proporcionalmente sin aplastarla */
    display: block;
}

/* Alineación de la tira de miniaturas abajo */
.galeria-fotos {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Estilo para cada miniatura */
.foto-miniatura {
    width: 100px;
    height: 70px;
    object-fit: cover; /* Hace que la miniatura sea un recuadro perfecto */
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Efecto cuando pasás el mouse por arriba de una miniatura */
.foto-miniatura:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

/* Adaptación para pantallas de celulares */
@media (max-width: 768px) {
    #visor-grande {
        height: 280px; /* Más petisa en celulares para que sea cómoda de ver */
    }
    .foto-miniatura {
        width: 70px;
        height: 50px;
    }
}