/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================================================== */
:root {
    --verde: #d4e555;
    --negro: #000000;
    --negro-suave: #0b0b0b;
    --gris-oscuro: #1a1a1a;
    --gris-texto: #888888;
    --blanco: #ffffff;
    --transicion: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --shadow-premium: 0 20px 40px rgba(0,0,0,0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* BLOQUEO ESTRICTO DE DESBORDAMIENTO HORIZONTAL PARA MÓVILES */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background: var(--blanco);
    color: var(--negro);
    -webkit-font-smoothing: antialiased;
}

/* Enlaces y Textos Globales */
a { text-decoration: none !important; color: inherit; outline: none; transition: var(--transicion); }
h1, h2, h3, h4, p { overflow-wrap: break-word; word-wrap: break-word; } /* Evita que textos largos rompan la pantalla */
.justify-text { text-align: justify; }
.italic { font-style: italic; }
.p-spacing { margin-bottom: 35px; }
.text-white { color: var(--blanco) !important; }
.text-highlight { color: var(--verde) !important; }

/* Contenedores */
.container { max-width: 1300px; margin: 0 auto; width: 90%; }
.section-padding { padding: 100px 0; }
.bg-dark { background-color: var(--negro-suave); color: var(--blanco); }

/* --- HEADER Y NAVEGACIÓN --- */
header { position: fixed; top: 0; left: 0; width: 100%; padding: 30px 0; z-index: 1000; transition: var(--transicion); }
header.scrolled { background: rgba(0, 0, 0, 0.95); padding: 15px 0; backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.navbar { display: flex; justify-content: space-between; align-items: center; max-width: 1300px; margin: 0 auto; width: 90%; position: relative; }
.brand-logo { height: 85px; max-width: 100%; object-fit: contain; transition: var(--transicion); }
header.scrolled .brand-logo { height: 60px; }

.nav-menu { display: flex; list-style: none; margin-left: auto; }
.nav-menu a { color: var(--blanco) !important; margin-left: 35px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }
.nav-menu a:hover, .nav-menu a.active { color: var(--verde) !important; }

.hamburger { display: none; cursor: pointer; z-index: 1100; padding: 10px; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; transition: 0.3s; background-color: var(--blanco); }

/* --- HERO & STATS --- */
.hero { height: 100vh; position: relative; color: var(--blanco); display: flex; align-items: center; }
.slider-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
.slide { position: absolute; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.5s ease; }
.slide.active { opacity: 1; }
.slide::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); }
.hero-content { padding: 0 5%; max-width: 900px; }
/* Se redujo el mínimo clamp de 2.5 a 2rem para asegurar que las palabras largas encajen en celulares */
.hero-content h1 { font-size: clamp(2rem, 8vw, 4.5rem); font-weight: 800; text-transform: uppercase; line-height: 1.1; margin-bottom: 20px; }

.btn-primary { display: inline-block; padding: 18px 40px; background: var(--verde); color: var(--negro); font-weight: 800; margin-top: 30px; text-transform: uppercase; border-radius: 2px; }
.btn-primary:hover { transform: translateY(-5px); background: var(--blanco); }

.stats-banner { background: var(--negro); padding: 60px 0; border-bottom: 6px solid var(--verde); }
.stats-grid { display: flex; justify-content: space-around; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; color: white; text-align: center; gap: 30px; }
.count { font-size: 3.5rem; color: var(--verde); font-weight: 800; }

/* --- FILOSOFÍA (Pilares Index) --- */
/* Reducido a minmax(240px) para que no desborde en celulares angostos */
.philosophy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px; }
.phi-card .phi-line { width: 40px; height: 3px; background: var(--verde); margin-bottom: 25px; transition: var(--transicion); }
.phi-card:hover .phi-line { width: 100px; }
.phi-card h3 { font-size: 1.4rem; text-transform: uppercase; margin-bottom: 15px; }

/* --- GRIDS DE PRÁCTICA Y EQUIPO --- */
.shared-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px; }
.practice-card { background: var(--gris-oscuro); overflow: hidden; transition: var(--transicion); border-radius: 4px; display: flex; flex-direction: column; height: 100%; }
.practice-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-premium); }
#aliados .practice-card, .lawyer-card { background: #fdfdfd; border: 1px solid #eee; }
#aliados .practice-card h4, .lawyer-card h4 { color: var(--negro) !important; margin-bottom: 15px; text-transform: uppercase; }
.card-img { height: 220px; background-size: cover; background-position: center; filter: grayscale(100%); transition: 0.6s; }
.aliado-img { background-size: contain; background-repeat: no-repeat; background-position: center; background-color: #f8f8f8; }
.practice-card:hover .card-img { filter: grayscale(0%); }
.card-body { padding: 30px; flex-grow: 1; }
.btn-text { color: var(--verde) !important; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; margin-top: 15px; display: inline-block; }

/* --- PÁGINAS INTERNAS (Nosotros / Abogados) --- */
.inner-page header { background: var(--negro); padding: 15px 0; }
.page-banner { height: 500px; background-size: cover; background-position: center; position: relative; display: flex; align-items: center; }
.banner-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to right, rgba(0,0,0,0.8), transparent); display: flex; align-items: center; }
.subtitle-green, .section-subtitle { color: #d4e555 !important; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; display: block; margin-bottom: 10px; }

/* Nosotros Highlight */
.nosotros-content { max-width: 900px; margin: 0 auto; }
.nosotros-highlight-v2 { background: #f8f9fa; padding: 40px; border-left: 5px solid var(--verde); margin-top: 50px; }
.nosotros-highlight-v2 p { margin-bottom: 0; line-height: 1.8; color: var(--negro); font-size: 1.1rem; }

/* Abogados Intro Text */
.team-intro-full { font-size: 1.1rem; color: var(--gris-texto); max-width: 100%; margin-bottom: 60px; line-height: 1.8; }
.lawyer-role { color: var(--verde) !important; font-weight: 700; text-transform: uppercase; font-size: 0.8rem !important; margin-bottom: 15px; display: block; }

/* --- PERFIL INDIVIDUAL DE ABOGADO --- */
.profile-grid { display: grid; grid-template-columns: 350px 1fr; gap: 60px; margin-top: 80px; }
.profile-sidebar { position: sticky; top: 120px; align-self: start; background: var(--blanco); padding: 30px; box-shadow: var(--shadow-premium); border-radius: 4px; }
.profile-photo { width: 100%; border-radius: 4px; margin-bottom: 25px; object-fit: cover;}
.profile-contact { list-style: none; }
.profile-contact li { display: flex; align-items: center; margin-bottom: 15px; font-size: 0.9rem; color: var(--gris-oscuro); word-break: break-all; }
.profile-contact li svg { width: 18px; height: 18px; margin-right: 12px; fill: var(--verde); flex-shrink: 0; }
.profile-header h2 { font-size: 2.5rem; text-transform: uppercase; margin-bottom: 10px; line-height: 1.2; }
.profile-bio { line-height: 1.8; font-size: 1.1rem; text-align: justify; }
.profile-bio p { margin-bottom: 20px; }

/* --- CONTACTO --- */
.contact-container { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-form input, .contact-form textarea { padding: 20px; background: transparent; border: 1px solid rgba(255, 255, 255, 0.1); color: white; outline: none; font-family: inherit; width: 100%; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--verde); background: rgba(255, 255, 255, 0.02); }
.btn-submit { padding: 20px; background: var(--verde); color: var(--negro); border: none; font-weight: 800; cursor: pointer; text-transform: uppercase; width: 100%; }

/* --- FOOTER --- */
.footer-main { background: var(--negro); color: white; padding: 100px 0 40px; border-top: 1px solid #111; }
.footer-container { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 80px; }
.footer-logo { height: 50px; margin-bottom: 25px; }
.footer-col h4 { color: var(--verde); margin-bottom: 25px; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 2px; }
.footer-col ul { list-style: none; }
.footer-col ul li a { color: #ccc !important; font-size: 0.9rem; display: block; margin-bottom: 15px; }
.social-links a svg { width: 22px; height: 22px; fill: white; transition: 0.3s; margin-right: 15px; }
.social-links a:hover svg { fill: var(--verde); transform: translateY(-5px); }
.footer-bottom { border-top: 1px solid #111; margin-top: 80px; padding-top: 40px; text-align: center; color: #444; font-size: 0.8rem; }

/* --- WHATSAPP FLOAT --- */
.wa-float { position: fixed; bottom: 40px; right: 40px; width: 60px; height: 60px; z-index: 1000; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); transition: 0.3s; }
.wa-float img { width: 100%; height: 100%; }

/* ==========================================================================
   RESPONSIVE DESIGN (CORREGIDO PARA CERO DESBORDAMIENTO)
   ========================================================================== */
@media (max-width: 992px) {
    .hamburger { display: block; }

    /* El menú en móvil ahora ocupa 100vw exacto para no desbordar */
    .nav-menu {
        position: fixed; left: -100vw; top: 0; flex-direction: column; background-color: var(--negro-suave);
        width: 100vw; height: 100vh; text-align: center; transition: 0.4s ease-in-out; justify-content: center; z-index: 1050; margin: 0; padding: 0;
    }
    .nav-menu.active { left: 0; }
    .nav-menu li { margin: 25px 0; }
    .nav-menu a { font-size: 1.2rem; margin-left: 0; }

    /* Animación Hamburguesa */
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .footer-container { grid-template-columns: 1fr; gap: 50px; text-align: center; }
    .contact-container { grid-template-columns: 1fr; gap: 40px; }
    .profile-grid { grid-template-columns: 1fr; margin-top: 40px; }
    .profile-sidebar { position: relative; top: 0; width: 100%; margin: 0 auto; }
}

@media (max-width: 768px) {
    .section-title { font-size: 2.2rem; line-height: 1.2; }
    .page-banner { height: 350px; }
    .section-padding { padding: 60px 0; }
    .stats-grid { flex-direction: column; gap: 30px; }

    /* Quitar justificado en móvil previene espacios irregulares que estiran la pantalla */
    .justify-text { text-align: left; }
    .input-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 2.2rem; }
    .wa-float { bottom: 20px; right: 20px; width: 50px; height: 50px; }
}
