/* Archivo style.css - Versión con z-index y resaltado de menú */

/* --- VARIABLES Y CONFIGURACIÓN GLOBAL --- */
:root {
  --color-primary: #0078b9;
  --color-secondary: #0d2c4f;
  --color-accent: #58585a;
  --color-bg-light: #ffffff;
  --color-bg-soft: #f4f4f9;
  --color-text-light: #f4f4f9;
  --color-text-dark: #333333;
  --font-heading: "Montserrat", sans-serif;
  --font-body: "Open Sans", sans-serif;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.1);
  --transition: 0.3s ease-in-out;
}

body.dark-mode {
  --color-primary: #158fcf;
  --color-secondary: #a9c6e6;
  --color-accent: #b0b0b0;
  --color-bg-light: #121212;
  --color-bg-soft: #1e1e1e;
  --color-text-dark: #f4f4f9;
}

/* --- ESTILOS BASE --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}
body {
  font-family: var(--font-body);
  background-color: var(--color-bg-light);
  color: var(--color-text-dark);
  line-height: 1.7;
  transition: background-color var(--transition), color var(--transition);
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--color-secondary);
}
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
  color: var(--color-primary);
}
h2 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  text-align: center;
  margin-bottom: 1rem;
}
.section-subtitle {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem auto;
  font-size: 1.1rem;
  color: var(--color-accent);
}
.section {
  padding: 5rem 0;
}
.section-light {
  background-color: var(--color-bg-soft);
}
.cta {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(
    45deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: #fff;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 8px 15px rgba(0, 120, 185, 0.3);
  transition: transform var(--transition), box-shadow var(--transition);
}
.cta:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 25px rgba(0, 120, 185, 0.4);
}
.text-center {
  text-align: center;
}

/* --- HEADER Y NAVEGACIÓN --- */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e0e0e0;
  padding: 0.8rem 0;
  z-index: 2000; /* <-- CAMBIO: Prioridad alta para el menú */
}
body.dark-mode header {
  background-color: rgba(18, 18, 18, 0.85);
  border-bottom-color: #2a2a2a;
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo img {
  height: 50px;
  width: auto;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
nav a {
  text-decoration: none;
  color: var(--color-text-dark);
  font-weight: 600;
  padding: 0.5rem 0;
  position: relative;
  transition: color var(--transition);
}
nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width var(--transition);
}
nav a:hover {
  color: var(--color-primary);
}
nav a:hover::after,
nav a:focus::after {
  width: 100%;
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.language-select-wrapper {
  position: relative;
  display: inline-block;
}
#language-selector {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: transparent;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 0.5rem 2rem 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--color-text-dark);
  cursor: pointer;
  transition: border-color var(--transition);
}
body.dark-mode #language-selector {
  border-color: #555;
}
#language-selector:hover {
  border-color: var(--color-primary);
}
.language-select-wrapper::after {
  content: "▼";
  font-size: 0.7rem;
  color: var(--color-accent);
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
#toggle-dark {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
}

/* --- HERO --- */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}
.hero-background {
  position: relative;
  background-image: url("images/fondo1.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: #fff;
}
.hero-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(
    13,
    44,
    79,
    0.6
  ); /* Overlay con el color secundario oscuro */
  z-index: 1;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
}
.hero p {
  color: var(--color-accent);
  font-size: 1.25rem;
  max-width: 700px;
  margin: 1.5rem auto 2.5rem auto;
}
.hero .container {
  position: relative;
  z-index: 2;
}
.hero-background h1,
.hero-background p {
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* Sombra para resaltar el texto */
}

/* ABOUT LAYOUT (2 COLUMNAS) */
.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}
.about-content h2 {
  text-align: left;
}
.about-gif {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.about-gif img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}
body.dark-mode .about-gif img {
  mix-blend-mode: screen;
}

/* MISSION */
.bullet-list {
  list-style: none;
  max-width: 800px;
  margin: 2rem auto;
}
.bullet-list li {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  position: relative;
}
.bullet-list li::before {
  content: "✓";
  color: var(--color-primary);
  position: absolute;
  left: 0;
  font-weight: 900;
}

/* SERVICES */
.service-accordion {
  max-width: 900px;
  margin: 3rem auto 0;
}
.accordion-item {
  position: relative;
  z-index: 1;
  background-color: var(--color-bg-light);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.service-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px 0 0 8px;
}
body.dark-mode .accordion-item {
  border-color: #2a2a2a;
}
.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  cursor: pointer;
}
.accordion-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-secondary);
}
.accordion-icon {
  font-size: 2rem;
  font-weight: 300;
  color: var(--color-primary);
  transition: transform var(--transition);
}
.accordion-item.active .accordion-icon {
  transform: rotate(45deg);
}
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}
.accordion-content-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: stretch;
}

.accordion-content-inner p {
  margin-bottom: 1rem;
  color: var(--color-accent);
}
.accordion-content-inner p:first-of-type {
  color: var(--color-text-dark);
}
.accordion-content-inner ul {
  list-style-position: inside;
  padding-left: 0.5rem;
}
.accordion-content-inner li {
  margin-bottom: 0.5rem;
}
.service-text-container {
  padding: 1rem 1rem 1rem 0; /* Añade el padding al texto para que no se pegue */
}

/* TEAM CARDS */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.team-card {
  background-color: var(--color-bg-light);
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
  border-top: 4px solid transparent;
}
.team-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-medium);
  border-top-color: var(--color-primary);
}
.team-card img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  border: 4px solid var(--color-bg-soft);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
body.dark-mode .team-card img {
  border-color: var(--color-bg-dark);
}
.team-card h3 {
  color: var(--color-secondary);
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}
.team-card .team-title {
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
}
.team-card .team-desc {
  font-size: 0.95rem;
  color: var(--color-accent);
}

/* LOCATIONS */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}
.location-card {
  background-color: var(--color-bg-light);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}
.location-card h3 {
  text-align: left;
}

.location-card address {
  font-style: normal;
  margin: 1rem 0;
  line-height: 1.8;
}

.location-card a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.location-card iframe {
  border-radius: 8px;
  margin-top: auto;
  width: 100%;
  height: 250px;
}
.location-card.coming-soon-card {
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--color-primary);
  background-color: var(--color-bg-soft);
}

.coming-soon-card h3 {
  text-align: center;
  margin-bottom: 1rem;
}

.coming-soon-content p {
  color: var(--color-accent);
}

.coming-soon-content p:first-of-type {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--color-text-dark);
}

/* CONTACTO */
.contact-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-top: 3rem;
}

.contact-form-wrapper form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-form-wrapper label {
  font-weight: 600;
  color: var(--color-accent);
  font-size: 0.9rem;
  margin-bottom: -0.5rem;
}

/* --- ESTILOS PARA TODOS LOS CAMPOS DEL FORMULARIO --- */
.contact-form-wrapper input,
.contact-form-wrapper textarea,
.contact-form-wrapper select {
  width: 100%;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--color-bg-soft);
  color: var(--color-text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
}

body.dark-mode .contact-form-wrapper input,
body.dark-mode .contact-form-wrapper textarea,
body.dark-mode .contact-form-wrapper select {
  background-color: #2c2c2c;
  border-color: #444;
}

.contact-form-wrapper input:focus,
.contact-form-wrapper textarea:focus,
body.dark-mode .contact-form-wrapper input:focus,
body.dark-mode .contact-form-wrapper textarea:focus,
.contact-form-wrapper select:focus,
body.dark-mode .contact-form-wrapper select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 185, 0.2);
}

/* --- ESTILOS ESPECÍFICOS PARA EL DROPDOWN (SELECT) --- */
.contact-form-wrapper select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230079C1%22%20d%3D%22M287%20197.8L156.4%2067.2c-4.7-4.7-12.3-4.7-17%200L5.4%20197.8c-4.7%204.7-4.7%2012.3%200%2017l11.4%2011.4c4.7%204.7%2012.3%204.7%2017%200L148%20111.6l114.2%20114.2c4.7%204.7%2012.3%204.7%2017%200l11.4-11.4c4.7-4.7%204.7-12.3%200-17z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  cursor: pointer;
}

/* --- ESTILOS ESPECÍFICOS PARA intl-tel-input --- */
.contact-form-wrapper .iti {
  display: block; /* Para que ocupe todo el ancho disponible */
  width: 100%; /* Asegura que el contenedor de la librería ocupe el 100% */
}

/* Estilos para el campo de entrada de teléfono */
.contact-form-wrapper .iti input.form-control,
.contact-form-wrapper .iti input[type="tel"] {
  /* Restablece los estilos para que el input de teléfono se vea como el resto */
  width: 100%;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--color-bg-soft);
  color: var(--color-text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
  padding-left: 5rem; /* Ajusta este valor si la bandera es más grande */
}

body.dark-mode .contact-form-wrapper .iti input.form-control {
  background-color: #2c2c2c;
  border-color: #444;
}

/* Estilo para el botón del dropdown de países */
.contact-form-wrapper .iti__flag-container,
.contact-form-wrapper .iti__selected-flag {
  border-radius: 8px 0 0 8px; /* Para que las esquinas coincidan con el input */
}

.contact-form-wrapper .iti__selected-flag {
  padding-left: 1rem;
}

.contact-form-wrapper .iti__dropdown-content {
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  background-color: var(--color-bg-light);
  color: var(--color-text-dark);
  z-index: 2000;
}

.contact-form-wrapper .iti__dropdown-content.iti__not-found {
  color: var(--color-text-dark);
}

.contact-form-wrapper .iti__country-list {
  background-color: var(--color-bg-light);
}

body.dark-mode .contact-form-wrapper .iti__dropdown-content {
  background-color: #2c2c2c;
  color: var(--color-text-light);
}

body.dark-mode .contact-form-wrapper .iti__country-list {
  background-color: #2c2c2c;
}

.contact-form-wrapper button {
  padding: 1rem;
  border: none;
  border-radius: 8px;
  background-color: var(--color-secondary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
}

.contact-form-wrapper button:hover {
  background-color: var(--color-primary);
  transform: scale(1.02);
}

.ai-prompt-box {
  background-color: var(--color-bg-light);
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  border: 2px dashed var(--color-primary);
}

.ai-prompt-box h3 {
  margin-bottom: 1rem;
}

.ai-icon {
  font-size: 3rem;
  margin-top: 1rem;
}

/* FOOTER Y UTILIDADES */
footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 4rem;
  border-top: 1px solid #e0e0e0;
}
body.dark-mode footer {
  border-top-color: #2a2a2a;
}
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-medium);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 1999;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* MEDIA QUERIES */
@media (max-width: 992px) {
  .about-layout {
    grid-template-columns: 1fr;
  }
  .about-content {
    order: 2;
  }
  .about-content h2 {
    text-align: center;
  }
  .about-gif {
    order: 1;
  }
  .location-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  header .container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  nav {
    order: 3;
    width: 100%;
  }
  nav ul {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .header-controls {
    order: 2;
  }
  .accordion-content-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .service-image-container img {
    border-radius: 8px 8px 0 0;
    max-height: 200px;
  }
  .service-text-container {
    padding: 1.5rem;
  }
}

/* --- CAMBIO: ESTILO PARA EL ENLACE ACTIVO DEL MENÚ --- */
nav a.active-link {
  color: var(--color-primary);
}
nav a.active-link::after {
  width: 100%;
}
