@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
    --primary: #7c313e;
    --primary-dark: #5c242e;
    --white: #fff;
    --black: #121212;
    --gray-light: #f5f5f5;
    --gray: #e0e0e0;
    --section-gap: 4rem; /* Reducido de 7rem a 4rem */
    --radius-xl: 2.2rem;
    --radius-lg: 1.2rem;
    --shadow-xl: 0 12px 40px 0 rgba(124,49,62,0.10), 0 2px 8px 0 rgba(60,60,60,0.04);
    --shadow-card: 0 6px 32px 0 rgba(124,49,62,0.08), 0 1.5px 4px 0 rgba(60,60,60,0.05);
    --transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

/* --- SECCIONES MODULARES --- */
section {
    margin-bottom: var(--section-gap);
    padding-top: 2rem;
    padding-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Fondos para secciones alternadas */
section:nth-child(odd) {
    background: linear-gradient(to bottom right, rgba(255,255,255,0.98), rgba(245,245,245,0.95));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

section:nth-child(even) {
    background: linear-gradient(to bottom left, rgba(255,255,255,0.98), rgba(250,245,245,0.95));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

/* Patrones decorativos para secciones */
section:nth-child(odd)::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjN2MzMTNlIiBmaWxsLW9wYWNpdHk9IjAuMDMiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PGNpcmNsZSBjeD0iMSIgY3k9IjEiIHI9IjEiLz48L2c+PC9zdmc+');
    opacity: 0.5;
    z-index: 0;
}

section:nth-child(even)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjN2MzMTNlIiBmaWxsLW9wYWNpdHk9IjAuMDMiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0iTTM2IDM0aDR2MWgtNHYtMXptMC0yaDF2NGgtMXYtNHptMi0yaDF2MWgtMXYtMXptMiAyaDF2NGgtMXYtNHptLTIgMmg0djFoLTR2LTF6Ii8+PC9nPjwvc3ZnPg==');
    opacity: 0.4;
    z-index: 0;
}

/* Asegurar que el contenido esté por encima del patrón */
section > .container {
    position: relative;
    z-index: 1;
}

/* Estilos para tarjetas con efecto hover */
.hover-lift {
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

/* Efecto hover mejorado para filas de tabla */
#unidades table tbody tr {
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

#unidades table tbody tr:hover {
    background-color: rgba(124, 49, 62, 0.2) !important;
    box-shadow: 0 4px 12px rgba(124, 49, 62, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Estilos para fondos de secciones */
.section-pattern {
    background-color: #f9f9f9;
    background-image: url('data:image/svg+xml,%3Csvg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23e0e0e0" fill-opacity="0.4" fill-rule="evenodd"%3E%3Ccircle cx="3" cy="3" r="1"%3E%3C/circle%3E%3C/g%3E%3C/svg%3E');
    background-attachment: fixed;
}

/* Fondo para la sección de ubicación */
.section-bg-map {
    background-color: #f5f5f5;
    background-image: url('img/map-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

/* Fondo para la sección de interiores */
.section-bg-interior {
    background-color: #f9f9f9;
    background-image: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255,255,255,0.7)), url('renders/10.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Fondo para la sección de unidades */
.section-bg-units {
    background-color: #f9f9f9;
    background-image: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255,255,255,0.7)), url('renders/3.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Estilos para secciones con fondos especiales */
.section-pattern {
    position: relative;
}

.section-bg-map {
    position: relative;
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.92), rgba(255,255,255,0.96)), url('https://maps.googleapis.com/maps/api/staticmap?center=Fuente+el+Saz+de+Jarama,Madrid&zoom=13&size=1200x600&maptype=roadmap&key=YOUR_API_KEY');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.section-bg-interior {
    position: relative;
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.92), rgba(255,255,255,0.96)), url('renders/interior.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.section-bg-units {
    position: relative;
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.92), rgba(255,255,255,0.96)), url('renders/exterior.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Reducir espaciado vertical entre elementos */
section .max-w-3xl.mx-auto.text-center.mb-14 {
    margin-bottom: 2.5rem;
}

section .grid {
    margin-bottom: 2rem;
}

/* --- TARJETAS Y MODULOS --- */
.card, .bg-glass {
    background: rgba(255,255,255,0.68);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}
.card:hover, .bg-glass:hover {
    box-shadow: 0 16px 48px 0 rgba(124,49,62,0.16);
    transform: translateY(-4px) scale(1.012);
}

/* --- TARJETAS Y MODULOS --- */
.card {
    background: rgba(255,255,255,0.68);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

/* --- MENU EMERGENTE --- */
#mobile-menu.flex {
    background: #fff;
    box-shadow: 0 8px 48px 0 rgba(124,49,62,0.14);
    animation: fade-in 0.3s cubic-bezier(.4,0,.2,1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 0 2vw;
}

#mobile-menu.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    #mobile-menu nav {
        gap: 2.2rem;
    }
    #mobile-menu nav a {
        font-size: 1.3rem;
        padding: 1rem 0;
    }
    #mobile-menu .nav-cta-mobile {
        font-size: 1.5rem;
    }
}

/* --- TITULOS Y TIPOGRAFÍA --- */
h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* --- BOTONES PREMIUM --- */
.btn, .btn-outline {
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1.08rem;
    letter-spacing: 0.04em;
    padding: 0.8rem 2.2rem;
    box-shadow: 0 2px 8px 0 rgba(124,49,62,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn {
    background: linear-gradient(90deg, #7c313e 0%, #5c242e 100%);
    color: #fff;
}
.btn:hover {
    background: #5c242e;
    color: #fff;
    box-shadow: 0 8px 24px 0 rgba(124,49,62,0.14);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* --- ANIMACIONES SUAVES Y MICROINTERACCIONES --- */
section, .card, .btn, .btn-outline, .nav-glass {
    transition: var(--transition);
}

/* --- SEPARADORES Y DECORACION --- */
hr.section-divider {
    border: none;
    border-top: 2px solid var(--primary);
    width: 80px;
    margin: 2.5rem auto;
    opacity: 0.22;
}

/* --- SHADOWS Y GLASS --- */
.bg-glass-dark {
    background: rgba(124,49,62,0.14);
    box-shadow: 0 8px 32px 0 rgba(124,49,62,0.14);
    color: #fff;
}

/* --- TABLAS MODERNAS --- */
table {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(255,255,255,0.98);
    box-shadow: var(--shadow-card);
}
th, td {
    padding: 1rem 1.2rem;
    font-size: 1.06rem;
}
th {
    background: #7c313e;
    color: #fff;
    font-weight: 700;
}
tbody tr:hover {
    background: #7c313e11;
    transition: background 0.2s;
}

/* --- ICONOS Y DETALLES --- */
i.fas, i.fab {
    filter: drop-shadow(0 2px 6px rgba(124,49,62,0.07));
    font-size: 1.25em;
}

/* --- SMOOTH SCROLL GLOBAL --- */
html {
    scroll-behavior: smooth;
}

/* --- ESTILOS PARA MENÚ ELEGANTE --- */
#mobile-menu {
    background: #fff;
    box-shadow: 0 8px 48px 0 rgba(124,49,62,0.14);
}

#mobile-menu a.nav-link-mobile {
    font-size: 1.3rem;
    font-weight: 400;
    padding: 0.5rem 0;
    color: #7c313e;
    transition: all 0.2s ease;
    display: block;
    text-align: center;
    letter-spacing: 0.05em;
    position: relative;
}

#mobile-menu a.nav-link-mobile:after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    background-color: #7c313e;
    transition: all 0.2s ease;
}

#mobile-menu a.nav-link-mobile:hover:after {
    width: 100%;
    left: 0;
}

#mobile-menu a.nav-link-mobile-sub {
    font-size: 1rem;
    font-weight: 300;
    padding: 0.25rem 0;
    color: #7c313e;
    opacity: 0.8;
    transition: all 0.2s ease;
    display: block;
    text-align: center;
}

#mobile-menu a.nav-link-mobile-sub:hover {
    opacity: 1;
}

#mobile-menu .flex.flex-col {
    margin: 0.2rem 0 0.8rem;
}

/* Estilos para el menú en dos columnas */
#mobile-menu .grid.grid-cols-2 {
    max-height: 90vh;
    overflow-y: auto;
    gap: 1.5rem;
}

#mobile-menu .grid.grid-cols-2 a.nav-link-mobile {
    font-size: 1.2rem;
    padding: 0.4rem 0;
}

#mobile-menu .grid.grid-cols-2 a.nav-link-mobile-sub {
    font-size: 0.95rem;
    padding: 0.2rem 0;
}

#mobile-menu .nav-cta-mobile {
    font-size: 1.1rem;
    font-weight: 400;
    padding: 0.7rem 2.5rem;
    margin-top: 1.5rem;
    display: inline-block;
    width: auto;
    background: #7c313e;
    color: #fff !important;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(124,49,62,0.2);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#mobile-menu .nav-cta-mobile:hover {
    background: #5c242e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124,49,62,0.25);
}

    --primary: #7c313e;
    --primary-dark: #5c242e;
    --black: #121212;
    --white: #fff;
    --gray-light: #f5f5f5;
    --gray: #e0e0e0;
    --gold: #c8a97e;
    --blue-dark: #0f172a;
    --transition: all 0.3s ease;
}

body, html {
    font-family: 'Roboto', sans-serif;
    scroll-behavior: smooth;
    background-color: var(--white);
    color: var(--black);
    line-height: 1.6;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

.primary-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border: none;
    transition: var(--transition);
}

.primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 49, 62, 0.3);
}

.text-primary {
    color: var(--primary);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.sliding-border::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.sliding-border:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.hero-section {
    height: 100vh;
    min-height: 700px;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    background-size: cover;
    background-position: center;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(18, 18, 18, 0.85), rgba(18, 18, 18, 0.6));
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 5%;
    text-align: left;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-weight: 300;
    max-width: 600px;
}

.hero-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2.5rem;
    max-width: 600px;
    line-height: 1.8;
}

.hero-logo {
    max-width: 400px;
    width: 100%;
    height: auto;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

@media (max-width: 768px) {
    .hero-logo {
        max-width: 300px;
    }
}

.hero-subtitle {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.3s;
}

.hero-description {
    max-width: 600px;
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    text-align: left;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.6s;
}

@keyframes fadeInUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 25px 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.main-nav.scrolled {
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-logo {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--black);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    margin: 0 1rem;
}

.nav-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover:after {
    width: 100%;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Ajuste para las anclas y secciones */
section {
    scroll-margin-top: 100px; /* Altura del menú + espacio adicional */
    padding-top: 2rem; /* Añadir padding superior a todas las secciones */
}

/* Solución alternativa para navegadores que no soportan scroll-margin-top */
:target::before {
    content: "";
    display: block;
    height: 100px; /* Altura del menú + espacio adicional */
    margin-top: -100px; /* Negativo de la altura */
    visibility: hidden;
    pointer-events: none;
}

/* Asegurar que los títulos de sección tengan suficiente espacio */
section h2 {
    padding-top: 1rem;
}

/* Animaciones generales */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fade-up.show {
    opacity: 1;
    transform: translateY(0);
}

.fade-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fade-left.show {
    opacity: 1;
    transform: translateX(0);
}

.fade-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fade-right.show {
    opacity: 1;
    transform: translateX(0);
}

/* --- MEJORAS PARA ANIMACIONES AOS --- */
[data-aos] {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-aos] .btn,
[data-aos] .btn-outline,
[data-aos] a[role="button"],
[data-aos] a[href^="#footer-contacto"] {
    pointer-events: auto !important;
    z-index: 2;
}

.fade-in.visible {
    opacity: 1;
}

.scale-up {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.scale-up.visible {
    opacity: 1;
    transform: scale(1);
}

/* Nuevas animaciones */
.fade-down {
    opacity: 0;
    transform: translateY(-30px);
    transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fade-down.visible {
    opacity: 1;
    transform: translateY(0);
}

.zoom-in {
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.zoom-in.visible {
    opacity: 1;
    transform: scale(1);
}

.rotate-in {
    opacity: 0;
    transform: rotate(-5deg) scale(0.95);
    transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Delays para animaciones */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
}
