html {
  scroll-behavior: smooth;
}

/* =========================================
   1. VARIABLES Y RESET GLOBAL
   ========================================= */
:root {
    /* Paleta de Colores Corporativa */
    --primary-blue: #32619f;
    --accent-yellow: #ffc46a;
    --text-grey: #545454;
    --white: #ffffff;
    --light-bg: #f4f7f6;
    
    /* Configuración UI */
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
    --container-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-grey);
    background-color: var(--white);
    line-height: 1.6;
}

/* Utilidad: Contenedor Principal */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* =========================================
   2. HEADER & NAVEGACIÓN
   ========================================= */
.main-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 80px;
    display: flex;
    align-items: center;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo Imagen */
.logo {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 5px 0;
}

.logo img {
    max-height: 60px; /* Ajuste para que quepa en el header */
    width: auto;
    display: block;
    object-fit: contain;
}

/* Menú Desktop */
.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-grey);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

/* Efecto Hover Subrayado */
.nav-menu a:not(.btn-contact)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-yellow);
    transition: var(--transition);
}

.nav-menu a:not(.btn-contact):hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-blue);
}

/* Botón Contacto (Estilo destacado) */
.nav-menu a.btn-contact {
    background-color: var(--accent-yellow);
    color: var(--primary-blue) !important;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 700;
}

.nav-menu a.btn-contact:hover {
    background-color: var(--primary-blue);
    color: var(--accent-yellow) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(50, 97, 159, 0.3);
}

/* Menú Hamburguesa (Móvil) */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--primary-blue);
    cursor: pointer;
}

/* =========================================
   3. SECCIÓN HERO (PRINCIPAL)
   ========================================= */
.hero {
    position: relative;
    height: 85vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Imagen de fondo */
    background-image: url('../img/bg-hero.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax */
}

/* Capa oscura azul sobre la imagen */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(50, 97, 159, 0.3) 0%, rgba(50, 97, 159, 0.4) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 90%;
    max-width: 900px;
    color: var(--white);
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    font-weight: 400;
    opacity: 0.9;
}

/* Buscador Hero */
.hero-search {
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
}

.input-group {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f4f4f4;
    border-radius: 5px;
    padding: 0 15px;
    border: 1px solid #e0e0e0;
}

.input-group i {
    color: var(--primary-blue);
    margin-right: 10px;
}

.input-group select {
    width: 100%;
    padding: 15px 5px;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-grey);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
}

.btn-search {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
    border: none;
    padding: 15px 40px;
    border-radius: 5px;
    font-weight: 800;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    text-transform: uppercase;
}

.btn-search:hover {
    background-color: var(--primary-blue);
    color: var(--accent-yellow);
}

/* =========================================
   4. SECCIÓN NOSOTROS
   ========================================= */
.about-section {
    padding: 100px 0;
    background-color: var(--white);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 20px 20px 0px var(--accent-yellow);
    object-fit: cover;
}

.experience-badge {
    position: absolute;
    bottom: -20px;
    left: -20px;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 20px 30px;
    border-radius: 5px;
    box-shadow: 0 10px 20px rgba(50, 97, 159, 0.3);
    text-align: center;
}

.experience-badge .years {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.subtitle {
    color: var(--accent-yellow);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
}

.about-content h2 {
    font-size: 2.5rem;
    color: var(--text-grey);
    line-height: 1.2;
    margin-bottom: 20px;
}

.about-content .highlight {
    color: var(--primary-blue);
}

.about-list {
    list-style: none;
    margin: 35px 0;
}

.about-list li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.about-list i {
    color: var(--accent-yellow);
    margin-right: 15px;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 700;
    border-radius: 5px;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}

/* =========================================
   5. SECCIÓN PROPIEDADES (GRID)
   ========================================= */
.properties-section {
    padding: 80px 0;
    background-color: var(--light-bg);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-blue);
}

.section-header .highlight {
    color: var(--accent-yellow);
}

/* Grid Layout Inteligente */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Tarjeta */
.property-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.property-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.property-card:hover .card-image img {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 10;
}

.badge.rent {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
}

.card-content {
    padding: 20px;
}

.price {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.card-content h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-grey);
}

.location {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 20px;
}

.card-features {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-bottom: 20px;
    color: #666;
    font-size: 0.9rem;
}

.btn-details {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px solid var(--accent-yellow);
    color: var(--text-grey);
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 5px;
}

.btn-details:hover {
    background: var(--accent-yellow);
    color: var(--primary-blue);
}

/* =========================================
   6. MODAL (POPUP)
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 2000; /* Encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--white);
    width: 90%;
    max-width: 900px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.modal-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 400px;
}

.modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    color: var(--white);
    cursor: pointer;
    z-index: 100;
    line-height: 0.8;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.modal-price {
    font-size: 2rem;
    color: var(--primary-blue);
    font-weight: 800;
    margin: 10px 0;
}

.modal-specs {
    list-style: none;
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.modal-specs li {
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-contact-modal {
    background-color: var(--primary-blue);
    color: var(--white);
    text-align: center;
    padding: 15px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 5px;
    transition: var(--transition);
}

.btn-contact-modal:hover {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
}

/* =========================================
   7. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================= */
@media (max-width: 900px) {
    /* Ajuste Nosotros */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .about-image {
        order: 2; /* Imagen abajo */
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    /* Header Móvil */
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--white);
        border-top: 1px solid #eee;
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out;
        z-index: -1;
        box-shadow: var(--shadow);
    }

    .nav-menu.visible {
        transform: translateY(0);
    }

    .nav-menu ul {
        flex-direction: column;
        padding: 20px 0;
        gap: 0;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 15px;
        font-size: 1.1rem;
    }
    
    /* Hero Móvil */
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .hero-search {
        flex-direction: column;
        padding: 20px;
    }
    .input-group, .btn-search {
        width: 100%;
    }

    /* Modal Móvil */
    .modal-grid {
        grid-template-columns: 1fr;
        max-height: 90vh;
        overflow-y: auto;
    }
    .modal-img-container img {
        height: 250px;
        min-height: auto;
    }
    .close-modal {
        color: var(--primary-blue);
        background: rgba(255,255,255,0.9);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        text-align: center;
        line-height: 40px;
        font-size: 1.5rem;
        top: 10px;
        right: 10px;
    }
}

/* Animación Modal Fade In */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Sección Contacto con Fondo Azulado */
.contact-section {
    padding: 100px 0;
    position: relative;
    
    /* Superposición de gradiente azul (0.85 opacidad) + Imagen */
    background-image: linear-gradient(rgba(50, 97, 159, 0.85), rgba(50, 97, 159, 0.95)), 
                      url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Efecto visual de profundidad */
}

.contact-wrapper {
    display: flex;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    border-radius: 15px;
    overflow: hidden; /* Para que el borde redondeado corte el contenido */
}

/* Lado Izquierdo: Formulario */
.contact-form-box {
    flex: 1.5; /* Ocupa más espacio */
    padding: 50px;
    background-color: var(--white);
}

.contact-form-box h2 {
    color: var(--primary-blue);
    font-size: 2rem;
    margin-bottom: 10px;
}

.contact-form-box p {
    color: var(--text-grey);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-grey);
}

input, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    background-color: #fafafa;
    transition: 0.3s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(50, 97, 159, 0.1);
}

.btn-submit {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}

.btn-submit:hover {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
}

/* Lado Derecho: Info (Azul) */
.contact-info-box {
    flex: 1;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 50px;
    display: flex;
    flex-direction: column;
}

.contact-info-box h3 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--accent-yellow);
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.info-item i {
    font-size: 1.2rem;
    color: var(--accent-yellow);
    margin-right: 15px;
    margin-top: 5px;
}

.info-item p {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

/* Redes Sociales */
.social-links {
    margin-top: auto; /* Empuja hacia abajo si hay espacio */
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    text-decoration: none;
    transition: 0.3s;
}

.social-links a:hover {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
}

.map-container {
    border-radius: 8px;
    overflow: hidden;
    height: 200px;
}

/* Responsive */
@media (max-width: 900px) {
    .contact-wrapper {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .contact-info-box {
        padding: 40px;
    }
    
    .map-container {
        height: 250px;
    }
}

/* =========================================
   8. FOOTER
   ========================================= */
.main-footer {
    background-color: #1e3c63; /* Un tono más oscuro que el azul principal */
    color: #e0e0e0;
    padding-top: 70px;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr; /* La primera columna es más ancha */
    gap: 50px;
    padding-bottom: 50px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Columna Marca */
.footer-logo img {
    height: 50px;
    margin-bottom: 20px;
    /* TRUCO: Invierte los colores para que el logo negro se vea blanco */
    filter: brightness(0) invert(1); 
    opacity: 0.9;
}

.brand-col p {
    line-height: 1.6;
    opacity: 0.8;
    max-width: 300px;
}

/* Títulos de Columnas */
.footer-col h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 30px;
    height: 2px;
    background-color: var(--accent-yellow);
}

/* Listas de Enlaces */
.links-col ul {
    list-style: none;
}

.links-col li {
    margin-bottom: 12px;
}

.links-col a {
    color: #e0e0e0;
    text-decoration: none;
    transition: var(--transition);
}

.links-col a:hover {
    color: var(--accent-yellow);
    padding-left: 5px; /* Pequeño movimiento a la derecha */
}

/* Lista de Contacto */
.contact-list {
    list-style: none;
    margin-bottom: 25px;
}

.contact-list li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.contact-list i {
    color: var(--accent-yellow);
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Iconos Sociales Footer */
.footer-socials {
    display: flex;
    gap: 15px;
}

.footer-socials a {
    width: 35px;
    height: 35px;
    background-color: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: var(--white);
    text-decoration: none;
    transition: 0.3s;
}

.footer-socials a:hover {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
    transform: translateY(-3px);
}

/* Barra Inferior */
.footer-bottom {
    background-color: #152b47; /* Aún más oscuro */
    padding: 20px 0;
    font-size: 0.85rem;
    color: #889bb0;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr; /* Todo en una columna */
        gap: 40px;
        text-align: center;
    }

    .brand-col p {
        margin: 0 auto; /* Centrar texto */
    }

    .footer-col h4::after {
        left: 50%; /* Centrar subrayado */
        transform: translateX(-50%);
    }

    .footer-bottom .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* =========================================
   BANNER CTA HORIZONTAL
   ========================================= */
.cta-banner {
    background-color: var(--primary-blue);
    background-image: linear-gradient(rgba(50, 97, 159, 0.5), rgba(50, 97, 159, 0.6)), 
                      url('../img/llavero.png');
    background-size: cover;
    background-position: center;
    /* Eliminado: background-attachment: fixed; */
    padding: 80px 0;
    text-align: center;
    color: var(--white);
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--white);
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
    color: var(--white);
}

.btn-cta-large {
    display: inline-block;
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 50px;
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--transition);
}

.btn-cta-large:hover {
    background-color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .cta-content h2 {
        font-size: 2rem;
    }
    .cta-content p {
        font-size: 1rem;
    }
}

/* =========================================
   SECCIÓN VALORES (TARJETAS 1-4)
   ========================================= */
.values-section {
    padding: 80px 0;
    background-color: var(--white);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.value-card {
    background: var(--light-bg);
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
    overflow: hidden;
    border-bottom: 3px solid transparent;
}

.value-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-bottom: 3px solid var(--accent-yellow);
    background: var(--white);
}

/* Número gigante de fondo */
.value-number {
    font-size: 8rem;
    font-weight: 900;
    color: var(--primary-blue);
    opacity: 0.05;
    position: absolute;
    top: -20px;
    right: -10px;
    line-height: 1;
    z-index: 1;
    transition: var(--transition);
}

.value-card:hover .value-number {
    opacity: 0.1;
    transform: scale(1.1);
}

.value-card h3 {
    font-size: 1.3rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.value-card p {
    font-size: 0.95rem;
    color: var(--text-grey);
    position: relative;
    z-index: 2;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 992px) {
    .values-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablet */
    }
}

@media (max-width: 576px) {
    .values-grid {
        grid-template-columns: 1fr; /* 1 columna en móvil */
    }
}