/* RESET Y BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: #f7f7f7; color: #222; }
.contenedor { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
header {
    background: white;
    padding: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

header .contenedor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    flex: 1 0 auto;          /* Ocupa el espacio disponible */
}
.logo-img {
    max-width: 200px;
    max-height: 70px;
    width: 100%;
    height: auto;
    display: block;
}

/* Grupo de la derecha (idioma + login) */
.header-derecha {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;          /* No se estira, ocupa su tamaño */
}

.idioma-selector {
    display: flex;
    gap: 4px;
}
.btn-idioma {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.2s;
}
.btn-idioma.activo {
    border-color: #E35E35;
    opacity: 1;
    background: rgba(227,94,53,0.1);
}
.btn-idioma img {
    display: block;
    width: 24px;
    height: 16px;
    border-radius: 2px;
}

.login-area {
    display: flex;
    align-items: center;
}
.login-link img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: 0.2s;
}
.login-link:hover img {
    transform: scale(1.05);
}

/* ===== RESPONSIVE: MÓVIL ===== */
@media (max-width: 768px) {
    header .contenedor {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        padding: 0 10px;
    }
    
    .logo {
        flex: 0 1 auto;
        max-width: 50%; /* Limita el ancho para dejar espacio a la derecha */
    }
    
    .logo-img {
        max-width: 150px; /* Tamaño seguro para que el logo no empuje a los botones */
        height: auto;
    }

    /* Agrupa los idiomas y el login bien pegados a la derecha */
    .header-derecha {
        display: flex;
        align-items: center;
        gap: 6px; /* Reduce la separación entre las banderas y el login */
        flex: 0 0 auto;
        margin-left: auto; /* Fuerza el bloque hacia la derecha */
    }
    .btn-idioma img {
        width: 20px;
        height: 13px;
    }
    .login-link img {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 50%;                /* Más espacio para los iconos */
    }
    .logo-img {
        max-width: 210px;
        max-height: 60px;
    }
    .btn-idioma img {
        width: 20px;
        height: 14px;
    }
    .login-link img {
        width: 22px;
        height: 22px;
    }
    .header-derecha {
        gap: 6px;
    }
    header .contenedor {
        padding: 0 6px;
    }
}

@media (max-width: 400px) {
    .logo {
        max-width: 45%;
    }
    .logo-img {
        max-width: 110px;
        max-height: 35px;
    }
    .btn-idioma img {
        width: 16px;
        height: 11px;
    }
    .login-link img {
        width: 20px;
        height: 20px;
    }
    .header-derecha {
        gap: 4px;
    }
    header .contenedor {
        padding: 0 4px;
    }
}

/* HERO / BÚSQUEDA: SIN FONDO DE COLOR (transparente) */
/* ===== FILTROS RÁPIDOS EN EL HERO ===== */
.filtros-rapidos {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.btn-filtro {
    background: white;
    border: 2px solid #ddd;
    border-radius: 40px;
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    transition: 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    white-space: nowrap;
}
.btn-filtro i {
    font-size: 1.2rem;
}
.btn-filtro:hover {
    border-color: #E35E35;
    background: #fff5f0;
    transform: translateY(-2px);
}
.btn-filtro.activo {
    border-color: #E35E35;
    background: #E35E35;
    color: white;
    box-shadow: 0 4px 14px rgba(227, 94, 53, 0.3);
}
.btn-filtro.activo i {
    color: white;
}

/* ===== RESPONSIVE para móvil ===== */
@media (max-width: 600px) {
    .filtros-rapidos {
        gap: 10px;
        padding: 15px 10px;
        flex-wrap: nowrap;          /* Fuerza una sola línea en móvil */
        overflow-x: auto;           /* Scroll horizontal si es necesario */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .filtros-rapidos::-webkit-scrollbar {
        display: none;
    }
    .btn-filtro {
        padding: 10px 18px;
        font-size: 0.9rem;
        gap: 6px;
        flex: 0 0 auto;             /* No se estira, ocupa su tamaño */
    }
    .btn-filtro i {
        font-size: 1rem;
    }
}

@media (max-width: 420px) {
    .btn-filtro {
        padding: 8px 14px;
        font-size: 0.8rem;
        gap: 4px;
        border-radius: 30px;
    }
    .btn-filtro i {
        font-size: 0.8rem;
    }
    .filtros-rapidos {
        gap: 6px;
        padding: 10px 6px;
    }
}

/* Si aún así no caben, ocultamos los iconos en móviles muy pequeños */
@media (max-width: 360px) {
    .btn-filtro i {
        display: none;
    }
    .btn-filtro {
        padding: 6px 10px;
        font-size: 0.75rem;
        gap: 0;
    }
    .filtros-rapidos {
        gap: 4px;
    }
}

/* --- El resto del CSS (grid, tarjetas, footer) se mantiene igual --- */
.grid-propiedades { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
    margin: 30px 0; 
}
.tarjeta-propiedad { 
    background: white; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
    transition: 0.3s; 
}
.tarjeta-propiedad:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.imagen { 
    position: relative; 
    height: 200px; 
    background: #eee; 
}
.imagen img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}
.tipo { 
    position: absolute; 
    top: 10px; 
    left: 10px; 
    background: rgba(0,0,0,0.7); 
    color: white; 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 0.8rem; 
}
.info { 
    padding: 15px; 
}
.info h4 { 
    font-size: 1.1rem; 
    margin-bottom: 5px; 
}
.ubicacion { 
    color: #666; 
    font-size: 0.9rem; 
}
.precio { 
    font-size: 1.3rem; 
    font-weight: bold; 
    margin: 8px 0; 
}
.precio span { 
    font-weight: normal; 
    font-size: 0.9rem; 
    color: #666; 
}
.amenidades { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    margin: 10px 0; 
}
.amenidades span { 
    background: #f0f0f0; 
    padding: 2px 10px; 
    border-radius: 15px; 
    font-size: 0.75rem; 
}
.btn-ver { 
    display: inline-block; 
    background: #E35E35; 
    color: white; 
    padding: 8px 20px; 
    border-radius: 20px; 
    text-decoration: none; 
    margin-top: 5px; 
    transition: background 0.2s;
}
.btn-ver:hover {
    background: #c94d2c;
}

/* ===== PROPIEDAD.PHP (detalle de propiedad) ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.lightbox.active {
    display: flex;
}
.lightbox img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
}
.lightbox .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2.5rem;
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    transition: 0.3s;
}
.lightbox .nav:hover {
    background: rgba(255,255,255,0.4);
}
.lightbox .nav.prev { left: 20px; }
.lightbox .nav.next { right: 20px; }
.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
}
.lightbox .contador {
    color: #aaa;
    margin-top: 15px;
    font-size: 1rem;
}
.lightbox .descripcion-lightbox {
    color: #ddd;
    margin-top: 10px;
    font-size: 1rem;
    text-align: center;
    max-width: 80%;
}
.galeria {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 10px 0 20px 0;
}
.galeria img {
    width: 400px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #ddd;
}
.galeria img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
.seccion {
    margin: 25px 0;
    border-top: 1px solid #eee;
    padding-top: 20px;
}
.seccion h2 {
    color: #222;
    font-size: 1.4rem;
}
.seccion h3 {
    color: #555;
    font-size: 1.1rem;
    margin: 15px 0 8px 0;
}
.badge {
    background: #E35E35;
    color: white;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}
.amenidades {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.amenidades span {
    background: #f0f0f0;
    padding: 6px 14px;
    border-radius: 20px;
}
.evaluacion {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}
.evaluacion .header {
    display: flex;
    justify-content: space-between;
}
.evaluacion .estrellas {
    color: #f5a623;
}
.evaluacion .comentario {
    margin: 6px 0;
}
.evaluacion .fecha {
    color: #999;
    font-size: 0.8rem;
}
.menciones {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.menciones .tag {
    background: #e8f0fe;
    padding: 8px 16px;
    border-radius: 30px;
}
.menciones .tag strong {
    color: #E35E35;
    margin-right: 5px;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.volver {
    display: inline-block;
    margin-top: 20px;
    color: #E35E35;
    text-decoration: none;
}
.volver:hover {
    text-decoration: underline;
}
.admin-link {
    float: right;
    background: #E35E35;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
}
.admin-link:hover {
    background: #c94d2c;
}
@media (max-width: 768px) {
    .galeria img {
        width: 100%;
        height: auto;
        max-width: 100%;
        max-height: 300px;
    }
}



footer { 
    background: #222; 
    color: white; 
    padding: 20px 0; 
    text-align: center; 
    margin-top: 40px; 
}
footer a { 
    color: #ffb347; 
    text-decoration: none; 
}