/* ===========================
   ESTILOS GENERALES
=========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #1e293b;
}

/* CONTENEDOR CENTRAL */
.container {
    width: 90%;
    max-width: 1300px;
    margin: auto;
    padding-top: 20px;
}

/* ============================
      HEADER GENERAL
============================ */
header {
    width: 100%;
    padding: 20px 5%;
    background: #0A3D62;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

/* Menú normal (PC) */
nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 16px;
}

nav a:hover {
    background: rgba(255,255,255,0.2);
}

/* ===========================
   GRID DE CASAS (4x4 EN PC)
=========================== */
.grid-casas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-top: 40px;
}

.casa {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: transform 0.25s;
}

.casa:hover {
    transform: scale(1.03);
}

.casa img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.casa-info {
    padding: 15px;
}

.casa-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.casa-info .precio {
    font-size: 20px;
    color: #047857;
    font-weight: bold;
}

.casa-info .ubicacion {
    font-size: 16px;
    color: #334155;
    margin-bottom: 12px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    transition: 0.3s;
}

.btn:hover {
    background: #1d4ed8;
}

/* ===========================
   FILTRO
=========================== */
.filtro {
    margin: 25px 0;
    display: flex;
    gap: 15px;
}

select {
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

/* ===========================
   DETALLE DE CASA
=========================== */
.casa-detalle {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    margin-top: 30px;
}

.galeria {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.galeria .imagen-principal img {
    width: 90%;
    max-height: 350px;
    object-fit: contain;
    border-radius: 12px;
    background: #f1f5f9;
    padding: 8px;
}

.galeria .miniaturas {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.galeria .miniaturas img {
    width: 90px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: 0.3s;
}

.galeria .miniaturas img:hover {
    border-color: #2563eb;
}

/* ============================
      MENÚ HAMBURGUESA (MÓVIL)
============================ */
.menu-toggle {
    display: none;
    font-size: 30px;
    cursor: pointer;
    user-select: none;
}

/* Vista móvil */
@media (max-width: 700px) {

    /* Oculta el menú normal */
    nav {
        position: absolute;
        top: 70px;
        left: 0;
        background: #0A3D62;
        width: 100%;
        flex-direction: column;
        text-align: center;
        padding: 15px 0;
        display: none;
    }

    /* Cuando el menú está abierto */
    nav.nav-open {
        display: flex;
    }

    nav a {
        padding: 12px 0;
        font-size: 18px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    nav a:last-child {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    /* Botón hamburguesa visible */
    .menu-toggle {
        display: block;
    }
}

/* ===========================
   RESPONSIVE — CELULARES
=========================== */
@media (max-width: 900px) {
    .grid-casas {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    nav {
        flex-direction: column;
        text-align: center;
    }

    .grid-casas {
        grid-template-columns: 1fr;
    }

    .galeria .imagen-principal img {
        width: 100%;
        max-height: 250px;
    }

    .galeria .miniaturas img {
        width: 80px;
        height: 55px;
    }

    .filtro {
        flex-direction: column;
        width: 100%;
    }
}

/* ===========================
   FOOTER
=========================== */
footer {
    background: #1e3a8a;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* ===========================
   OPTIMIZACIÓN MÓVIL GLOBAL
=========================== */
@media (max-width: 600px) {

    /* HEADER más pequeño */
    header {
        padding: 12px 0;
    }

    header h1 {
        font-size: 20px;
        line-height: 1.2;
        margin-bottom: 10px;
    }

    /* MENU más compacto */
    nav {
        gap: 8px;
        margin-top: 5px;
    }

    nav a {
        font-size: 14px;
        padding: 6px 10px;
    }

    /* CONTENEDOR GENERAL: agrega márgenes y mejor lectura */
    .container,
    main,
    section {
        width: 92%;
        margin: auto;
    }

    /* TEXTOS de la página principal */
    h2, h3 {
        font-size: 20px;
        margin-top: 15px;
    }

    p {
        font-size: 15px;
        line-height: 1.4;
    }

    /* IMÁGENES DE LA PÁGINA PRINCIPAL */
    .imagen-principal,
    .contenido img {
        width: 100%;
        max-height: 230px;
        object-fit: cover;
        border-radius: 8px;
    }

    /* SECCIONES */
    section {
        margin-bottom: 25px;
    }

    /* FOOTER compacto */
    footer {
        font-size: 14px;
        padding: 15px;
    }
}



