* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif; /* Aplica Montserrat a toda la página por defecto */
}

html, body {
  height: 100%;
}

body {
  background: #FFFFFF;
  background-attachment: fixed;
  color: #0b130e;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === BLOQUE 1: ENCABEZADO === */
.site-header {
  background-color: transparent;
  color: #0b130e;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 3px solid #1b4332;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: start;
}

.logo-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #2d6a4f;
  background-color: #111d16;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  color: #0b130e;
}

.logo-text {
  font-size: 0.95rem;
  color: #0b130e;
}

.header-center {
  text-align: center;
  justify-self: center;
}

.header-center h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0b130e;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.header-right {
  justify-self: end;
  text-align: right;
  padding-right: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.lang-selector {
  font-size: 0.85rem;
  color: #0b130e;
}

.lang-link {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.lang-link:hover {
  color: #0b130e;
  text-decoration: underline;
}

.lang-link.active {
  color: #0b130e;
  font-weight: 700;
}

.header-subtitle {
  font-size: 1.25rem;
  color: #0b130e;
  font-weight: 600;
}

/* === BLOQUE 2: BARRA DE NAVEGACIÓN === */
.main-nav {
  background-color: #A3FA5C;
  border-bottom: 1px solid #2d6a4f;
  width: 100%;
}

.nav-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-link {
  display: block;
  padding: 1rem 1.5rem;
  color: #0b130e;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  font-family: 'Merriweather', serif; /* Aplica Merriweather únicamente a los enlaces del menú */
  text-align: center;
  transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background-color: #1b4332;
  color: #ffffff;
}

/* === BLOQUE 3: ESPACIO PRINCIPAL === */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 2;
}

/* === PIE DE PÁGINA === */
.site-footer {
  background-color: #A3FA5C;
  color: #a3b899;
  text-align: center;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
  width: 100%;
  border-top: 1px solid #0b130e;
}

.social-links a {
  color: #0b130e;
  text-decoration: none;
  margin: 0 0.5rem;
  font-weight: 500;
}

.social-links a:hover {
  text-decoration: underline;
  color: #ffffff;
}

.contact-email {
  color: #0b130e;
  text-decoration: none;
  margin: 0 0.5rem;
  font-weight: 500;
}

/* Adaptación a móviles */
@media (max-width: 768px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .header-left, .header-center, .header-right {
    justify-self: center;
    text-align: center;
    padding-right: 0;
  }

  .header-center h1 {
    white-space: normal;
    font-size: 1.5rem;
  }

  .nav-menu {
    flex-direction: column;
    width: 100%;
  }

  .nav-menu > li {
    width: 100%;
    text-align: center;
  }

  .dropdown-content {
    position: static;
    width: 100%;
  }
}

.main-content p,
.main-content ol,
.main-content ul,
.contact-container {
  max-width: 50%;         /* Abarca aproximadamente la mitad de la pantalla */
  text-align: justify;    /* Justifica el texto */
  text-justify: inter-word; /* Ajusta el espacio entre palabras para un mejor acabado */
}

/* Contenedor de la cuadrícula */
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Hace que las tarjetas se acomoden solas según el ancho */
  gap: 2rem; /* Espacio entre cada tarjeta */
  width: 100%;
}

/* El cuadro de cada servicio (Card) */
.card-servicio {
  background-color: #FFFFFF;
  border: 1px solid #0b130e;
  border-radius: 12px; /* Borde redondeado como en tu imagen */
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Espacio contenedor */
.card-imagen {
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fuerza el tamaño directamente en la imagen */
.card-servicio img,
.imagen-servicio {
  max-width: 140px !important;
  max-height: 140px !important;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Texto explicativo dentro de la tarjeta */
.card-servicio p {
  color: #0b130e;
  font-size: 0.9rem;
  text-align: end; /* En tarjetas luce mejor centrado */
}

/* Botón inferior */
.btn-mas-info {
  margin-top: auto; /* Empuja el botón al fondo de la tarjeta */
  background-color: #f0f0f0;
  color: #0b130e;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-mas-info:hover {
  background-color: #1b4332;
  color: #ffffff;
}
.nav-menu.nav-menu-izquierda {
  justify-content: flex-start;
  padding-left: 2rem; /* Le da un espacio respecto al borde izquierdo */
}
.main-content ul,
.main-content ol {
  padding-left: 2rem;           /* Agrega el espacio/tabulación hacia la derecha */
  list-style-position: inside;  /* Mantiene las viñetas dentro del área con sangría */
  margin-top: 0.5rem;          /* Opcional: da un pequeño respiro con el párrafo anterior */
  margin-bottom: 1rem;
}

/* Degradado exclusivo para la página de servicios */
body.fondo-servicios {
  background: linear-gradient(180deg, #2b8f08 0%, #5ec72e 50%, #A3FA5C 100%);
  background-attachment: fixed;
}

/* Estilo para la imagen del logo */
.logo-img {
  height: 170px;         /* Ajusta la altura a tu preferencia */
  width: auto;          /* Mantiene la proporción original de la imagen */
  object-fit: contain;  /* Evita que la imagen se distorsione */
  margin-bottom: 0.25rem;
}

/* Configuración de 2 columnas exclusiva para la página de inicio */
.inicio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Divide el espacio en 2 columnas iguales (50% y 50%) */
  gap: 3rem;                     /* Distancia/espacio entre las dos columnas */
  align-items: start;
}

/* Anula la regla anterior del 50% max-width para que los párrafos se adapten a sus columnas */
.inicio-grid .columna-izquierda p,
.inicio-grid .columna-derecha p {
  max-width: 100%;
  text-align: justify;
  text-justify: inter-word;
  margin-bottom: 1rem;
}

/* Adaptación responsive para celulares */
@media (max-width: 768px) {
  .inicio-grid {
    grid-template-columns: 1fr; /* En pantallas pequeñas se muestra una sola columna */
    gap: 1.5rem;
  }
}

/* Ajuste para la imagen de la página Abogada */
.contenedor-foto-abogada {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.foto-abogada {
  width: 100%;
  max-width: 380px;      /* Controla el ancho máximo de la fotografía */
  height: auto;          /* Mantiene la proporción original de la foto */
  border-radius: 12px;   /* Esquinas suavemente redondeadas */
  border: 1px solid #1b4332;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Sombra elegante */
  object-fit: cover;
}

/* Configuración para la vista de 1 columna en la página de Contacto */
.pagina-contacto {
  display: block; /* Desactiva cualquier rejilla de 2 columnas */
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.contact-container {
  max-width: 100% !important; /* Invalida el límite global previa del 50% */
  width: 100%;
}

.contact-container h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #1b4332;
}

.form-description {
  max-width: 100% !important;
  margin-bottom: 2rem;
  color: #555;
}

/* Formulario */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.form-group label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #0b130e;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1b4332;
}

/* Botón Enviar */
.btn-primary {
  background-color: #1b4332;
  color: #ffffff;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  align-self: flex-start;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #2d6a4f;
}
