﻿/* 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;
}

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 {
  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);
  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);
}

/* 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;
}

/* 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: 1fr 1fr;
  gap: 3rem;
  margin-top: 3rem;
}

.location-card {
  background-color: var(--color-bg-light);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.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: 1rem;
  width: 100%;
}

/* 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;
}

.contact-form-wrapper input,
.contact-form-wrapper textarea {
  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 {
  background-color: #2c2c2c;
  border-color: #444;
}

.contact-form-wrapper input:focus,
.contact-form-wrapper textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 185, 0.2);
}

.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%;
}

/* Other Companies Section Specifics */
@media (min-width: 1024px) {
  #other-companies .team-card {
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
  }
}

.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;
}

/* MEJORAR SELECT DEL FORMULARIO */
.contact-form-wrapper select {
  width: 100%;
  padding: 1rem;
  padding-right: 2.5rem;
  /* Espacio para la flecha */
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--color-bg-soft);
  color: var(--color-text-dark);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);

  /* Eliminar la flecha por defecto del navegador */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Agregar flecha personalizada */
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%230078b9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
}

body.dark-mode .contact-form-wrapper select {
  background-color: #2c2c2c;
  border-color: #444;
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23158fcf" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
}

.contact-form-wrapper select:hover {
  border-color: var(--color-primary);
}

.contact-form-wrapper select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 185, 0.2);
}

/* Estilo para las opciones */
.contact-form-wrapper select option {
  padding: 0.5rem;
  background-color: var(--color-bg-soft);
  color: var(--color-text-dark);
}

body.dark-mode .contact-form-wrapper select option {
  background-color: #2c2c2c;
  color: var(--color-text-dark);
}