/* ===== VARIABLES CSS (Paleta estilo JJC) ===== */
:root {
  /* Colores Corporativos */
  --primary-blue: #001955; /* Azul oscuro JJC (azul-1) */
  --primary-blue-light: #004BCD; /* Azul de botones JJC (azul-4) */
  --accent-cyan: #00BEB4; /* Cyan de acento JJC */
  
  /* Colores Neutrales */
  --text-dark: #0A0A0A; /* Un negro más suave */
  --text-secondary: #555;
  --text-light: #f4f4f4;
  --bg-white: #ffffff;
  --border-color: #dce8f7; /* Tono de gris/azul de JJC */
  
  /* Fondos (inspirado en bg-gradient-gris de JJC) */
  --bg-light-gradient: linear-gradient(180deg, #F5FAFF 0%, #EDF5FF 100%);
  
  /* Tipografía */
  --font-family: 'Inter', sans-serif;
  --header-height: 5rem;
  
  /* Estilos de UI */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 8px -2px rgba(0, 25, 85, 0.1);
  --shadow-lg: 0 10px 20px -5px rgba(0, 25, 85, 0.15);
  --radius: 0.5rem; /* 8px */
}

/* ===== BASE & RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-white);
  padding-top: var(--header-height);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary-blue);
  font-weight: 700;
  line-height: 1.2;
}

/* ===== Contenedor Principal y Animación de Página ===== */
#app-content {
  animation: pageFadeIn 0.5s ease-out;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== REUSABLE COMPONENTS ===== */
.container {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding-top: 6rem;
  padding-bottom: 6rem;
  overflow-x: hidden; 
}

.section-title {
  font-size: 2.5rem; /* 40px */
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.section-subtitle {
  display: block;
  font-size: 0.9rem; /* 14px */
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.section-text {
  font-size: 1.125rem; /* 18px */
  color: var(--text-secondary);
  margin-bottom: 1rem;
  max-width: 800px;
}

.bg-light {
  background: var(--bg-light-gradient);
}

.text-light {
  color: var(--text-light);
}
.text-light h1, .text-light h2, .text-light h3 {
  color: var(--text-light);
}

.text-center {
  text-align: center;
}
.text-center .section-text {
    margin-left: auto;
    margin-right: auto;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
}

.button-primary {
  background-color: var(--primary-blue-light);
  color: var(--bg-white);
  border: 2px solid var(--primary-blue-light);
}

.button-primary:hover {
  background-color: #0032AA; /* Tono intermedio de JJC */
  border-color: #0032AA;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  height: 100%; /* Para grids */
  transition: all 0.3s ease;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* ===== HEADER & NAVIGATION ===== */
.header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

.nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-blue);
  /* Estilos de fuente ya no aplican al <a>, sino a la <img> si fuera texto */
  display: flex; /* Asegura que la imagen se alinee bien */
  align-items: center;
}

/* --- ESTILO AÑADIDO PARA EL LOGO --- */
.nav-logo-img {
  max-height: 3rem; /* 48px. Ajusta este valor según tu logo */
  width: auto;
  display: block;
}
/* --- FIN DEL ESTILO AÑADIDO --- */


.nav-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: all 0.3s ease;
  padding: 0.25rem 0;
  border-bottom: 3px solid transparent;
}

.nav-link:hover {
  color: var(--accent-cyan);
}

.nav-link.active {
  color: var(--primary-blue);
  font-weight: 700;
  border-bottom-color: var(--accent-cyan);
}

/* Botón de Contacto (principal) */
.nav-link-button {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: none;
  transition: all 0.3s ease;
  background-color: var(--primary-blue-light);
  color: var(--bg-white);
}
.nav-link-button:hover {
  background-color: #0032AA;
  color: var(--bg-white);
  transform: translateY(-2px);
}
.nav-link-button.active { border-bottom: none; }

/* Botón "Línea Ética" ELIMINADO del nav */
.nav-link-button-secondary {
  display: none; 
}


.nav-item-cta {
  margin-left: 0.5rem;
}

.lang-toggle-wrapper {
  display: flex;
  align-items: center;
  margin-left: 1rem;
}
.lang-toggle {
    background: none;
    border: none;
    padding: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
}
.lang-toggle:hover {
    color: var(--accent-cyan);
}
.lang-toggle.active {
    color: var(--primary-blue);
    font-weight: 700;
}
.lang-separator {
    color: var(--border-color);
    margin: 0 0.25rem;
    font-size: 0.9rem;
}

/* Mobile Menu Controls */
.nav-toggle,
.nav-close {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--primary-blue);
}
.nav-toggle { font-size: 1.25rem; }
.nav-close { font-size: 1.75rem; }


/* ===== CORREGIDO: Encabezados de Página (Hero) ===== */

/* Estilo base para TODOS los 'hero' (Inicio y subpáginas) */
.page-hero {
  position: relative;
  color: var(--bg-white);
  display: flex;
  align-items: center;
  background-color: var(--primary-blue); /* Fallback si no carga la imagen */
  text-align: left;
}

.page-hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* CLAVE para el efecto zoom */
  z-index: 1;
}

.page-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  
  /* EFECTO KEN BURNS (ZOOM LENTO) */
  animation: kenBurnsZoom 20s infinite alternate ease-in-out;
}

@keyframes kenBurnsZoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

.page-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Superposición más oscura para mejor legibilidad */
  background: linear-gradient(90deg, rgba(0, 25, 85, 0.7) 0%, rgba(0, 25, 85, 0.4) 100%);
  z-index: 2;
}

.page-hero-content {
  position: relative;
  z-index: 3;
}

/* Modificador para la página de INICIO (más alto) */
.hero-home {
  min-height: calc(100vh - var(--header-height)); /* Alto completo de pantalla */
  padding: 6rem 0;
}
.hero-home .hero-title {
  font-size: 3.75rem; /* 60px */
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
}
.hero-home .hero-subtitle {
  font-size: 1.25rem; /* 20px */
  margin: 0 0 2.5rem 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  max-width: 600px;
}
.hero-home .section-title, .hero-home .section-subtitle {
  color: var(--bg-white);
}

/* Modificador para SUBPÁGINAS (más corto) */
.hero-subpage {
  min-height: 400px;
  padding: 4rem 0;
}
.hero-subpage .section-title {
  color: var(--bg-white);
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.hero-subpage .section-subtitle {
  color: var(--bg-white);
  font-weight: 500;
  text-transform: none;
  font-size: 1.25rem;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== "Nuestra Historia" (Página Nosotros) ===== */
.history-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.history-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ===== "Misión/Visión" (Página Nosotros) ===== */
.mission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}
.mission-grid .card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ===== SERVICES SECTION ===== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.service-card {
  display: flex;
  flex-direction: column;
}
.service-card-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  min-height: 3.6rem;
}
.service-card-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  flex-grow: 1;
}
.service-card-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-blue-light);
    transition: all 0.3s ease;
}
.service-card-link:hover {
    color: var(--accent-cyan);
    transform: translateX(5px);
}

/* ===== PROJECTS SECTION ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.project-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all 0.3s ease;
}
.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}
.project-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.project-card:hover .project-card-img {
  transform: scale(1.05);
}
.project-card-content {
  padding: 1.5rem;
  background: var(--bg-white);
}
.project-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}
.project-card-category {
  font-size: 0.875rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ===== "Políticas" (Página Ética) ===== */
.policy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.policy-card {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}
.policy-card-icon {
  font-size: 2rem;
  color: var(--primary-blue);
  background-color: var(--bg-light-gradient);
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.policy-card-content {
  flex: 1;
}
.policy-card-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.policy-card-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.policy-card-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* ===== CONTACT SECTION ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 2rem auto 0;
}
.contact-grid h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.contact-grid a {
  transition: opacity 0.3s ease;
}
.contact-grid a:hover {
  opacity: 0.8;
}

/* ===== NUEVO FOOTER (Estilo JJC) ===== */
.footer {
  background-color: var(--primary-blue);
  color: #aaa;
  padding-top: 5rem;
  padding-bottom: 3rem;
}
.footer-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}
.footer-logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--bg-white);
  display: block;
  margin-bottom: 0.5rem;
}
.footer-description {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.footer-company-details {
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
}
.footer-menu ul li {
  margin-bottom: 0.75rem;
}
.footer-menu ul li a {
  transition: color 0.3s ease;
}
.footer-menu ul li a:hover {
  color: var(--accent-cyan);
}

.footer-contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}
.footer-contact-link:hover {
  color: var(--accent-cyan);
}
.footer-contact-link i {
  font-size: 1.1rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.social-icon {
  color: #aaa;
  border: 1px solid #aaa;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}
.social-icon:hover {
  color: var(--bg-white);
  border-color: var(--accent-cyan);
  background-color: var(--accent-cyan);
  transform: translateY(-3px);
}
.social-icon .fa-whatsapp {
    font-size: 1.3rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
}
.footer-copy {
  font-size: 0.9rem;
}

/* ===== Botones Flotantes (Solo Subir) ===== */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--primary-blue-light);
  color: var(--bg-white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 100;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}
.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background-color: #0032AA;
}

/* ===== Animaciones de Scroll ===== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ########## RESPONSIVE DESIGN (Media Queries) ########## */

@media screen and (max-width: 1024px) {
  .nav-list {
    gap: 1rem;
  }
  .nav-link {
    font-size: 0.9rem;
  }
  .nav-link-button {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .history-section, .mission-grid {
    grid-template-columns: 1fr;
  }
  
  .policy-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr; /* 2 columnas en tablet */
  }
}

@media screen and (max-width: 900px) {
  /* --- Menú Móvil --- */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 380px;
    height: 100%;
    background-color: var(--bg-white);
    box-shadow: -5px 0 15px rgba(0, 25, 85, 0.1);
    padding: 6rem 2rem 2rem;
    transition: right 0.4s ease-in-out;
    z-index: 200;
  }
  
  .nav-menu.nav-active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  
  .nav-link, .nav-link-button {
    font-size: 1.1rem;
    padding: 0.5rem 0;
    width: 100%;
  }
  
  .nav-link-button {
    text-align: center;
    border-width: 2px;
  }
  .nav-link.active {
    border-bottom-color: transparent;
  }
  
  .nav-item-cta { margin-left: 0; }
  
  .lang-toggle-wrapper {
    margin-left: 0;
    padding: 0.5rem 0;
    width: 100%;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
  }
  .lang-toggle { font-size: 1rem; }

  .nav-toggle {
    display: block;
    z-index: 201;
  }
  
  .nav-close {
    display: block;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 201;
  }
  /* --- Fin Menú Móvil --- */
  
  .hero-home {
    min-height: 80vh;
    padding: 4rem 0;
  }
  .hero-home .hero-title {
    font-size: 2.75rem;
  }

  .hero-subpage {
    padding: 4rem 0;
    min-height: 300px;
  }
  .hero-subpage .section-title {
    font-size: 2.25rem;
  }
  .hero-subpage .section-subtitle {
    font-size: 1.1rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr; /* 1 columna en móvil */
    text-align: center;
  }
  .footer-info {
    align-items: center;
  }
  .footer-socials, .footer-menu ul {
    justify-content: center;
    padding: 0;
  }
  .footer-contact-link {
    justify-content: center;
  }
}

@media screen and (max-width: 576px) {
  body {
    padding-top: calc(var(--header-height) - 1rem);
  }
  .header, .nav {
    height: calc(var(--header-height) - 1rem);
  }

  .nav-logo-img {
    max-height: 2.25rem; 
  }

  .section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  
  .hero-home .hero-title {
    font-size: 2.25rem;
  }
  .hero-home .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .hero-subpage .section-title {
    font-size: 2rem;
  }

  .scroll-top-btn {
    width: 45px;
    height: 45px;
    bottom: 1.5rem;
    right: 1.5rem;
  }
}