/* --- 1. CARGA DE FUENTES --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Forum&display=swap');

@font-face {
  font-family: 'fuente-giveny';
  src: url('fonts/Giveny.ttf') format('truetype'), local('Giveny');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* --- 2. CONFIGURACIÓN --- */
:root {
  --font-heading: 'Forum', serif;
  --font-body: 'Montserrat', sans-serif;
  --color-text: #00285A; 
  --color-accent: #000000;
  --bg-light: #ffffff;
  --bg-grey: #f9f9f9;
  --border: #e0e0e0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-light); color: var(--color-text);
  font-family: var(--font-body); font-weight: 300; font-size: 16px; line-height: 1.8;
  overflow-x: hidden;
  width: 100%;
}

/* --- CLASE PARA BLOQUEAR SCROLL (Cuando el menú abre) --- */
body.no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100% !important;
}

/* --- 3. TIPOGRAFÍA --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading); font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1.5rem;
}
a { text-decoration: none; color: inherit; transition: opacity 0.3s; }
a:hover { opacity: 0.6; }
.small { font-size: 0.8rem; }

/* --- 4. HEADER & NAVEGACIÓN --- */
.header-bar {
  position: fixed; top: 0; left: 0; width: 100%;
  padding: 20px 40px;
  background-color: rgba(255, 255, 255, 0.98);
  z-index: 20000; 
  border-bottom: 1px solid transparent; transition: border 0.3s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-content {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1200px; margin: 0 auto; width: 100%;
}

/* Logo */
.brand-wrapper {
  display: flex; align-items: center; gap: 15px; 
  text-decoration: none; color: var(--color-text);
}
.brand-wrapper:hover { opacity: 0.8; }

/* Menú Overlay (CONFIGURACIÓN MAESTRA) */
nav#site-menu {
  position: fixed; top: 0; left: 0; width: 100%; height: 0;
  background: #fff; z-index: 19000; 
  /* Por defecto hidden para la animación de cierre */
  overflow: hidden; 
  transition: height 0.5s cubic-bezier(0.77, 0, 0.175, 1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* ESTADO ACTIVO DEL MENÚ (SCROLL HABILITADO) */
nav#site-menu.active { 
    height: 100vh !important;
    padding-top: 100px; /* Espacio para no chocar con header */
    justify-content: flex-start; /* Alinear arriba para permitir scroll */
    overflow-y: auto !important; /* AQUÍ ESTÁ LA CLAVE: Scroll vertical */
    -webkit-overflow-scrolling: touch;
}

.main-menu-list { 
    list-style: none; text-align: center; padding: 0; margin: 0;
    width: 100%;
    padding-bottom: 150px; /* Espacio extra abajo para que no se corte */
}

.main-menu-list li { margin: 25px 0; opacity: 0; transform: translateY(20px); transition: all 0.5s ease; }
.main-menu-list a { font-family: var(--font-heading); font-size: 2.5rem; color: var(--color-text); }
.main-menu-list a.active-link { color: var(--color-text); font-weight: 600; border-bottom: 2px solid var(--color-text); }

/* Animación de entrada items */
nav.active .main-menu-list li { opacity: 1; transform: translateY(0); }
nav.active .main-menu-list li:nth-child(1) { transition-delay: 0.1s; }
nav.active .main-menu-list li:nth-child(2) { transition-delay: 0.2s; }
nav.active .main-menu-list li:nth-child(3) { transition-delay: 0.3s; }
nav.active .main-menu-list li:nth-child(4) { transition-delay: 0.4s; }
nav.active .main-menu-list li:nth-child(5) { transition-delay: 0.5s; }
nav.active .main-menu-list li:nth-child(6) { transition-delay: 0.6s; }
nav.active .main-menu-list li:nth-child(7) { transition-delay: 0.7s; }

/* Botón Hamburguesa */
#hamburger { background: none; border: none; cursor: pointer; width: 30px; height: 20px; position: relative; padding: 0; z-index: 20001; }
#hamburger span {
  display: block; width: 100%; height: 2px; background: var(--color-text);
  position: absolute; left: 0; transition: 0.3s; transform-origin: center;
}
#hamburger span:nth-child(1) { top: 0; }
#hamburger span:nth-child(2) { top: 9px; }
#hamburger span:nth-child(3) { top: 18px; }

#hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
#hamburger.active span:nth-child(2) { opacity: 0; }
#hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* --- 5. HERO SPLIT --- */
.hero-split {
  display: flex; width: 100%; min-height: 100vh; padding: 0;
  background-color: #fff; position: relative; z-index: 1; 
  padding-top: 80px; overflow: hidden;
}

.split-text {
  width: 50%; display: flex; align-items: center; justify-content: center; padding: 60px; z-index: 2;
}
.split-content { max-width: 480px; }

.overline { font-family: var(--font-body); font-size: 0.75rem; letter-spacing: 0.3em; color: #999; margin-bottom: 25px; display: block; font-weight: 500; }
.split-content h1 { font-size: 4rem; line-height: 1.05; color: var(--color-text); margin-bottom: 30px; position: relative; }
.line-accent { width: 80px; height: 4px; background-color: var(--color-text); margin-bottom: 30px; }
.lead { font-size: 1.05rem; line-height: 1.7; color: #555; margin-bottom: 20px; }
.sub-lead { font-size: 0.9rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text); margin-bottom: 40px; margin-top: 30px; }

.btn-arrow {
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.15em;
  font-weight: 600; font-size: 0.8rem; border-bottom: 2px solid var(--color-text);
  padding-bottom: 5px; color: var(--color-text);
}
.btn-arrow:hover .arrow { margin-left: 15px; }
.arrow { margin-left: 10px; transition: margin 0.3s; }

.hero-actions { display: flex; gap: 30px; align-items: center; margin-top: 40px; }

.btn-emergency {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase; text-decoration: none; color: #a61e1e; 
  border: 1px solid #a61e1e; padding: 12px 25px; transition: all 0.3s ease;
  display: flex; align-items: center; gap: 8px;
}
.btn-emergency:hover { background-color: #a61e1e; color: #fff; transform: translateY(-2px); }
.dot { font-size: 1.2em; line-height: 0; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

.split-image { width: 50%; position: relative; overflow: hidden; opacity: 0; animation: fadeInImage 1.5s ease-out forwards; }
.image-cover {
  width: 100%; height: 100%;
  background-size: cover; background-position: center;
  filter: contrast(105%); 
  transition: transform 10s ease;
}
.split-image:hover .image-cover { transform: scale(1.05); }
.image-caption-overlay {
  position: absolute; bottom: 30px; right: 30px;
  color: rgba(255,255,255,0.95); text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  font-family: var(--font-body); font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase;
}

/* --- 6. OTRAS SECCIONES --- */
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.row { display: flex; flex-wrap: wrap; }
.content-section { background-color: #fff; padding: 140px 0; position: relative; z-index: 10; }
.bg-light { background-color: var(--bg-grey); }

@media (min-width: 992px) {
  .col-left { width: 35%; padding-right: 50px; }
  .col-right { width: 65%; padding-left: 30px; border-left: 1px solid #f0f0f0; }
  h2 { text-align: right; position: sticky; top: 150px; }
}

.parallax-window {
  height: 60vh; width: 100%;
  background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover;
  background-blend-mode: overlay; background-color: rgba(0, 0, 0, 0.6);
  filter: grayscale(100%) contrast(110%);
}

.lawyer-card { margin-bottom: 30px; cursor: pointer; }
.img-frame { overflow: hidden; }
.img-frame img { width: 100%; transition: transform 1s ease; filter: grayscale(100%) contrast(105%); }
.lawyer-card:hover img { transform: scale(1.03); filter: grayscale(0%); }
.lawyer-name {
  background: var(--color-text); color: #fff;
  padding: 15px 25px; display: inline-block;
  margin-top: -40px; position: relative;
  font-family: var(--font-heading); font-size: 1.3rem;
}

.service-list { list-style: none; padding: 0; }
.service-list li { border-bottom: 1px solid var(--border); }
.service-list a {
  display: flex; justify-content: space-between; padding: 25px 0;
  font-size: 1.4rem; font-family: var(--font-heading);
}
.service-list a:hover .arrow { transform: translateX(10px); }

.method-steps { display: flex; flex-direction: column; gap: 40px; }
.step-item { display: flex; gap: 30px; align-items: baseline; border-bottom: 1px solid #eee; padding-bottom: 30px; }
.step-item:last-child { border-bottom: none; padding-bottom: 0; }
.step-number { font-family: var(--font-heading); font-size: 2.5rem; color: #ddd; font-weight: 400; min-width: 60px; }
.step-content h3 { font-family: var(--font-body); font-size: 1.1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; }

.contact-split { display: flex; flex-wrap: wrap; gap: 50px; }
.form-wrapper { flex: 1; min-width: 300px; }
.address-wrapper { flex: 1; min-width: 200px; font-size: 0.95rem; line-height: 1.8; border-left: 1px solid #eee; padding-left: 30px; }

input, textarea {
  width: 100%; border: none; border-bottom: 1px solid #ccc;
  padding: 15px 0; margin-bottom: 20px;
  font-family: var(--font-body); font-size: 1.1rem; background: transparent;
}
input:focus, textarea:focus { outline: none; border-bottom-color: var(--color-text); }
.submit-btn {
  background: transparent; border: none;
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.2em; font-weight: 600;
  cursor: pointer; padding: 15px 0; border-bottom: 1px solid transparent; margin-top: 10px;
}
.submit-btn:hover { border-bottom-color: var(--color-text); }
.form-privacy { font-size: 0.75rem; color: #888; margin-top: 15px; font-style: italic; }
.brand-small { font-weight: 600; margin-bottom: 10px; display: block; color: var(--color-text); }
.contact-link { text-decoration: underline; }

/* Footer */
#footer { background-color: #fff; border-top: 1px solid var(--border); padding: 80px 0; font-size: 0.9rem; color: #555; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; }
.footer-title { font-family: var(--font-body); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text); margin-bottom: 20px; font-size: 0.85rem; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a:hover { color: var(--color-text); text-decoration: underline; }
.muted { color: #999; font-size: 0.8rem; }
.footer-socials { margin-top: 15px; display: flex; gap: 15px; }
.social-icon { color: #555; transition: color 0.3s, transform 0.3s; display: inline-flex; }
.social-icon:hover { color: var(--color-text); transform: translateY(-2px); }

/* Animations */
@keyframes fadeInImage { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.reveal-on-scroll { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* WhatsApp Flotante */
.whatsapp-btn { position: fixed; bottom: 20px; right: 20px; width: 55px; height: 55px; background: #25d366; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 200; transition: transform 0.3s; }
.whatsapp-btn:hover { transform: scale(1.1); }

/* Botón Volver Arriba */
#scrollTopBtn {
  position: fixed; bottom: 20px; left: 20px; width: 45px; height: 45px;
  background-color: #fff; color: var(--color-text);
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 190;
}
#scrollTopBtn.show { opacity: 1; pointer-events: all; bottom: 20px; }
#scrollTopBtn:hover { background-color: var(--color-text); color: #fff; }

/* Mensajes del Formulario */
.form-status { margin-top: 15px; font-size: 0.85rem; font-weight: 500; padding: 10px; display: none; border-radius: 4px; }
.form-status.success { color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb; display: block; }
.form-status.error { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; display: block; }

/* --- RESPONSIVE MÓVIL --- */
@media (max-width: 991px) {
  .header-bar { padding: 15px 20px; }
  
  .hero-split { flex-direction: column-reverse; min-height: auto; padding-top: 60px; }
  .split-image { width: 100%; height: 350px; }
  .split-text { width: 100%; padding: 60px 30px; justify-content: flex-start; }
  .split-content h1 { font-size: 2.8rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 25px; width: 100%; }
  .btn-emergency { width: 100%; justify-content: center; text-align: center; }

  .col-left, .col-right { width: 100%; padding: 0; border: none; }
  .content-section { padding: 60px 0; }
  
  h2 { text-align: left; position: relative; top: 0; margin-bottom: 1.5rem; }
  
  .parallax-window { height: 300px; background-attachment: scroll; }
  .contact-split { flex-direction: column-reverse; gap: 40px; }
  .address-wrapper { border-left: none; padding-left: 0; border-top: 1px solid #eee; padding-top: 30px; }
  .step-item { flex-direction: column; gap: 10px; }
  .step-number { font-size: 2rem; opacity: 0.5; }
  .service-list a { font-size: 1.2rem; padding: 20px 0; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .footer-socials { justify-content: center; }
  
  @keyframes mobileBreathe { 0% { transform: scale(1); } 100% { transform: scale(1.1); } }
  .split-image .image-cover { animation: mobileBreathe 10s ease-in-out infinite alternate; height: 100%; width: 100%; object-fit: cover; }
  
  /* Ajustes Perfil */
  .photo-gallery { grid-template-columns: 1fr; }
  .col-right { border-left: none !important; padding-left: 0 !important; margin-top: 50px; }
  
  /* Ajustes Bio */
  .bio-layout { flex-direction: column; gap: 30px; }
}

@media (min-width: 992px) {
  .bio-layout { flex-direction: row; align-items: flex-start; gap: 40px; }
  .lawyer-card.box-small { flex: 0 0 280px; width: 280px; margin-bottom: 0; }
  .box-small .lawyer-name { font-size: 0.9rem; padding: 10px 15px; }
}