/* ---
TABLE OF CONTENTS
1.  Reset y Variables Globales
2.  Estilos de Body y Utilitarios
3.  Header y Navegación Principal
4.  Menú Móvil
5.  Sección: Hero
6.  Sección: Áreas de Práctica (Carrusel)
7.  Sección: Estadísticas
8.  Sección: Descripción de la Firma y Alianzas
9.  Sección: Cita Destacada
10. Sección: Testimonios (Carrusel)
11. Sección: Sedes (Marquesina animada)
12. Sección: Contacto
13. Componentes: Botones, Paneles, Modales, etc.
14. Footer
15. Media Queries (Diseño Responsivo)
--- */

/* --- 1. Reset y Variables Globales --- */
:root {
    --header-h: 80px;
    --color-primario: #a4e47a;
    --color-fondo-oscuro: #071727;
    --color-fondo-tarjeta: #0d273a;
    --color-texto-principal: #FFFFFF;
    --color-texto-secundario: #bbbbbb;
    --gradiente-header: linear-gradient(to right, #043353, #033456, #071727);
    --gradiente-principal: linear-gradient(to bottom, #033456, #071727, #043353);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- 2. Estilos de Body y Utilitarios --- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--color-texto-principal);
    background: var(--gradiente-principal);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
    overflow: hidden;
}

main {
    padding-top: var(--header-h);
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- 3. Header y Navegación Principal --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    background: var(--gradiente-header);
    transition: transform 0.4s ease;
}

.main-header.hide {
    transform: translateY(-100%);
}

.header-logo img {
    width: 180px;
    display: block;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: border-bottom-color 0.3s ease;
}

.main-nav a:hover {
    border-bottom-color: var(--color-texto-principal);
}

.language-menu {
    position: relative;
}

.lang-selector {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.lang-dropdown {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 10px);
    background-color: #fff;
    color: #333;
    list-style: none;
    padding: 5px 0;
    margin-top: 10px;
    border-radius: 4px;
    min-width: 120px;
    z-index: 20;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.lang-dropdown a {
    display: block;
    padding: 8px 15px;
    transition: background-color 0.2s ease;
    color: #333;
    font-size: 0.9rem;
}

.lang-dropdown a:hover {
    background-color: #f0f0f0;
}

/* --- 4. Menú Móvil --- */
.mobile-nav-toggle {
    display: none;
    z-index: 1001;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger-icon {
    display: block;
    width: 30px;
    height: 2px;
    background-color: var(--color-texto-principal);
    position: relative;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.hamburger-icon::before, .hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-texto-principal);
    transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.hamburger-icon::before { top: -8px; }
.hamburger-icon::after { bottom: -8px; }

.mobile-nav-toggle.is-active .hamburger-icon { background-color: transparent; }
.mobile-nav-toggle.is-active .hamburger-icon::before { top: 0; transform: rotate(45deg); }
.mobile-nav-toggle.is-active .hamburger-icon::after { bottom: 0; transform: rotate(-45deg); }

.mobile-nav-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 52, 86, 0.98);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 35px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.mobile-nav-panel.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.mobile-nav-panel a {
    font-size: 1.5rem;
    font-weight: 500;
}

.mobile-nav-panel .lang-selector {
    font-size: 1.2rem;
}

/* --- 5. Sección: Hero --- */
.hero-section {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    text-align: center;
    min-height: 85vh; 
    padding-top: 40vh; 
    padding-left: 20px;
    padding-right: 20px;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: 0;
}

.background-video.mobile { display: none; }

.hero-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    z-index: 2;
}

.hero-phrase {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.hero-phrase.active {
    opacity: 1;
    visibility: visible;
}

.headline-highlight {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(to right, #79ba42, #a4e47a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.headline-secondary {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
    line-height: 1.4;
}

.headline-tertiary {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 3px;
    margin-top: 20px;
    opacity: 0.8;
}
/* --- 6. Sección: Áreas de Práctica (Carrusel) --- */
.areas-collage {
    padding: 80px 0;
    text-align: center;
}

.areas-collage h2,
.testimonials-title,
.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
}

.areas-collage-wrapper,
.testimonials-wrapper {
    position: relative;
    padding: 0 40px;
}

.collage-grid,
.testimonials-grid {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 20px 0;
    scrollbar-width: none; /* Firefox */
}
.collage-grid::-webkit-scrollbar,
.testimonials-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.collage-box {
    flex: 0 0 350px;
    margin: 0 10px;
    padding: 30px;
    background-color: var(--color-fondo-tarjeta);
    border-radius: 8px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
}

.collage-box:hover {
    transform: translateY(-5px);
    background-color: #123456;
}

.collage-box h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primario);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collage-box h3 i { font-size: 1.8rem; }
.collage-box p { font-size: 1rem; line-height: 1.6; flex-grow: 1; }
.collage-box .extra-info { display: none; }

/* --- 7. Sección: Estadísticas --- */
.stats-section {
    display: flex;
    flex-wrap: wrap;
}

.stat-box {
    flex: 1 1 25%;
    padding: 60px 20px;
    text-align: center;
}

.stat-box:nth-child(1) { background-color: rgba(46, 145, 177, 0.8); }
.stat-box:nth-child(2) { background-color: rgba(7, 58, 75, 0.8); }
.stat-box:nth-child(3) { background-color: rgba(43, 57, 71, 0.8); }
.stat-box:nth-child(4) { background-color: rgba(26, 26, 26, 0.8); }

.stat-number {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-description {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.8;
}

/* --- 8. Sección: Descripción de la Firma y Alianzas --- */
.firm-description {
    position: relative;
    color: var(--color-texto-principal);
    text-align: center;
    padding: 150px 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://i.imgur.com/8UzikvW.jpeg') no-repeat center center/cover;
}

.firm-description .content {
    position: relative;
    z-index: 2;
}

.firm-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.2;
}

.firm-text {
    font-size: 1.4rem;
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.8;
    opacity: 0.8;
}

.firm-link {
    font-size: 1rem;
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.firm-link:hover { color: var(--color-primario); }

.global-alliances {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
}

.global-alliances img {
    max-width: 150px;
    height: auto;
    object-fit: contain;
}

/* --- 9. Sección: Cita Destacada --- */
.quote-section {
    padding: 100px 20px;
    text-align: center;
}

.quote-content h2 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.quote-content h2 span[data-translate-key*="diamond_2"],
.quote-content h2 span[data-translate-key*="diamond_3"],
.quote-content h2 span[data-translate-key*="diamond_4"],
.quote-content h2 span[data-translate-key*="diamond_5"] {
    color: #a4e47a;
}

.quote-link {
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease;
    margin-top: 25px;
    opacity: 0.8;
}

.quote-link:hover {
    transform: scale(1.05);
    color: var(--color-primario)    ;
}

/* --- 10. Sección: Testimonios (Carrusel) --- */
.testimonials-section {
    padding: 80px 0;
    text-align: center;
    background: url('https://i.imgur.com/sKpJFHx.jpeg') no-repeat top center/cover;
}

.testimonials-title { color: #a4e47a; box-shadow: 0 4px 10px rgba(26, 26, 26, 0.8); background-color:rgba(26, 26, 26, 0.8) ;}

.testimonial-box {
    flex: 0 0 350px;
    margin: 0 10px;
    padding: 40px;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
}

.testimonial-box blockquote {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.testimonial-box::before {
    content: '“';
    font-family: Georgia, serif;
    font-size: 6em;
    color: rgba(255, 255, 255, 0.1);
    position: absolute;
    left: 15px;
    top: 0px;
    z-index: 1;
}

.testimonial-author { font-weight: 700; }
.testimonials-grid .testimonial-box:nth-child(odd) { background-color: rgba(46, 145, 177, 0.8); }
.testimonials-grid .testimonial-box:nth-child(even) { background-color: rgba(26, 26, 26, 0.8); }

/* --- 11. Sección: Sedes (Marquesina animada) --- */
.sedes { padding: 80px 0; overflow: hidden; }
.section-title { text-align: center; margin-bottom: 50px; }
.sedes-container {
    display: flex;
    width: fit-content;
}
.sedes-grid {
    display: flex;
    flex-shrink: 0;
    gap: 20px;
    animation: scroll-sedes 400s linear infinite;
}
@keyframes scroll-sedes {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.sede-card {
    flex: 0 0 auto;
    width: 280px;
    height: 350px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
    position: relative;
}
.sede-card:hover { transform: translateY(-10px) scale(1.03); }
.sede-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}
.sede-card:hover .sede-image { transform: scale(1.1); }
.sede-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(10, 26, 58, 0.95), transparent);
    transition: all 0.4s ease;
}
.sede-overlay h3 { font-size: 1.8rem; margin-bottom: 10px; }
.sede-info { max-height: 0; overflow: hidden; transition: max-height 0.5s ease; }
.sede-info p { color: var(--color-texto-secundario); }
.sede-card:hover .sede-info { max-height: 150px; }

/* --- 12. Sección: Contacto --- */
.contact { padding: 80px 40px; }
.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    margin-bottom: 60px;
}
.contact-header h2 { font-size: 5.6rem; }
.contact-logo img { width: 350px; }

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
}
.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}
.contact-icon {
    font-size: 1.5rem;
    color: var(--color-primario);
    width: 30px;
    text-align: center;
}
.contact-item h3 { font-size: 1.2rem; margin-bottom: 5px; }
.contact-item p { color: var(--color-texto-secundario); line-height: 1.6; }
.contact-form {
    background-color: var(--color-fondo-tarjeta);
    padding: 40px;
    border-radius: 10px;
    border: 1px solid rgba(7, 121, 202, 0.2);
}
.form-group { margin-bottom: 25px; }
.form-group label { display: block; margin-bottom: 10px; font-weight: 500; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #2a3b4c;
    border-radius: 5px;
    background-color: var(--color-fondo-oscuro);
    color: var(--color-texto-principal);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--color-primario);
    box-shadow: 0 0 10px rgba(7, 121, 202, 0.3);
}
.form-group textarea { min-height: 120px; resize: vertical; }

.social-icons { margin-top: 20px; }
.social-icons a { font-size: 24px; margin: 0 10px; transition: color 0.3s ease; }
.social-icons a:hover { color: var(--color-primario); }

/* --- 13. Componentes: Botones, Paneles, Modales, etc. --- */
.btn {
    display: inline-block;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    background-color: var(--color-primario);
    color: var(--color-texto-principal);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.btn:hover { background-color: #098ce1; transform: translateY(-3px); }

.leer-mas-btn {
    background: none;
    border: none;
    color: var(--color-primario);
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    padding: 0;
    font-size: 1rem;
    transition: color 0.3s ease;
}
.leer-mas-btn:hover { color: var(--color-texto-principal); }

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 10px;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.carousel-button:hover { opacity: 1; }
.carousel-button.prev { left: 0; border-radius: 0 8px 8px 0; }
.carousel-button.next { right: 0; border-radius: 8px 0 0 8px; }

.whatsapp-float-btn {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
.whatsapp-float-btn:hover { transform: scale(1.1); }

.side-panel-overlay,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1008;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.side-panel-overlay.is-visible,
.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.side-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 450px;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    z-index: 1009;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}
.side-panel.is-visible { right: 0; }

.close-panel-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
}
.side-panel .close-panel-btn { color: var(--color-primario); }
.modal .modal-close-btn { color: #888; }
.close-panel-btn:hover, .modal-close-btn:hover { opacity: 1; transform: rotate(90deg); }

.panel-content {
    padding: 70px 40px 40px 40px;
    overflow-y: auto;
    height: 100%;
    color: #333;
}
.panel-content h3 { font-size: 1.8rem; color: var(--color-primario); margin-bottom: 25px; }
.panel-content p { font-style: italic; margin-bottom: 25px; line-height: 1.6; }
.panel-content ul { list-style: none; }
.panel-content ul li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.5;
}
.panel-content ul li::before {
    content: "•";
    color: var(--color-primario);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background-color: #fff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    z-index: 2001;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.modal.is-visible { opacity: 1; visibility: visible; }
.modal-content { padding: 30px 40px; }
.modal-content h2 { color: #033456; margin-bottom: 20px; }
.modal-content p, .modal-content li { line-height: 1.6; margin-bottom: 15px; }
.modal-content ol { padding-left: 20px; }

/* --- 14. Footer --- */
.main-footer {
    background-color: var(--color-fondo-oscuro);
    color: var(--color-texto-secundario);
    text-align: center;
    padding: 25px 20px;
    font-size: 0.9rem;
    border-top: 1px solid var(--color-fondo-tarjeta);
}
.main-footer a { color: var(--color-texto-principal); text-decoration: underline; cursor: pointer; }
.main-footer a:hover { color: var(--color-primario); }

/* --- 15. Media Queries (Diseño Responsivo) --- */
@media (min-width: 992px) {
    .headline-highlight { font-size: 5rem; }
    .headline-secondary { font-size: 2.4rem; }
    .headline-tertiary { font-size: 1.2rem; }
}

@media (max-width: 1200px) {
    .contact-container { grid-template-columns: 1fr; }
    .firm-title { font-size: 3rem; }
}

@media (max-width: 992px) {
    .main-header { padding: 10px 20px; }
    .main-nav { display: none; }
    .mobile-nav-toggle { display: block; }
}

@media (max-width: 768px) {
    .background-video.desktop { display: none; }
    .background-video.mobile { display: block; }
    .hero-section { min-height: 70vh; }
    .headline-highlight { font-size: 2rem; }
    .headline-secondary { font-size: 1.2rem; }

    .areas-collage-wrapper, .testimonials-wrapper { padding: 0 15px; }
    .collage-box, .testimonial-box { flex: 0 0 85%; }

    .collage-grid, .testimonials-grid { scroll-snap-type: x mandatory; }
    .collage-box, .testimonial-box { scroll-snap-align: center; }

    .stat-box { flex: 1 1 50%; }
    .stat-number { font-size: 3rem; }
    .stat-description { font-size: 1rem; }
    
    .firm-description { padding: 100px 15px; }
    .firm-title { font-size: 2.5rem; }
    .firm-text { font-size: 1.2rem; }

    .quote-section { padding: 80px 25px; }
    .quote-content h2 { font-size: 1.8rem; }
    .quote-content p { font-size: 0.9rem; }

    /* --- INICIO: Cambios para Carrusel de Sedes en Móvil --- */
    .sedes-container {
        overflow-x: auto; /* Permite el desplazamiento táctil */
        scroll-snap-type: x mandatory; /* Activa el "snap" para que se centre en las tarjetas */
        
        /* Oculta la barra de scroll visual para un diseño más limpio */
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    .sedes-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari, and Opera */
    }
    .sedes-grid {
        /* Desactiva la animación de marquesina */
        padding: 0 20px; /* Añade espacio en los bordes para que no se peguen las tarjetas */
    }
    .sedes-grid + .sedes-grid {
        display: none; /* Oculta la segunda rejilla (duplicada para la animación) */
    }
    .sede-card {
        scroll-snap-align: center; /* Alinea cada tarjeta al centro durante el snap */
    }
    /* --- FIN: Cambios para Carrusel de Sedes en Móvil --- */
    
    .contact { padding: 60px 20px; }

    .contact-header {
        flex-direction: column-reverse;
        gap: 25px;
    }
    .contact-header h2 {
        font-size: 2.5rem;
    }
    .contact-header .contact-spacer {
        display: none;
    }
}

@media (max-width: 480px) {
    .stat-box { flex: 1 1 100%; }
}