/* ===== IMPORTAR FUENTES DE GOOGLE ===== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Open+Sans:wght@300;400;500;600&display=swap');

/* ===== VARIABLES DE COLOR ===== */
:root {
  --primary-color: #179186;
  --primary-dark: #0e6b63;
  --primary-light: #20b2a6;
  --accent-color: #ff9a3d;
  --accent-dark: #e67e22;
  --text-light: #ffffff;
  --text-dark: #1a1a1a;
  --text-muted: rgba(255, 255, 255, 0.9);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.18);
  --transition-fast: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 10px;
  --border-radius-lg: 16px;
  --border-radius-xl: 25px;
  
  /* Tipografías */
  --font-heading: 'Montserrat', 'Segoe UI', sans-serif;
  --font-body: 'Open Sans', 'Roboto', sans-serif;
}

/* ===== ESTILOS GENERALES DEL HEADER ===== */
.header {
  background: #179186;
  padding: 0;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #179186;
  transition: all var(--transition-normal);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 35px;
  height: 85px;
  position: relative;
}

/* ===== LOGO MEJORADO ===== */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-light);
  gap: 18px;
  transition: all var(--transition-normal);
  padding: 8px 12px 8px 0;
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
}

.logo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 154, 61, 0.1), rgba(255, 154, 61, 0));
  border-radius: var(--border-radius);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.logo:hover {
  transform: translateY(-3px);
}

.logo:hover::before {
  opacity: 1;
}

.logo-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 0 0 2px rgba(255, 154, 61, 0.4),
    var(--shadow-md);
  transition: all var(--transition-normal);
  position: relative;
  z-index: 1;
}

.logo-img::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--accent-color), var(--primary-light));
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.logo:hover .logo-img {
  transform: scale(1.08) rotate(5deg);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 0 0 3px rgba(255, 154, 61, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.25);
}

.logo:hover .logo-img::after {
  opacity: 1;
}

.logo-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-heading);
}

.logo-text {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.8px;
  background: linear-gradient(135deg, #ffffff, #e6fffa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  position: relative;
}

.logo-text::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 60%;
  height: 2px;
  background: linear-gradient(to right, var(--accent-color), transparent);
  border-radius: 1px;
}

.logo-subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--font-body);
  text-transform: uppercase;
  opacity: 0.9;
}

/* ===== NAVEGACIÓN MEJORADA ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 35px;
  padding-right: 10px;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-xl);
  padding: 8px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    var(--shadow-sm);
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  padding: 12px 24px;
  border-radius: var(--border-radius-lg);
  transition: all var(--transition-normal);
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
  border-radius: var(--border-radius-lg);
  z-index: -1;
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--transition-normal);
}

.nav-link::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.nav-link:hover {
  color: white;
  transform: translateY(-3px);
}

.nav-link:hover::before {
  opacity: 1;
  transform: scale(1);
}

.nav-link:hover::after {
  width: 150px;
  height: 150px;
}

.nav-link.active {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
  color: white;
  box-shadow: 
    0 4px 20px rgba(255, 154, 61, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.nav-link.active::before {
  opacity: 1;
  transform: scale(1);
}

.nav-link.active::after {
  width: 0;
  height: 0;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--accent-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 15px var(--accent-color);
  }
  50% {
    box-shadow: 0 0 25px var(--accent-color);
  }
}

/* ===== SELECTOR DE IDIOMAS MEJORADO Y CORREGIDO ===== */
.language-selector {
  position: relative;
}

.language-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: var(--text-light);
  padding: 12px 20px;
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  min-width: 140px;
  justify-content: space-between;
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.language-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.7s;
}

.language-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.language-btn:hover::before {
  left: 100%;
}

.language-flag {
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.language-text {
  flex-grow: 1;
  text-align: left;
  color: var(--text-light);
}

.language-arrow {
  font-size: 0.8rem;
  opacity: 0.9;
  transition: transform var(--transition-normal);
  color: var(--text-light);
}

.language-selector:hover .language-arrow {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  min-width: 170px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-15px);
  transition: all var(--transition-normal);
  z-index: 100;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.language-selector:hover .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 1px solid #f5f5f5;
  font-family: var(--font-body);
  font-weight: 500;
  color: #333333; /* Color de texto oscuro para mejor contraste */
}

.language-option:last-child {
  border-bottom: none;
}

.language-option:hover {
  background: linear-gradient(to right, #f8f9fa, #e9ecef);
  padding-left: 25px;
  transform: translateX(5px);
}

.language-option.active {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  position: relative;
}

.language-option.active::before {
  content: '✓';
  position: absolute;
  right: 20px;
  font-weight: bold;
  color: white;
}

/* Corrección: Asegurar que el texto sea visible en las opciones */
.language-option .language-text {
  color: #333333; /* Texto oscuro para contraste */
}

.language-option:hover .language-text {
  color: #333333; /* Mantener oscuro al hacer hover */
}

.language-option.active .language-text {
  color: white; /* Texto blanco para opción activa */
}

.language-option.active .language-flag {
  filter: brightness(0) invert(1) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

/* Corrección: Las banderas en opciones normales deben ser visibles */
.language-option:not(.active) .language-flag {
  filter: none; /* Remover filtro para opciones no activas */
}

/* ===== MENÚ MÓVIL MEJORADO ===== */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 36px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1001;
  transition: transform var(--transition-normal);
}

.mobile-toggle:hover {
  transform: scale(1.1);
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--text-light), var(--accent-color));
  border-radius: 3px;
  transition: all var(--transition-normal);
  transform-origin: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.mobile-toggle:hover span {
  background: var(--accent-color);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1100px) {
  .header-container {
    padding: 0 25px;
    height: 80px;
  }
  
  .nav {
    gap: 25px;
  }
  
  .nav-list {
    gap: 0;
  }
  
  .nav-link {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  
  .logo-text {
    font-size: 1.8rem;
  }
  
  .logo-img {
    width: 55px;
    height: 55px;
  }
}

@media (max-width: 900px) {
  .header-container {
    padding: 0 20px;
    height: 75px;
  }
  
  .nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #179186; /* Cambiado a color sólido */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 35px;
    z-index: 999;
    padding: 30px;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(-30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .nav.active {
    display: flex;
  }
  
  .nav-list {
    flex-direction: column;
    background: rgba(255, 255, 255, 0.08);
    gap: 15px;
    padding: 20px;
    width: 90%;
    max-width: 350px;
    border-radius: var(--border-radius-lg);
  }
  
  .nav-link {
    padding: 18px 30px;
    font-size: 1.1rem;
    text-align: center;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
  }
  
  .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
  }
  
  .nav-link.active {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
  }
  
  .language-selector {
    width: 90%;
    max-width: 350px;
  }
  
  .language-btn {
    width: 100%;
    justify-content: center;
    padding: 15px;
  }
  
  .language-dropdown {
    width: 100%;
    right: auto;
    left: 0;
  }
  
  .mobile-toggle {
    display: flex;
  }
  
  .logo-text {
    font-size: 1.6rem;
  }
  
  .logo-img {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 600px) {
  .header-container {
    padding: 0 15px;
    height: 70px;
  }
  
  .logo {
    gap: 12px;
  }
  
  .logo-text {
    font-size: 1.4rem;
  }
  
  .logo-img {
    width: 45px;
    height: 45px;
  }
  
  .mobile-toggle {
    width: 32px;
    height: 24px;
  }
  
  .mobile-toggle span {
    height: 3px;
  }
}

@media (max-width: 400px) {
  .header-container {
    padding: 0 12px;
  }
  
  .logo-text {
    font-size: 1.3rem;
  }
  
  .logo-img {
    width: 40px;
    height: 40px;
  }
}

/* ===== ANIMACIÓN DE SCROLL ===== */
.header.scrolled {
  height: 75px;
  background-color: #179186; /* Mantenido igual */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.header.scrolled .logo-img {
  width: 50px;
  height: 50px;
}

.header.scrolled .logo-text {
  font-size: 1.6rem;
}

/* ===== EFECTOS DECORATIVOS ===== */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: 
    radial-gradient(circle at 15% 85%, rgba(255, 154, 61, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 85% 15%, rgba(32, 178, 166, 0.25) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.7;
}

/* ===== LÍNEA DECORATIVA INFERIOR ===== */
.header::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--accent-color) 20%, 
    var(--primary-light) 50%, 
    var(--accent-color) 80%, 
    transparent 100%
  );
  opacity: 0.8;
}