:root {
    --primary-blue: #2c5282;
    --primary-dark-blue: #1f2937;
    --accent-teal: #319795;
    --secondary-white: #FFFFFF;
    --neutral-light-gray: #F4F6F9;
    --text-color: #333;
    --font-main: 'Montserrat', sans-serif;
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --pill-text-inactive: #ffffff; 
}

/* --- Estilos Globales --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--secondary-white); /* Color de fondo base para el contenido */
    font-size: 16px;
    line-height: 1.8;
    font-weight: 400;
}

/* --- Fondo Animado --- */
@keyframes slide {
    0% { transform: translateX(-25%); }
    100% { transform: translateX(25%); }
}

/* Capa 1: Combina el teal (#319795) y el azul (#2c5282) */
.bg {
    animation: slide 3s ease-in-out infinite alternate;
    background-image: linear-gradient(-60deg, #319795 50%, #2c5282 50%);
    bottom: 0;
    left: -50%;
    opacity: .5;
    position: fixed;
    right: -50%;
    top: 0;
    z-index: -1;
}

/* Capa 2: Combina el azul (#2c5282) y el azul oscuro (#1f2937) */
.bg2 {
    animation-direction: alternate-reverse;
    animation-duration: 4s;
    background-image: linear-gradient(-60deg, #2c5282 50%, #1f2937 50%);
}

/* Capa 3: Combina el blanco (#FFFFFF) y el teal (#319795) */
.bg3 {
    animation-duration: 5s;
    background-image: linear-gradient(-60deg, #FFFFFF 50%, #319795 50%);
}


/* --- Estilos del Hero y Animación de Carga --- */
.hero-section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: transparent; /* Hacer transparente para ver el fondo animado */
    text-align: center;
    color: #2c5282;
    overflow: hidden;
    padding-top: 100px;
}

.hero-section .hero-content { 
    position: relative; 
    z-index: 1;
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

.hero-section .logo { position: relative; font-weight: 800; display: flex; justify-content: center; align-items: center; line-height: 1; }
.hero-section .logo span { display: inline-block; position: relative; opacity: 0; text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.3); font-size: clamp(8rem, 25vw, 15rem); }
.hero-section .logo .p { animation: slideInLeft 1.2s ease-in-out forwards; z-index: 2; }
.hero-section .logo .m { animation: slideInRight 1.2s ease-in-out forwards; animation-delay: 0.2s; margin-left: -2.25rem; }
.hero-section .text { margin-top: 1rem; opacity: 0; animation: fadeInUp 1s ease forwards; animation-delay: 1.5s; }
.hero-section .text h1, .hero-section .text h2 { color: #2c5282; text-shadow: 1px 2px 6px rgba(0, 0, 0, 0.4); }
.hero-section .text h1 { margin: 0; font-weight: 600; font-size: clamp(1.5rem, 5vw, 2.5rem); letter-spacing: 0.2rem; }
.hero-section .text h2 { margin: 0; font-weight: 400; font-size: clamp(1rem, 3vw, 1.25rem); letter-spacing: 0.3rem; margin-top: 0.5rem; }
@keyframes slideInLeft { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeInUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Navegación tipo pill para desktop --- */
.pill-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-dark-blue);
    border-radius: 50px;
    padding: 6px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.5s forwards;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    max-width: 95vw;
    overflow-x: auto;
    scrollbar-width: none;
}
.pill-nav::-webkit-scrollbar { display: none; }
.nav-item-container { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav-link { background-color: transparent; color: var(--pill-text-inactive); padding: 8px 20px; border-radius: 40px; text-decoration: none; font-family: var(--font-main); font-weight: 600; transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease; flex-shrink: 0; }
.nav-link:hover, .nav-link.active { background-color: var(--primary-blue); color: var(--secondary-white); transform: translateY(-2px); }
.nav-logo-placeholder { width: 36px; height: 36px; display: flex; justify-content: center; align-items: center; overflow: hidden; flex-shrink: 0; }
.nav-logo-img { width: 100%; height: 100%; object-fit: contain; }

/* --- Estilos para Iconos y Texto en Nav --- */
.mobile-icon {
    display: none; /* Oculto por defecto en desktop */
}

/* --- Estilos Generales de Contenido --- */
#main-content { position: relative; z-index: 1; background-color: var(--secondary-white); }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; color: var(--primary-blue); font-weight: 700; }
h3 { font-size: 1.5rem; color: var(--primary-dark-blue); margin-bottom: 1rem; font-weight: 600; }
.content-section { padding: 5rem 2rem; position: relative; overflow: hidden; }
#contacto { padding: 0; } /* Reset padding for full-width map */
.alternate-bg { background-color: var(--neutral-light-gray); }

/* --- Contenedores de contenido (para z-index) --- */
.firm-about-container, .practice-grid-container-wrapper, .faq-container-wrapper {
    position: relative;
    z-index: 1;
}

/* --- Animaciones de Scroll --- */
.reveal-fade, .reveal-up, .image-reveal-blur, .reveal-scale, .reveal-left, .reveal-right { opacity: 0; transition: opacity 0.8s ease-out, transform 0.8s ease-out, filter 1.2s ease-out; }
.reveal-up { transform: translateY(40px); }
.reveal-scale { transform: scale(0.8); }
.reveal-left { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }
#main-content .reveal-fade.is-visible, #main-content .reveal-up.is-visible, #main-content .image-reveal-blur.is-visible, #main-content .reveal-scale.is-visible, #main-content .reveal-left.is-visible, #main-content .reveal-right.is-visible { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
.image-reveal-blur { filter: blur(15px); }
#main-content .image-reveal-blur.is-visible { filter: blur(0); }

/* --- "Sobre la Firma" --- */
.firm-about-container { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; max-width: 1200px; margin: 0 auto; }
.firm-about-text h2 { text-align: left; }
.firm-about-image img { width: 100%; height: auto; border-radius: 10px; object-fit: cover; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

/* --- "Áreas de Práctica" Grid --- */
.practice-grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; max-width: 1200px; margin: 0 auto; }
.practice-card { background-color: var(--secondary-white); padding: 2rem 1.5rem; border: 1px solid #e2e8f0; border-radius: 8px; text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.practice-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(44, 82, 130, 0.1); }
.practice-card i { font-size: 2.5rem; color: var(--accent-teal); margin-bottom: 1rem; transition: transform 0.3s ease; }
.practice-card:hover i { transform: translateY(-5px) scale(1.1); }
.practice-card p { font-weight: 500; line-height: 1.6; }

/* --- Sección de Contacto (Diseño UNIFICADO para Desktop y Móvil) --- */
#contacto .map-background {
    display: none; /* Se remueve el mapa de fondo en todas las vistas */
}

.contact-panel-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
    padding: 5rem 2rem; /* Mantener padding original para desktop */
    background-color: var(--primary-blue); /* Fondo azul para todas las vistas */
}
.contact-panel-wrapper h2 {
    color: var(--secondary-white);
    text-shadow: none; /* No necesitamos sombra con este fondo */
}
.contact-subtitle {
    color: var(--secondary-white);
    text-align: center;
    max-width: 600px;
    margin-top: -1rem; /* Ajuste para el espaciado del subtítulo */
    margin-bottom: 3rem; /* Más espacio debajo del subtítulo */
    font-size: 1.1rem;
    text-shadow: none;
}
.contact-panel {
    width: 100%;
    max-width: 1100px;
    background-color: transparent; /* El panel es transparente, las opciones tienen su propio fondo */
    backdrop-filter: none;
    border-radius: 0; /* No necesitamos bordes redondeados aquí */
    padding: 0; /* Resetear padding */
    box-shadow: none;
}
.contact-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem; /* Ajuste de gap para un look más compacto */
}
.contact-option {
    background-color: var(--secondary-white);
    padding: 2rem; /* Padding base para desktop */
    border-radius: 12px;
    text-align: center;
    border: none; /* Eliminamos el borde */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Sombra consistente */
}
.contact-option:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2); /* Sombra más pronunciada en hover */
}
.contact-option i {
    font-size: 2.5rem;
    color: var(--accent-teal); /* Color de acento para los iconos */
    margin-bottom: 1rem;
}
.contact-option h3 {
    margin-bottom: 0.8rem; /* Espaciado ajustado */
    font-size: 1.4rem;
    color: var(--primary-dark-blue);
}
.contact-option address, .contact-option p {
    font-style: normal;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-color); /* Aseguramos que el texto sea legible */
}
.contact-option a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}
.contact-option a:hover {
    color: var(--primary-blue);
}
.contact-option .whatsapp-button, .contact-option .map-button {
    color: var(--secondary-white);
    padding: 12px 24px;
    border-radius: 50px;
    display: inline-block;
    font-weight: 600;
    margin-top: 0.5rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.contact-option .whatsapp-button {
    background-color: #25D366;
}
.contact-option .map-button {
    background-color: var(--primary-blue);
}
.contact-option .map-button:hover {
    background-color: var(--primary-dark-blue);
}


/* --- FAQ y Footer --- */
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid #e0e0e0; }
.faq-question { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 0; cursor: pointer; font-weight: 500; font-size: 1.1rem; color: var(--primary-dark-blue); }
.faq-question i { transition: transform 0.3s ease; color: var(--primary-blue); }
.faq-item.active .faq-question i { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }
.faq-answer p { padding-bottom: 1.5rem; color: var(--text-color); }

#footer { 
    background-color: var(--primary-dark-blue); 
    color: #ccc; 
    text-align: center; 
    padding: 1.5rem; 
    font-size: 0.9rem; 
}

/* Estilos para el enlace de Ollintem en el footer */
#footer a {
    color: var(--accent-teal); /* Color verde turquesa */
    text-decoration: none;
    font-weight: 600; /* Para que sea más llamativo */
    transition: color 0.3s ease, transform 0.2s ease;
    display: inline-block; /* Para aplicar transformaciones */
}

#footer a:hover {
    color: var(--secondary-white); /* Color blanco al pasar el cursor */
    transform: translateY(-2px) scale(1.05); /* Pequeña elevación y escala */
}

#footer a:active {
    color: var(--primary-blue); /* Color azul primario al hacer click */
    transform: translateY(1px) scale(0.95); /* Pequeño "hundimiento" */
    transition: color 0.1s ease, transform 0.1s ease; /* Transición más rápida para el click */
}


/* --- Media Queries para Responsividad --- */
/* Para pantallas más pequeñas que 992px (ej. tablets y móviles) */
@media (max-width: 992px) {
    /* Navegación (pill-nav) */
    .pill-nav {
        width: calc(100% - 40px);
        max-width: 500px;
        padding: 6px;
        gap: 0; 
    }
    .nav-item-container { 
        width: 100%; 
        gap: 0; 
        justify-content: space-around; 
    }
    .nav-link { 
        padding: 8px 12px; 
        font-size: 1.2rem;
    }
    .nav-logo-placeholder { width: 32px; height: 32px; }

    .desktop-text {
        display: none;
    }
    .mobile-icon {
        display: inline-block;
    }

    /* Nuestra Firma */
    .firm-about-container { 
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .firm-about-text {
        /* No se necesita alineación aquí, se aplicará a los hijos */
    }
    .firm-about-text h2 { 
        text-align: center; 
    }
    .firm-about-text h3 {
        text-align: center;
        margin-top: 2.5rem;
    }
    .firm-about-text p {
        text-align: justify;
        line-height: 1.9;
    }
    .firm-about-image { 
        display: none;
    }

    /* Áreas de Práctica */
    .practice-grid-container { 
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
        padding: 0 1rem;
    }
    .practice-card { padding: 1.5rem 1rem; }
    .practice-card i { font-size: 2rem; }
    .practice-card p { font-size: 0.9rem; }

    /* Contacto Directo (Ajustes para móvil/tablet) */
    .contact-panel-wrapper {
        padding: 3rem 1.5rem; /* Reducir padding en móvil */
    }
    .contact-subtitle {
        margin-bottom: 2rem; /* Ajuste para móvil */
    }
    .contact-options-grid {
        grid-template-columns: 1fr; /* Una columna en móvil */
        gap: 1rem; /* Cajas más juntas */
    }
    .contact-option {
        padding: 1.25rem; /* Cajas más pequeñas */
    }
    .contact-option i {
        font-size: 2rem; /* Iconos más pequeños en móvil */
    }
    .contact-option h3 { 
        font-size: 1.1rem;
    }
    .contact-option p, .contact-option address {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }
    .contact-option .whatsapp-button, .contact-option .map-button {
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    /* Preguntas Frecuentes */
    .faq-container-wrapper {
        padding: 0 1rem;
    }
    .faq-container {
        max-width: 600px;
        margin: 0 auto;
    }
    .faq-question { font-size: 1rem; padding: 1.2rem 0; }
    .faq-answer p { font-size: 0.95rem; padding-bottom: 1.2rem; }

    /* Otros ajustes generales */
    h2 { font-size: 2rem; margin-bottom: 2rem; }
    h3 { font-size: 1.3rem; }
    .content-section { padding: 3rem 1rem; }
}

/* Para pantallas aún más pequeñas (ej. smartphones pequeños) */
@media (max-width: 576px) {
    .pill-nav {
        width: calc(100% - 30px);
        padding: 5px;
    }
    .nav-link { padding: 7px 10px; }
    .nav-logo-placeholder { width: 28px; height: 28px; }

    .hero-section .logo span { font-size: clamp(6rem, 20vw, 10rem); }
    .hero-section .logo .m { margin-left: -1.5rem; }
    .hero-section .text h1 { font-size: clamp(1.2rem, 4vw, 2rem); }
    .hero-section .text h2 { font-size: clamp(0.9rem, 2.5vw, 1.1rem); }

    .practice-grid-container {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.8rem;
    }
    .practice-card { padding: 1rem 0.8rem; }
    .practice-card i { font-size: 1.8rem; margin-bottom: 0.8rem; }
    .practice-card p { font-size: 0.85rem; }

    /* Ajustes finos para Contacto en pantallas pequeñas */
    .contact-panel-wrapper {
        padding: 2.5rem 1rem;
    }
    .contact-option {
        padding: 1rem;
    }
    .contact-option i {
        font-size: 2rem;
    }
    .contact-option h3 {
        font-size: 1rem;
    }
    .contact-option a { 
        font-size: 0.9rem;
    }
    .contact-option .whatsapp-button, .contact-option .map-button {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }


    .faq-question { font-size: 0.95rem; padding: 1rem 0; }
    .faq-answer p { font-size: 0.9rem; padding-bottom: 1rem; }

    h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }
    h3 { font-size: 1.2rem; }
    .content-section { padding: 2.5rem 0.8rem; }
}

/* Para navegaciones con poco espacio */
@media (max-width: 400px) {
    .nav-link {
        padding: 6px 8px;
    }
    .nav-logo-placeholder {
        width: 25px;
        height: 25px;
    }
}