/* --- Variables y Globales --- */
:root {
    --color-fondo: #FFFFFF;
    --color-fondo-sec: #F4F7FB;
    --color-tarjeta: #FFFFFF;
    --color-primario: #004A99;
    --color-primario-hover: #0065D4;
    --color-acento: #F67E04;
    --color-acento-hover: #E07000;
    --color-texto: #1B1B1B;
    --color-texto-sec: #777777;
    --font-principal: 'Inter', sans-serif;
    --font-titulos: 'Montserrat', sans-serif;
    --color-whatsapp: #25D366;
    --shadow-tarjeta: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-tarjeta-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-principal);
    background-color: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.6;
    animation: fadeIn 0.3s ease-in-out forwards;
}
body.modal-open { overflow: hidden; }

section { margin-top: 0 !important; margin-bottom: 0 !important; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

a { color: var(--color-primario); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--color-primario-hover); }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--font-titulos); color: var(--color-texto); font-weight: 600; margin-bottom: 0.5rem; }
h1 { font-size: 2.8rem; } h2 { font-size: 1.8rem; }

/* --- Botones --- */
.btn {
    display: inline-block; padding: 0.75rem 1.5rem; border-radius: 5px;
    font-weight: 700; text-transform: uppercase; transition: all 0.3s ease;
    border: none; cursor: pointer; font-size: 0.9rem; text-align: center;
}
.btn.btn-accent { background-color: var(--color-acento); color: #FFFFFF; }
.btn.btn-accent:hover { background-color: var(--color-acento-hover); transform: translateY(-2px); }
.btn.btn-primary { background-color: var(--color-primario); color: #FFFFFF; }
.btn.btn-primary:hover { background-color: var(--color-primario-hover); transform: translateY(-2px); }
.btn-outline-primary { background: transparent; border: 2px solid var(--color-primario); color: var(--color-primario); padding: 0.5rem 1rem; }
.btn-outline-primary:hover { background: var(--color-primario); color: white; }

/* --- Header Sticky --- */
.main-header { padding: 1rem 0; position: fixed; top: 0; width: 100%; z-index: 100; transition: all 0.4s ease; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; }

.main-header:not(.scrolled).header-transparent .logo-texto,
.main-header:not(.scrolled).header-transparent .main-nav a,
.main-header:not(.scrolled).header-transparent .mobile-nav-toggle {
    color: #FFFFFF; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.main-header:not(.scrolled).header-transparent .logo-texto span { color: rgba(255,255,255,0.9); }

.main-header.scrolled, .main-header.header-solid {
    background-color: #FFFFFF; box-shadow: 0 2px 10px rgba(0,0,0,0.1); padding: 0.5rem 0;
}
.main-header.scrolled .logo-texto, .main-header.header-solid .logo-texto { color: var(--color-texto); text-shadow: none; }
.main-header.scrolled .main-nav a, .main-header.header-solid .main-nav a { color: var(--color-texto); text-shadow: none; }
.main-header.scrolled .mobile-nav-toggle, .main-header.header-solid .mobile-nav-toggle { color: var(--color-texto); text-shadow: none; }
.main-header.scrolled .logo-texto span, .main-header.header-solid .logo-texto span { color: var(--color-texto-sec); }

.logo-texto { font-family: var(--font-titulos); font-weight: 700; font-size: 1.5rem; line-height: 1.1; }
.logo-texto span { font-size: 0.8rem; font-weight: 400; display: block; letter-spacing: 0.5px; }

.main-nav ul { list-style: none; display: flex; gap: 1rem; }
.main-nav a { font-weight: 600; padding: 0.5rem 1rem; border-bottom: 2px solid transparent; transition: all 0.3s ease; }
.main-nav a:hover, .main-nav a.active { color: var(--color-primario) !important; border-bottom-color: var(--color-acento) !important; }
.mobile-nav-toggle, .nav-close-btn { display: none; cursor: pointer; border: none; background: none; }

/* --- Hero & Banners --- */
.hero-parallax {
    position: relative; height: 100vh; display: flex; justify-content: center; align-items: flex-start;
    color: #FFFFFF; background-image: url('../fondo-web-fernandez-inmobiliaria.png');
    background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.6)); z-index: 1;
}
.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 20vh 1rem 0 1rem; text-align: center; }
.hero-content h1 { color: #FFFFFF; font-size: 3rem; font-weight: 700; }
.hero-content p { font-size: 1.2rem; margin-bottom: 2rem; }

.page-title-image-banner {
    position: relative; height: 35vh; min-height: 250px; display: flex; align-items: center; justify-content: center;
    text-align: center; color: #FFFFFF; background-image: url('../fondo-web-fernandez-inmobiliaria.png');
    background-position: center; background-size: cover; z-index: 1; margin-bottom: 0;
}
.page-title-image-banner .hero-overlay { z-index: 0; }
.page-title-image-banner .section-header { position: relative; z-index: 2; margin-bottom: 0; }
.page-title-image-banner h2 { color: #FFFFFF; font-size: 2.8rem; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.page-title-image-banner .section-subtitle { color: rgba(255,255,255,0.9); }

/* --- Buscador Hero --- */
.hero-search-bar {
    background: rgba(255, 255, 255, 0.95); padding: 1rem; border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2); backdrop-filter: blur(5px);
}
.hero-search-bar form { display: flex; flex-wrap: wrap; gap: 1rem; }
.search-field { flex-grow: 1; min-width: 150px; }
.search-field select, .search-field input {
    width: 100%; padding: 0.8rem; border: 1px solid #ccc; border-radius: 5px;
    font-family: var(--font-principal); font-size: 1rem;
}
.hero-search-bar .btn { flex-grow: 1; }

/* --- Secciones --- */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-subtitle { font-size: 0.9rem; font-weight: 700; color: var(--color-primario); text-transform: uppercase; letter-spacing: 1px; }
.destacadas, .property-types, .contacto-pagina, .equipo-section.container, .vende-section { padding-top: 5rem; padding-bottom: 5rem; }
.page-title-image-banner + section { padding-top: 4rem; }

/* --- Tipos --- */
.types-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; text-align: center; }
.type-card {
    background: var(--color-tarjeta); padding: 2rem 1.5rem; border-radius: 8px;
    box-shadow: var(--shadow-tarjeta); transition: all 0.3s ease;
}
.type-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-tarjeta-hover); }
.type-card i { font-size: 2.5rem; color: var(--color-primario); margin-bottom: 1rem; }

/* --- Vende & Equipo --- */
.vende-section { background-color: var(--color-fondo-sec); }
.vende-content { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.vende-texto .section-subtitle, .vende-texto h2 { text-align: left; }
.vende-lista { list-style: none; padding-left: 0; margin-bottom: 2rem; }
.vende-lista li { position: relative; padding-left: 2rem; margin-bottom: 1rem; font-weight: 500; }
.vende-lista li::before { content: '✓'; position: absolute; left: 0; color: var(--color-acento); font-weight: 700; }
.vende-imagen img { border-radius: 8px; box-shadow: var(--shadow-tarjeta-hover); }

.equipo-section { text-align: center; }
.equipo-intro { max-width: 800px; margin: 0 auto 3rem auto; color: var(--color-texto-sec); font-size: 1.1rem; }
.equipo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; text-align: left; }
.equipo-card {
    background: var(--color-fondo-sec); padding: 2.5rem 2rem; border-radius: 8px;
    box-shadow: var(--shadow-tarjeta); transition: all 0.3s ease;
}
.equipo-card:hover { transform: translateY(-5px); }
.equipo-card i { font-size: 2.5rem; color: var(--color-primario); margin-bottom: 1.5rem; }

/* --- Tarjetas Propiedad --- */
.propiedades-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2.5rem; }
.property-card {
    background: #fff; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: var(--shadow-tarjeta); border: 1px solid #eee; transition: all 0.3s ease;
}
.property-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-tarjeta-hover); }
.card-image-container { height: 250px; position: relative; overflow: hidden; }
.card-image-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.property-card:hover .card-image-container img { transform: scale(1.05); }
.card-tag {
    position: absolute; top: 10px; left: 10px; background: #333; color: #fff;
    padding: 4px 8px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; border-radius: 3px;
}
.card-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.card-price { font-size: 1.4rem; font-weight: 700; color: var(--color-primario); margin-bottom: 0.5rem; }
.card-features { display: flex; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.card-features span i { color: var(--color-texto-sec); margin-right: 5px; }
.card-footer { margin-top: auto; }
.card-footer .btn { width: 100%; }

/* --- Layout Propiedades --- */
.propiedades-layout {
    display: grid; grid-template-columns: 2.5fr 1fr; gap: 3rem;
    padding-top: 4rem; padding-bottom: 4rem; align-items: start;
}
.propiedades-list-vertical { display: flex; flex-direction: column; gap: 2.5rem; }

.property-card-horizontal {
    display: flex; background: #fff; border-radius: 8px; overflow: hidden;
    box-shadow: var(--shadow-tarjeta); border: 1px solid #eee; transition: all 0.3s ease;
}
.property-card-horizontal:hover { transform: translateY(-3px); box-shadow: var(--shadow-tarjeta-hover); }
.h-card-image { flex: 0 0 35%; position: relative; min-height: 220px; }
.h-card-image img { width: 100%; height: 100%; object-fit: cover; }
.h-card-tag {
    position: absolute; top: 10px; left: 10px; background: #333; color: #fff;
    padding: 4px 8px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; border-radius: 3px;
}
.h-card-content { flex: 1; padding: 1.5rem; display: flex; flex-direction: column; justify-content: space-between; }
.h-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.h-card-title { font-size: 1.3rem; line-height: 1.3; margin-right: 1rem; }
.h-card-price { font-size: 1.2rem; font-weight: 700; white-space: nowrap; }
.h-card-features { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; font-size: 0.95rem; }
.h-card-features span i { color: var(--color-texto-sec); margin-right: 5px; }
.h-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 1rem; border-top: 1px solid #eee; font-size: 0.85rem; color: var(--color-texto-sec);
}

/* --- Sidebar & Widgets (RESTAURADOS) --- */
.layout-sidebar { position: sticky; top: 100px; }
.sidebar-widget { margin-bottom: 3rem; }
.sidebar-widget h3 {
    font-size: 1.2rem; margin-bottom: 1.5rem; color: var(--color-primario);
    border-bottom: 2px solid #eee; padding-bottom: 0.5rem;
}
.filtros-compactos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1rem; }
.filtro-select, .form-control-sm {
    width: 100%; padding: 0.6rem 0.8rem; border: 1px solid #ccc; border-radius: 5px;
    font-family: var(--font-principal); font-size: 0.95rem; background-color: #fff; color: var(--color-texto);
}

/* Calculadora Widget */
.calculator-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group-sm label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--color-texto); }
.calc-result {
    margin-top: 1.5rem; padding: 1rem; background-color: var(--color-fondo-sec);
    border-radius: 8px; text-align: center; border: 1px solid var(--color-primario);
    display: none; animation: fadeIn 0.3s ease-in-out;
}
.calc-result .monto-final { font-size: 1.5rem; font-weight: 700; color: var(--color-primario); display: block; }

/* Alerta Banner (Lead Magnet) */
.alerta-banner {
    background-color: #eef6fc; border: 1px solid #dceefb; padding: 1.5rem;
    border-radius: 8px; margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: center;
}
.alerta-banner-text h4 { color: var(--color-primario); margin-bottom: 0.5rem; }
.alerta-banner-text p { margin: 0; color: var(--color-texto-sec); font-size: 0.95rem; }

/* --- Agentes & Oficina --- */
.agentes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2.5rem; margin-bottom: 5rem; }
.agente-card {
    background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-tarjeta);
    text-align: center; border: 1px solid #eee; transition: all 0.3s ease;
}
.agente-card:hover { transform: translateY(-5px); }
.agente-foto { height: 250px; overflow: hidden; }
.agente-foto img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.agente-info { padding: 1.5rem; }
.agente-cargo { color: var(--color-acento); font-weight: 600; font-size: 0.9rem; margin-bottom: 1rem; text-transform: uppercase; }
.agente-contacto { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.agente-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0.6rem;
    border-radius: 5px; font-weight: 600; font-size: 0.9rem;
}
.btn-whatsapp { background-color: #25D366; color: white; }
.btn-email { background-color: var(--color-fondo-sec); color: var(--color-texto); border: 1px solid #ddd; }
.ver-propiedades-link {
    display: inline-block; color: var(--color-primario); font-weight: 600; font-size: 0.9rem;
    border-bottom: 2px solid transparent; transition: all 0.3s ease;
}
.ver-propiedades-link:hover { border-bottom-color: var(--color-acento); }

.oficina-contacto-wrapper {
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 3rem;
    background: var(--color-fondo-sec); padding: 3rem; border-radius: 10px; align-items: center;
}
.oficina-mapa { height: 350px; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-tarjeta); }

/* --- Footer --- */
.main-footer {
    background-color: var(--color-texto); color: #FFF; padding: 3rem 0; text-align: center; margin-top: auto;
}
.main-footer p { margin-bottom: 0.5rem; color: rgba(255,255,255,0.7); }
.main-footer p:first-of-type { color: #FFF; }
.main-footer a { color: var(--color-acento); }
.footer-credit {
    margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; opacity: 0.7;
}

/* --- Flotantes --- */
.whatsapp-float {
    position: fixed; width: 60px; height: 60px; bottom: 30px; right: 30px;
    background-color: var(--color-whatsapp); color: #FFF; border-radius: 50px;
    text-align: center; font-size: 30px; box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
    z-index: 100; display: flex; align-items: center; justify-content: center; transition: transform 0.3s ease;
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 32px; height: 32px; }

/* --- Modales --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85);
    z-index: 200; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px);
}
.modal-content {
    background: var(--color-fondo); width: 90%; max-width: 900px; max-height: 90vh;
    border-radius: 8px; border: 1px solid var(--color-primario); overflow-y: auto; position: relative; padding: 2rem;
}
.modal-sm { max-width: 500px; } /* Modal pequeño para alertas */
.modal-close-btn {
    position: absolute; top: 15px; right: 20px; font-size: 2.5rem; color: var(--color-texto); background: none; border: none; cursor: pointer;
}
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.modal-main-image img { width: 100%; height: auto; max-height: 400px; object-fit: cover; border-radius: 5px; }
.modal-thumb-images { display: flex; gap: 0.5rem; margin-top: 0.5rem; overflow-x: auto; }
.modal-thumb-images img { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.modal-thumb-images img.active { border-color: var(--color-primario); }
.modal-form-container { margin-top: 2rem; background: var(--color-fondo-sec); padding: 1.5rem; border-radius: 8px; }
.btn-whatsapp-modal { background-color: #25D366; color: white; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.contact-form .form-group { margin-bottom: 1rem; }
.contact-form input { width: 100%; padding: 0.8rem; border: 1px solid #ddd; border-radius: 5px; }

/* Modal Agente */
.modal-agent-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #eee; }
.modal-agent-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--color-primario); }
.modal-properties-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.mini-property-card { border: 1px solid #eee; border-radius: 8px; overflow: hidden; transition: all 0.3s ease; }
.mini-card-img { height: 120px; position: relative; }
.mini-card-img img { width: 100%; height: 100%; object-fit: cover; }
.mini-card-tag { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.7); color: #fff; font-size: 0.7rem; padding: 2px 6px; border-radius: 3px; }
.mini-card-content { padding: 1rem; }
.mini-card-price { font-weight: 700; color: var(--color-primario); margin-bottom: 1rem; }
.mini-card-btn { width: 100%; padding: 0.5rem; font-size: 0.85rem; }

/* --- Animaciones --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 900px) {
    .mobile-nav-toggle { display: block; font-size: 1.8rem; z-index: 1001; }
    .nav-close-btn { display: block; position: absolute; top: 1.5rem; right: 1.5rem; font-size: 2.5rem; color: var(--color-texto); z-index: 1001; }
    .main-nav {
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(255,255,255,0.98);
        backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center;
        opacity: 0; visibility: hidden; transform: translateY(-20px); transition: all 0.3s ease; z-index: 1000;
    }
    .main-nav.nav-open { opacity: 1; visibility: visible; transform: translateY(0); }
    .main-nav ul { flex-direction: column; gap: 2rem; text-align: center; }
    .main-nav a { color: var(--color-texto) !important; font-size: 1.5rem; text-shadow: none !important; }
    .main-header .btn.btn-accent { display: none; }
    .vende-content, .oficina-contacto-wrapper, .modal-grid, .propiedades-layout { grid-template-columns: 1fr; }
    .vende-imagen { order: -1; margin-bottom: 2rem; }
    .propiedades-layout { gap: 4rem; }
    .layout-sidebar { position: static; }
    .alerta-banner { flex-direction: column; text-align: center; gap: 1rem; }
    .alerta-banner .btn { width: 100%; }
}
@media (max-width: 768px) {
    .hero-parallax { height: auto; min-height: 70vh; align-items: center; background-attachment: scroll; }
    .hero-content { padding-top: 15vh; padding-bottom: 4rem; }
    .page-title-image-banner {
        height: 30vh;      /* Un poco más alto que antes (era 25vh) */
        min-height: 220px; /* Aumentamos considerablemente la altura mínima para dar aire */
        padding-top: 80px; /* EMPUJA EL TEXTO HACIA ABAJO para que no quede tras el header */
        align-items: center; /* Mantiene el centrado vertical en el espacio restante */
    }
    .propiedades-grid { grid-template-columns: 1fr; }
    .filtros-compactos { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .property-card-horizontal { flex-direction: column; }
    .h-card-image { height: 200px; }
    .h-card-header { flex-direction: column; }
    .h-card-price { text-align: left; margin-top: 0.5rem; color: var(--color-acento); }
}

/* --- RESTAURACIÓN DE ICONOS EN TARJETAS --- */
/* Asegura que los iconos tengan el tamaño y color correcto */
.card-features i,
.h-card-features i {
    color: var(--color-acento); /* Usamos el color acento (naranja) para destacar */
    margin-right: 6px;
    font-size: 1rem; /* Tamaño adecuado para que se vean bien junto al texto */
    vertical-align: middle;
}

.card-features span,
.h-card-features span {
    display: inline-flex;
    align-items: center;
    margin-right: 12px; /* Espacio entre cada grupo de característica */
    color: var(--color-texto);
    font-weight: 500;
}

/* --- ESTILOS PREMIUM PARA FORMULARIOS (Calculadora y Contacto) --- */
.sidebar-widget .form-group-sm,
.contact-form .form-group {
    margin-bottom: 1.2rem;
}

.sidebar-widget label,
.contact-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primario); /* Azul corporativo para etiquetas */
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.sidebar-widget input,
.sidebar-widget select,
.contact-form input,
.contact-form select,
.filtro-select {
    width: 100%;
    padding: 0.9rem 1rem; /* Más espacio interno para sensación premium */
    border: 1px solid #e0e0e0; /* Borde sutil inicial */
    border-radius: 8px; /* Bordes más redondeados */
    font-family: var(--font-principal);
    font-size: 0.95rem;
    color: var(--color-texto);
    background-color: #f9fbfd; /* Fondo ligeramente grisáceo, no blanco puro */
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); /* Sutil profundidad interna */
}

/* Efecto al hacer clic/foco */
.sidebar-widget input:focus,
.sidebar-widget select:focus,
.contact-form input:focus,
.contact-form select:focus,
.filtro-select:focus {
    outline: none;
    border-color: var(--color-primario); /* Borde azul al enfocar */
    background-color: #ffffff; /* Fondo blanco puro al enfocar */
    box-shadow: 0 4px 12px rgba(0, 74, 153, 0.1); /* Sombra suave azulada */
}

/* Botón de cálculo más llamativo */
.sidebar-widget button[type="submit"] {
    background: linear-gradient(135deg, var(--color-acento) 0%, var(--color-acento-hover) 100%);
    box-shadow: 0 4px 15px rgba(246, 126, 4, 0.3); /* Sombra naranja */
    color: white;
    border: none;
    font-weight: 700;
    padding: 1rem;
    border-radius: 8px;
    letter-spacing: 1px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-widget button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(246, 126, 4, 0.4);
}

/* Resultado de la calculadora mejorado */
.calc-result {
    background: linear-gradient(to right, #eef6fc, #fff);
    border-left: 4px solid var(--color-primario);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-top: 2rem;
}

/* --- CSS PARA MODAL PREMIUM --- */
.modal-content {
    padding: 0; /* Quitamos padding del contenedor principal para que el header llegue a los bordes */
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header-sticky {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-sticky h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-primario);
}

.modal-price-tag {
    background: var(--color-acento);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
}

.modal-grid-premium {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* Más espacio para la galería */
    gap: 0; /* Sin gap, usaremos padding interno */
    height: calc(90vh - 80px); /* Altura total menos header */
}

.modal-gallery-section {
    background: #000;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.main-image-frame {
    position: relative;
    margin-bottom: 1rem;
}

.main-image-frame img {
    width: 100%;
    max-height: 500px;
    object-fit: contain; /* Para no cortar las fotos */
    border-radius: 4px;
}

.operacion-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 600;
}

.thumbnails-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.thumbnails-scroll img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.2s;
    cursor: pointer;
}

.thumbnails-scroll img.active,
.thumbnails-scroll img:hover {
    opacity: 1;
    border: 2px solid var(--color-acento);
}

.modal-info-section {
    padding: 2rem;
    overflow-y: auto;
    background: #fff;
}

.modal-features-grid ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.modal-features-grid li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-texto);
    font-weight: 500;
}

.modal-features-grid li i {
    color: var(--color-primario);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.modal-contact-widget {
    background: var(--color-fondo-sec);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    border: 1px solid #e0e0e0;
}

.agent-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.agent-preview img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.btn-whatsapp-full {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    background-color: #25D366;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
}

/* Responsive para el Modal */
@media (max-width: 900px) {
    .modal-grid-premium {
        grid-template-columns: 1fr;
        height: auto; /* Dejar que crezca con el contenido en móvil */
    }
    .modal-gallery-section {
        padding: 1rem;
    }
    .modal-header-sticky {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
/* =========================================
   MODAL MODERNO V3 (Estilo Fino & Limpio)
   Reemplaza el bloque V2 anterior con este.
========================================= */

/* --- Header Limpio --- */
.modal-header-modern {
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: sticky; top: 0; z-index: 10;
}
.modal-header-modern h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    font-weight: 700; letter-spacing: -0.5px;
}
.modal-location-text {
    color: #666;
    font-size: 0.95rem;
    display: flex; align-items: center; gap: 8px;
    margin: 0;
}
.modal-location-text i { color: var(--color-acento); }

.modal-header-actions {
    text-align: right;
}
.badge-operacion {
    display: inline-block;
    font-size: 0.75rem; font-weight: 700;
    padding: 4px 10px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 8px;
}
.badge-venta { background-color: #1a1a1a; color: #fff; }
.badge-arriendo { background-color: var(--color-acento); color: #fff; }
.price-display {
    font-size: 1.6rem; color: var(--color-primario);
}

/* --- Layout Principal --- */
.modal-content-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr; /* Ligeramente más ancho para la galería */
    height: calc(90vh - 95px); /* Ajuste fino de altura */
    background: #fff;
}

/* --- Galería Limpia (Sin fondo negro) --- */
.gallery-container {
    padding: 2.5rem;
    background-color: #f8f9fa; /* Gris muy muy claro para diferenciar */
    display: flex; flex-direction: column; gap: 1.5rem;
    overflow-y: auto;
}
.main-image-wrapper {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08); /* Sombra suave y elegante */
    background: #fff; /* Por si la imagen carga lento */
}
.main-image-wrapper img {
    width: 100%; height: auto;
    display: block;
    object-fit: cover; /* Asegura que llene bien el espacio */
}

.thumbnails-row {
    display: flex; gap: 12px;
    padding: 4px; /* Espacio para el 'outline' de selección */
}
.thumb-wrapper {
    width: 70px; height: 70px;
    border-radius: 8px; overflow: hidden;
    cursor: pointer;
    opacity: 0.6; transition: all 0.3s ease;
    border: 2px solid transparent;
}
.thumb-wrapper.active, .thumb-wrapper:hover {
    opacity: 1;
    border-color: var(--color-primario);
    transform: translateY(-2px);
}
.thumb-wrapper img { width: 100%; height: 100%; object-fit: cover; }

/* --- Columna de Detalles --- */
.details-container {
    padding: 2.5rem;
    overflow-y: auto;
    background: #fff;
}
.details-section {
    margin-bottom: 3rem; /* Espaciado generoso entre secciones */
}
.details-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.8rem;
}

/* --- Texto Descripción --- */
.description-text {
    color: #555;
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* --- Checklist de Amenidades (Nuevo) --- */
.amenities-checklist {
    list-style: none;
    padding: 0; margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Columnas responsive */
    gap: 1rem 2rem;
}
.amenities-checklist li {
    display: flex; align-items: center; gap: 10px;
    color: #333;
    font-weight: 500; font-size: 0.95rem;
}
.amenities-checklist li i {
    color: var(--color-acento); /* Check en naranjo para destacar */
    font-size: 1.1rem;
}

/* --- CTA Box Fino --- */
.modal-cta-box {
    background: #f0f7ff; /* Azul muy muy claro */
    border: 1px solid #d0e3f9;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
}
.agent-info-simple {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 1.2rem;
    color: var(--color-primario);
    font-weight: 600;
}
.agent-info-simple img {
    width: 35px; height: 35px; border-radius: 50%;
}

/* Responsive */
@media (max-width: 900px) {
    .modal-content-grid { grid-template-columns: 1fr; height: auto; }
    .gallery-container, .details-container { padding: 1.5rem; }
    .modal-header-modern { padding: 1.5rem; flex-direction: column; gap: 1rem; }
    .modal-header-actions { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; border-top: 1px solid #eee; padding-top: 1rem; }
}
/* --- Key Stats Grid MEJORADO (Reemplaza el bloque anterior) --- */
.key-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); /* Tarjetas flexibles */
    gap: 15px; /* Espacio entre tarjetas */
    margin-bottom: 1rem;
}
.key-stat {
    background: #f9fbfd; /* Fondo muy sutil */
    border: 1px solid #eef2f7;
    border-radius: 10px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.key-stat:hover {
    border-color: var(--color-primario);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.key-stat i {
    font-size: 1.6rem; /* Icono más grande */
    color: var(--color-primario);
    margin-bottom: 8px;
}
.key-stat span {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}
.key-stat small {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    font-weight: 600;
}

/* --- Estilos para Modal de Agente --- */
.modal-body-agent {
    padding: 2.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 80px); /* Evita que se salga de la pantalla */
}
.agent-props-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}
.mini-prop-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}
.mini-prop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.mini-card-img {
    height: 140px;
    position: relative;
}
.mini-card-img img {
    width: 100%; height: 100%; object-fit: cover;
}
.mini-tag {
    position: absolute; top: 8px; left: 8px;
    background: rgba(0,0,0,0.7); color: #fff;
    font-size: 0.7rem; padding: 3px 6px; border-radius: 4px;
    text-transform: uppercase; font-weight: 600;
}
.mini-card-content {
    padding: 1rem;
}
.mini-card-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; /* Corta títulos largos */
}

/* =========================================
   PÁGINA TÉRMINOS Y CONDICIONES (Mejorada)
========================================= */
.terminos-pagina {
    padding-top: 8rem; /* Más espacio arriba para que no choque con el header fijo */
    padding-bottom: 6rem;
    background-color: #f8f9fa; /* Fondo general gris muy claro */
}

.terminos-content {
    background: #fff;
    padding: 3rem 4rem; /* Espacio interno generoso */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); /* Sombra elegante */
    max-width: 900px; /* Ancho máximo para lectura cómoda */
    margin: 0 auto; /* Centrado horizontal */
}

.terminos-content h3 {
    color: var(--color-primario);
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0; /* Línea separadora sutil bajo cada título */
}

.terminos-content h3:first-child {
    margin-top: 0; /* El primer título no necesita margen superior */
}

.terminos-content p {
    color: #555;
    line-height: 1.8; /* Mayor interlineado para mejor lectura */
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Ajuste Responsive para Términos */
@media (max-width: 768px) {
    .terminos-content {
        padding: 2rem 1.5rem; /* Menos padding en móviles */
    }
    .terminos-pagina {
        padding-top: 6rem;
    }
}

/* =========================================
   LOGOTIPO CON IMAGEN
========================================= */
.brand-link {
    display: flex;
    align-items: center;
    gap: 12px; /* Espacio entre tu logo y el texto */
    text-decoration: none;
    color: inherit; /* Hereda el color definido para .logo-texto según el estado del header */
}

.brand-logo-img {
    height: 45px; /* Ajusta este valor según el tamaño real de tu logo */
    width: auto;  /* Mantiene la proporción */
    transition: all 0.3s ease;
}

/* Ajuste opcional: si quieres que el logo sea un poco más pequeño al hacer scroll */
.main-header.scrolled .brand-logo-img {
    height: 40px;
}

/* =========================================
   CTA CARD EN MODAL (Solicitar Contacto)
   (Reemplaza el bloque .modal-cta-box o .modal-contact-widget-premium anterior si existe)
========================================= */
.contact-cta-card {
    background: #eef2f7; /* Fondo azul claro muy suave */
    border: 1px solid #d0e3f9; /* Borde sutil */
    padding: 2.5rem 1.5rem; /* Padding generoso */
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03); /* Sombra muy suave */
    margin-top: 2rem; /* Espacio superior */
}

.cta-title {
    font-size: 1.5rem;
    color: var(--color-primario);
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.cta-subtitle {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.8rem;
    line-height: 1.5;
}

/* Botón de WhatsApp más grande y llamativo */
.btn-whatsapp-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    color: #fff;
    font-size: 1rem; /* Tamaño de texto más estándar */
    font-weight: 600; /* Un poco menos grueso */
    padding: 1rem 0.5rem; /* Más delgado verticalmente, pero ancho cómodo */
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 8px;
    width: auto; 
    min-width: 220px; /* Ancho mínimo para buena presencia */
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3); /* Sombra suave inicial */
}

.btn-whatsapp-lg:hover {
    background: #20bd5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp-lg i {
    font-size: 1.2rem; /* Icono ligeramente ajustado al nuevo texto */
}

.cta-small-text {
    display: block;
    font-size: 0.8rem;
    color: #777;
}

/* =========================================
   GSAP ANIMATION SETUP (Optimizado Mobile)
========================================= */
.hero-parallax {
    /* Preparamos al navegador para el cambio pesado */
    will-change: transform, clip-path; 
    /* Oculto inicialmente para evitar parpadeos (FOUC) */

}

/* Necesario para el efecto de palabras */
.word-wrap {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    /* Espacio dinámico: en móvil a veces es mejor reducirlo un poco */
    margin-right: 0.25em; 
    line-height: 1.1; /* Asegura que no se corten los descuelgues de letras como p, g, j */
}
.word-inner {
    display: inline-block;
    will-change: transform;
}

/* --- AJUSTE FINO MÓVIL (Agrega esto al final del CSS) --- */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem; /* Reduce el título de 2.8rem a 2rem en móviles */
        line-height: 1.2;
    }
    .hero-content p {
        font-size: 1rem; /* Texto un poco más compacto */
    }
    /* Ajuste para que la animación de clip-path no corte contenido en pantallas muy angostas */
    .hero-parallax {
        padding: 0 1rem; 
    }
}