@charset "UTF-8";

/* Paleta de Colores - Espinoza-Negrete & Asociados */
:root {
    --azul-profundo: #092543;
    --azul-medio: #1d4a7e;
    --dorado-elegante: #e5c56a;
    --dorado-claro: #dcc39a;
    --gris-oscuro: #555555;
    --gris-claro: #f5f5f5;
    --blanco-puro: #ffffff;
}

/* Base styles con font-display para prevenir CLS */
body {
    font-family: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--blanco-puro);
    color: var(--gris-oscuro);
    line-height: 1.6;
    /* CRÍTICO: Prevenir scroll horizontal y CLS */
    overflow-x: hidden;
    min-height: 100vh;
}

/* Service cards con altura fija para prevenir CLS */
.service-card-3d {
    background-color: var(--azul-profundo);
    color: var(--blanco-puro);
    padding: 2rem;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    /* CRÍTICO: Altura exacta para prevenir CLS */
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    /* Optimización para animaciones */
    will-change: transform;
}

.service-card-3d:hover {
    transform: translateY(-10px) rotateY(5deg) scale(1.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    background-color: var(--azul-medio);
}

.service-card-3d h3 {
    color: var(--dorado-elegante);
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.service-card-3d .service-description {
    font-size: 1.2rem;
    color: var(--gris-claro);
    line-height: 1.4;
}

/* Mobile optimizations para service grid */
@media (max-width: 819px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
        min-height: 300px;
    }
    
    .service-card-3d {
        min-height: 180px;
        padding: 1.5rem;
    }
    
    .service-card-3d h3 {
        font-size: 1.3rem;
    }
    
    .service-card-3d .service-description {
        font-size: 1.1rem;
    }
}

/* --- Contact Page Styles con dimensiones fijas --- */
.contact-section {
    padding: 2rem 1rem;
    min-height: 500px; /* Altura mínima reservada */
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

.contact-info h3, .contact-form h3 {
    color: var(--azul-profundo);
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.contact-info p {
    font-size: 1.1rem;
    line-height: 1.7;
}

.map-container {
    margin-top: 2rem;
    /* Altura fija para iframe */
    height: 300px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--gris-oscuro);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box; /* Prevenir overflow */
}

.call-to-action {
    display: inline-block;
    background-color: var(--dorado-elegante);
    color: var(--azul-profundo);
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.call-to-action:hover {
    background-color: #dcc39a;
}

@media (max-width: 820px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-section {
        min-height: 400px;
    }
    
    .map-container {
        height: 250px;
    }
}

/* --- Footer Styles con altura consistente --- */
.main-footer {
    background-color: var(--azul-profundo);
    color: var(--gris-claro);
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 2rem;
    min-height: 120px; /* Altura mínima fija */
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
}

.social-media-links {
    margin-bottom: 1rem;
}

.social-media-links a {
    color: var(--blanco-puro);
    margin: 0 0.75rem;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block; /* Prevenir movimiento */
}

.social-media-links a:hover {
    color: var(--dorado-elegante);
}

.social-media-links img {
    width: 42px;
    height: 42px;
    vertical-align: middle;
}

.footer-copyright p {
    margin: 0;
    font-size: 1rem;
}

/* --- Accordion Styles con dimensiones optimizadas --- */
.accordion-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.accordion-item {
    border-bottom: 1px solid #ddd;
    /* Altura mínima para consistencia */
    min-height: 60px;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-title {
    display: block;
    width: 100%;
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--azul-profundo);
    background-color: var(--blanco-puro);
    border: none;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
    /* Altura mínima fija */
    min-height: 60px;
    box-sizing: border-box;
}

.accordion-title::after {
    content: '+';
    font-size: 2rem;
    color: var(--dorado-elegante);
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.accordion-item[open] .accordion-title {
    background-color: var(--gris-claro);
}

.accordion-item[open] .accordion-title::after {
    transform: translateY(-50%) rotate(45deg);
}

.accordion-content {
    padding: 0 1.5rem 1.5rem;
    background-color: var(--gris-claro);
    /* Transición suave para expansión */
    animation: accordionOpen 0.3s ease-out;
}

@keyframes accordionOpen {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.accordion-content h4 {
    font-size: 1.2rem;
    color: var(--azul-medio);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.accordion-content p {
    font-size: 1rem;
    line-height: 1.6;
}

/* --- CTA Button para Servicios Page --- */
.cta-servicios-container {
    text-align: center;
    margin: 3rem 0 1rem 0;
    min-height: 80px; /* Altura reservada */
}

.cta-button-servicios {
    display: inline-block;
    background-color: var(--azul-profundo);
    color: var(--dorado-elegante);
    padding: 1rem 2rem;
    border-radius: 25px;
    border: 2px solid var(--azul-profundo);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.3rem;
    line-height: 1.4;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-width: 200px; /* Ancho mínimo */
}

.cta-button-servicios:hover {
    background-color: var(--blanco-puro);
    color: var(--azul-profundo);
}

/* --- Landing Page: Escrituras con optimizaciones CLS --- */
.landing-page-body {
    background-color: var(--gris-claro);
}

.landing-header {
    background-color: #092543;
    padding: 1rem 0;
    border-bottom: 1px solid var(--azul-profundo);
    min-height: 100px; /* Altura fija */
}

.landing-main {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--blanco-puro);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-height: 800px; /* Altura mínima */
}

.landing-hero {
    background: var(--azul-profundo);
    color: var(--blanco-puro);
    padding: 4rem 2rem;
    text-align: center;
    min-height: 300px; /* Altura mínima */
}

.landing-hero h1 {
    font-family: 'EB Garamond', serif;
    font-size: 3rem;
    color: var(--dorado-elegante);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.landing-hero .subtitle {
    font-size: 1.3rem;
    color: var(--gris-claro);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.5;
}

.symptoms-section {
    padding: 3rem 2rem;
    text-align: center;
    background-color: var(--blanco-puro);
    min-height: 400px; /* Altura mínima */
}

.symptoms-section h2 {
    font-size: 2.2rem;
    color: var(--azul-profundo);
    margin-bottom: 2.5rem;
}

.symptoms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    min-height: 200px; /* Altura mínima */
}

.symptom-item {
    text-align: center;
    min-height: 150px; /* Altura mínima */
}

.symptom-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    height: 60px; /* Altura fija para emojis */
    line-height: 60px;
}

.symptom-item h3 {
    font-size: 1.4rem;
    color: var(--azul-medio);
    margin-bottom: 0.5rem;
}

.solution-section {
    background-color: var(--azul-profundo);
    color: var(--gris-claro);
    padding: 4rem 2rem;
    text-align: center;
    min-height: 300px; /* Altura mínima */
}

.solution-content {
    max-width: 700px;
    margin: 0 auto;
}

.solution-content h2 {
    font-family: 'EB Garamond', serif;
    font-size: 2.5rem;
    color: var(--dorado-elegante);
    margin-bottom: 1rem;
}

.solution-content p {
    font-size: 1.2rem;
    line-height: 1.7;
}

.form-section {
    background-color: var(--gris-claro);
    padding: 3rem 2rem;
    text-align: center;
    min-height: 400px; /* Altura mínima */
}

.form-section h3 {
    font-size: 2.2rem;
    color: var(--azul-profundo);
    margin-bottom: 0.5rem;
}

.form-section p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.landing-form {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.landing-form .call-to-action {
    width: 100%;
    padding: 1rem;
    font-size: 1.3rem;
    box-sizing: border-box;
}

/* Mobile adjustments para landing page */
@media (max-width: 819px) {
    .landing-hero {
        padding: 3rem 1.5rem;
        min-height: 250px;
    }
    
    .landing-hero h1 {
        font-size: 2.5rem;
    }
    
    .landing-hero .subtitle {
        font-size: 1.1rem;
    }
    
    .symptoms-section, .solution-section, .form-section {
        padding: 2.5rem 1.5rem;
    }
    
    .symptoms-section {
        min-height: 350px;
    }
    
    .symptoms-section h2, .solution-content h2, .form-section h3 {
        font-size: 1.8rem;
    }
    
    .symptoms-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .symptom-item {
        min-height: 120px;
    }
}

/* Optimizaciones adicionales para prevenir CLS */
img {
    max-width: 100%;
    height: auto;
}

/* Contenedor para evitar overflow horizontal */
* {
    box-sizing: border-box;
}

/* Optimización de transiciones para mejor rendimiento */
.service-card-3d,
.accordion-title,
.nav-content {
    transform: translateZ(0); /* Forzar compositing layer */
}

/* --- Lead Magnet Section --- */
.lead-magnet-section {
    background-color: var(--gris-claro);
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.lead-magnet-section h2 {
    font-size: 2.2rem;
    color: var(--azul-profundo);
    margin-bottom: 1rem;
}

.lead-magnet-section p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 1.5rem auto;
}

.pdf-preview {
    background: var(--blanco-puro);
    border: 2px dashed var(--dorado-claro);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 500px;
}

.pdf-icon {
    font-size: 3.5rem;
    color: var(--azul-medio);
}

.pdf-info h3 {
    color: var(--azul-profundo);
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
}

.pdf-info p {
    color: var(--gris-oscuro);
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    text-align: left;
}

.cta-oro {
    background-color: var(--dorado-elegante);
    color: var(--azul-profundo);
    font-size: 1.3rem;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: 2px solid var(--dorado-elegante);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.cta-oro:hover {
    background-color: var(--dorado-claro);
    color: var(--azul-profundo);
    transform: translateY(-3px);
}


/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(9, 37, 67, 0.8);
    animation: fadeIn 0.3s ease;
    /* New centering and scrolling method */
    display: flex;
    align-items: flex-start; /* Align to top */
    justify-content: center;
    overflow-y: auto; /* Make the whole overlay scrollable */
    padding: 5vh 1rem; /* Add vertical padding */
}

.modal-content {
    background-color: var(--blanco-puro);
    /* margin: 10% auto; <-- Eliminado para el centrado con Flexbox */
    padding: 2.5rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideIn 0.4s ease-out;
    max-height: 90vh; /* Limita la altura al 90% de la pantalla */
    overflow-y: auto; /* Agrega scroll si el contenido se desborda */
}

.close {
    color: var(--gris-oscuro);
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--azul-profundo);
}

.modal-content h3 {
    color: var(--azul-profundo);
    font-family: 'EB Garamond', serif;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--gris-oscuro);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
    .pdf-preview {
        flex-direction: column;
        text-align: center;
    }
    .pdf-info p {
        text-align: center;
    }
}6;
    /* Prevenir scroll horizontal */
    overflow-x: hidden;
}

/* Logo container con dimensiones fijas */
.logo-container {
    background-color: #092543;
    padding: 1rem 0;
    border-bottom: 1px solid var(--azul-profundo);
    min-height: 80px; /* Altura fija para prevenir CLS */
    display: flex;
    align-items: center;
}

.logo-link {
    display: block;
    text-decoration: none;
    width: 100%;
}

.logo-video {
    display: block;
    margin: 0 auto;
    max-width: 350px;
    width: 80%;
    height: auto;
    /* Dimensiones explícitas para prevenir CLS */
    aspect-ratio: 16 / 9;
    min-height: 60px;
    animation: fadeIn 1.5s ease-in-out;
}

/* Header con altura fija */
header {
    text-align: center;
    padding: 1.5rem 1rem;
    background-color: var(--azul-profundo);
    min-height: 180px; /* Altura fija para prevenir CLS */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header h1 {
    font-family: 'EB Garamond', Georgia, serif;
    margin: 0;
    font-size: 1.1rem;
    color: var(--dorado-elegante);
    line-height: 1.2;
    font-display: swap; /* Prevenir FOUT */
}

header p {
    margin-top: 0.5rem;
    font-family: 'Great Vibes', cursive, serif;
    font-weight: 400;
    font-style: normal;
    font-size: 2rem;
    margin: 0;
    padding: 0;
    background-color: var(--azul-profundo);
    line-height: 1.5;
    color: var(--dorado-elegante);
    font-display: swap; /* Prevenir FOUT */
}

/* Main sections con padding consistente */
main section {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--blanco-puro);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

main section h2 {
    font-size: 2rem;
    color: var(--azul-profundo);
    border-bottom: 2px solid var(--dorado-elegante);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

main section ul {
    list-style-type: none;
    padding: 0;
}

main section li {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

header a {
    color: var(--dorado-elegante);
    text-decoration: none;
    font-weight: bold;
}

@keyframes fadeIn {
    from { opacity: 0; } 
    to { opacity: 1; }
}

/* --- Estilos del Menú de Navegación con altura fija --- */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #092543;
    padding: 0.75rem 1rem;
    min-height: 60px; /* Altura fija */
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Prevenir movimiento durante animaciones */
    contain: layout;
}

.nav-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #092543e6;
    backdrop-filter: blur(5px);
    flex-direction: column;
    align-items: center;
    padding-bottom: 1rem;
    /* Prevenir CLS durante animación */
    will-change: transform;
}

.main-nav.is-open .nav-content {
    display: flex;
}

.nav-center,
.nav-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.nav-center a {
    color: var(--blanco-puro);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 1rem 0;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.3s ease;
}

.nav-center a:hover,
.nav-center a.active {
    color: var(--dorado-elegante);
}

.nav-right {
    padding: 1rem 0;
    flex-direction: row;
    justify-content: center;
}

.call-button {
    background-color: var(--dorado-elegante);
    color: var(--azul-profundo) !important;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-left: 1rem;
}

.call-button:hover {
    background-color: var(--dorado-claro);
}

.whatsapp-link img {
    height: 30px;
    width: 30px; /* Dimensión explícita */
    vertical-align: middle;
}

.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-line {
    width: 2rem;
    height: 0.25rem;
    background-color: var(--blanco-puro);
    border-radius: 10px;
    transition: all 0.3s linear;
}

.main-nav.is-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.main-nav.is-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.main-nav.is-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* --- Estilos para Escritorio --- */
@media (min-width: 820px) {
    .main-nav .logo-link, 
    .hamburger-menu {
        display: none;
    }

    .main-nav {
        justify-content: center;
    }

    .nav-content {
        display: flex;
        position: static;
        flex-direction: row;
        width: auto;
        background-color: transparent;
        backdrop-filter: none;
        padding: 0;
    }

    .nav-center, .nav-right {
        flex-direction: row;
        width: auto;
    }

    .nav-center a {
        padding: 0;
        border: none;
        font-size: 1.1rem;
        margin: 0 1rem;
    }

    .nav-right {
        padding: 0;
        margin-left: 2rem;
    }
}

/* Image containers con dimensiones fijas */
.image-display-section, .image-container {
    height: 60vh;
    min-height: 400px; /* Altura mínima garantizada */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    /* Color de placeholder */
    background-color: var(--azul-profundo);
}

@media (max-width: 819px) {
    .image-display-section, .image-container {
        background-attachment: scroll;
        height: 40vh;
        min-height: 250px;
    }
    
    header {
        min-height: 150px;
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 2.2rem;
    }
    
    .logo-video {
        max-width: 280px;
        min-height: 50px;
    }
}

/* --- Service Grid Section con dimensiones reservadas --- */
.services-grid-container {
    text-align: center;
    padding: 2rem 1rem;
    /* Altura mínima para prevenir CLS */
    min-height: 600px;
}

.services-grid-container p {
    font-size: 1.9rem;
    font-weight: bold;
    color: var(--azul-profundo);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 1rem auto;
    perspective: 1000px;
    justify-content: center;
    /* Altura mínima reservada */
    min-height: 400px;
}

/* === Icono Flotante de WhatsApp === */
.whatsapp-flotante {
    position: fixed;
    width: 4rem; /* Ajustado al tamaño del ícono */
    height: 4rem; /* Ajustado al tamaño del ícono */
    bottom: 25px;
    right: 25px;
    background-color: transparent; /* Sin fondo */
    z-index: 1000;
    transition: transform 0.3s ease;
}

.whatsapp-flotante:hover {
    transform: scale(1.1);
}

.whatsapp-flotante img {
    width: 4rem; /* Tamaño solicitado por el usuario */
    height: 4rem; /* Tamaño solicitado por el usuario */
    /* Sombra sutil para que el ícono no se pierda en el fondo */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}