/* --- VARIABLES GLOBALES (PALETA VIVIR JAMUNDÍ) --- */
:root {
    --azul-oscuro: #0f172a;
    --azul-medio: #1e40af;
    --azul-claro: #3b82f6;
    --verde-brillante: #10b981;
    --verde-suave: #d1fae5;
    --gris-fondo: #f8fafc;
    --gris-texto: #475569;
    --blanco: #ffffff;
    --rojo-alerta: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --border-radius: 12px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* --- RESET Y ESTILOS BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--gris-fondo);
    color: var(--azul-oscuro);
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HERO SECTION & BUSCADOR --- */
.hero {
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)), 
                url('https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    padding: 100px 20px;
    text-align: center;
    color: white;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1;
}

.hero > * {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Estilo del formulario buscador */
.buscador {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.buscador label {
    display: block;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    text-align: left;
}

.buscador input, .buscador select {
    width: 100%;
    padding: 12px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255,255,255,0.3);
    font-size: 1rem;
    outline: none;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: var(--transition-fast);
}

.buscador input::placeholder, .buscador select {
    color: rgba(255,255,255,0.7);
}

.buscador input:focus, .buscador select:focus {
    border-color: var(--verde-brillante);
    background: rgba(255,255,255,0.2);
}

.buscador button {
    background-color: var(--verde-brillante);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--border-radius);
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-normal);
    align-self: flex-end;
}

.buscador button:hover, .buscador button:focus {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --- GRID DE PROPIEDADES --- */
.grid-propiedades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

/* --- TARJETA MODERNA (CARD) --- */
.card {
    background: var(--blanco);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #eef2f6;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
}

.card:focus-within {
    outline: 2px solid var(--azul-medio);
    outline-offset: 4px;
}

.card-img-container {
    height: 230px;
    overflow: hidden;
    position: relative;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card:hover .card-img-container img {
    transform: scale(1.1);
}

.badge-tipo {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--azul-medio);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 2;
}

.card-body {
    padding: 22px;
}

.card-price {
    color: var(--verde-brillante);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: block;
}

.card-title {
    font-size: 1.2rem;
    color: var(--azul-oscuro);
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-location {
    color: var(--gris-texto);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detalles {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
    margin-bottom: 20px;
}

.detalles span {
    font-size: 0.85rem;
    color: var(--gris-texto);
}

.detalles i {
    color: var(--azul-medio);
}

.btn-ver {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--azul-medio);
    color: white !important;
    text-decoration: none;
    padding: 12px;
    border-radius: var(--border-radius);
    font-weight: 700;
    transition: var(--transition-normal);
}

.btn-ver:hover, .btn-ver:focus {
    background: var(--azul-oscuro);
    transform: translateY(-2px);
}

/* --- BOTÓN WHATSAPP FLOTANTE ANIMADO --- */
.whatsapp-sticky {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    text-decoration: none;
    transition: var(--transition-normal);
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-sticky:hover, .whatsapp-sticky:focus {
    transform: scale(1.1);
    color: white;
    background-color: #128c7e;
    outline: none;
}

@keyframes pulse-whatsapp {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* --- RESPONSIVIDAD --- */
@media (max-width: 1024px) {
    .hero h1 { font-size: 2.5rem; }
    .hero { padding: 80px 20px; }
    .buscador { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 60px 20px; }
    .grid-propiedades { grid-template-columns: 1fr; gap: 20px; }
    .whatsapp-sticky { width: 50px; height: 50px; font-size: 28px; bottom: 15px; right: 15px; }
    .card-body { padding: 18px; }
    .detalles { gap: 10px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    .buscador { padding: 20px; }
    .card-img-container { height: 200px; }
    .card-price { font-size: 1.4rem; }
    .card-title { font-size: 1.1rem; }
}