/* Estilos para el menú de navegación mejorado - Réplica de armyred.host */

/* Variables CSS - Paleta de armyred.host */
:root {
  --nav-bg: #ffffff;
  --nav-border: #e5e7eb;
  --nav-text: #374151;
  --nav-text-hover: #111827;
  --nav-primary: #2563eb;
  --nav-primary-hover: #1d4ed8;
  --nav-secondary: #6b7280;
  --nav-accent: #dc2626;
  --nav-success: #059669;
  --nav-warning: #d97706;
  --nav-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --nav-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 3px 6px rgba(0,0,0,.08);
  --shadow-md: 0 6px 14px rgba(0,0,0,.12);
  --nav-radius: 6px;
  --nav-transition: all 0.2s ease;
  --nav-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Header de armyred.host */
.header {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  font-family: var(--nav-font);
  position: sticky;
  top: 0;
  z-index: 4000;
  overflow: visible;
}

.header__content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  overflow: visible;
}

/* Logo de armyred.host */
.header__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo__icon {
  width: 40px;
  height: 40px;
  background: var(--nav-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  font-weight: bold;
  font-size: 18px;
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo__name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nav-primary);
}

.logo__domain {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--nav-secondary);
  text-transform: uppercase;
}

/* Navegación principal de armyred.host */
.nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 1rem;
  flex: 1;
  justify-content: center;
  position: relative;
  z-index: 4100;
  overflow: visible;
}

/* Estilos del menú elementor */
.elementor-nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  overflow: visible;
}

.menu-item {
  position: relative;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem; /* compacto */
  color: var(--nav-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--nav-transition);
  border-radius: var(--nav-radius);
  white-space: nowrap;
  will-change: transform, box-shadow;
}

.menu-item a:hover {
  color: var(--nav-primary);
  background: rgba(37, 99, 235, 0.06);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.elementor-item {
  font-weight: 600;
}

.has-submenu {
  position: relative;
}

.sub-arrow {
  display: flex;
  align-items: center;
  margin-left: 0.25rem;
}

.sub-arrow i {
  font-size: 0.75rem;
  transition: var(--nav-transition);
}

.has-submenu:hover .sub-arrow i {
  transform: rotate(180deg);
}

/* Dropdowns de armyred.host */
.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background: #ffffff;
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 6000;
  padding: 1rem 0;
  margin-top: 0.5rem;
  list-style: none;
}

.sub-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown anidado (tercer nivel) */
.sub-menu .sub-menu {
  position: absolute;
  left: 100%;
  top: 0;
  margin-top: 0;
  margin-left: 0.5rem;
}

/* Elementos del dropdown */
.elementor-sub-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem; /* compacto */
  color: var(--nav-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: var(--nav-transition);
  border-radius: 0;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.elementor-sub-item:hover {
  color: var(--nav-primary);
  background: rgba(37, 99, 235, 0.06);
  border-left-color: var(--nav-primary);
  transform: translateX(2px);
  box-shadow: var(--shadow-xs) inset;
}

/* Banderas en los enlaces */
.flag {
  width: 16px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
  transition: transform .15s ease;
  vertical-align: -1px;
}

.elementor-sub-item:hover .flag { transform: scale(1.05); }

/* Barra de búsqueda de armyred.host */
.nav__search {
  margin: 0 0.5rem;
  flex: 0 1 200px;
}

.search-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f9fafb;
  border: 1px solid var(--nav-border);
  border-radius: 50%;
  color: var(--nav-secondary);
  cursor: pointer;
  transition: var(--nav-transition);
  font-family: var(--nav-font);
}

.search-trigger:hover {
  border-color: var(--nav-primary);
  background: rgba(37, 99, 235, 0.05);
  color: var(--nav-primary);
}

.search-trigger:focus {
  outline: 2px solid var(--nav-primary);
  outline-offset: 2px;
}

/* Focus visible accesible */
.menu-item a:focus-visible,
.elementor-sub-item:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--nav-primary);
  outline-offset: 2px;
}

.search-trigger svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

/* Acciones del header de armyred.host */
.header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* Botones de armyred.host */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--nav-radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--nav-transition);
  border: 2px solid transparent;
  cursor: pointer;
  font-family: var(--nav-font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn:focus {
  outline: 2px solid var(--nav-primary);
  outline-offset: 2px;
}

.btn--ghost {
  color: var(--nav-text);
  background: transparent;
  border-color: var(--nav-border);
}

.btn--ghost:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: var(--nav-secondary);
}

.btn--primary {
  background: var(--nav-primary);
  color: white;
  border-color: var(--nav-primary);
}

.btn--primary:hover {
  background: var(--nav-primary-hover);
  border-color: var(--nav-primary-hover);
  transform: translateY(-1px);
}

/* Popup de búsqueda */
.search-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-popup.active {
  display: flex;
  opacity: 1;
  align-items: center;
  justify-content: center;
}

.search-popup-content {
  background: var(--nav-bg);
  border-radius: 12px;
  box-shadow: 0 20px 25px -12px rgba(0, 0, 0, 0.25);
  max-width: 600px;
  width: 90%;
  max-height: 70vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.search-popup.active .search-popup-content {
  transform: scale(1);
}

.search-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--nav-border);
  background: #f9fafb;
}

.search-popup-header h3 {
  margin: 0;
  color: var(--nav-text);
  font-size: 1.25rem;
  font-weight: 600;
}

.search-popup-close {
  background: none;
  border: none;
  color: var(--nav-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--nav-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.search-popup-close:hover {
  color: var(--nav-text);
  background: rgba(37, 99, 235, 0.1);
}

.search-popup-body {
  padding: 1.5rem;
}

.search-input-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.search-popup-input {
  flex: 1;
  padding: 0.875rem 1rem;
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  font-size: 1rem;
  color: #000000;
  background: var(--nav-bg);
  transition: var(--nav-transition);
  font-family: var(--nav-font);
}

.search-popup-input:focus {
  outline: none;
  border-color: var(--nav-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-popup-input::placeholder {
  color: var(--nav-secondary);
}

.search-popup-btn {
  padding: 0.875rem 1.5rem;
  background: var(--nav-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--nav-transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.search-popup-btn:hover {
  background: var(--nav-primary-hover);
  transform: translateY(-1px);
}

.search-popup-btn:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Resultados de búsqueda */
.search-popup .search-results {
  border-top: 1px solid var(--nav-border);
  padding-top: 1rem;
}

.search-popup .search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.search-popup .search-results-header h4 {
  margin: 0;
  color: var(--nav-text);
  font-size: 1rem;
  font-weight: 600;
}

.search-popup .search-result-item {
  padding: 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--nav-text);
  transition: var(--nav-transition);
  border: 1px solid transparent;
  margin-bottom: 0.75rem;
  background: #f9fafb;
}

.search-popup .search-result-item:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: var(--nav-primary);
}

.search-popup .search-result-category {
  font-size: 0.75rem;
  color: var(--nav-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.search-popup .search-result-title {
  font-weight: 500;
  color: var(--nav-text);
  font-size: 0.875rem;
}

/* Responsive de armyred.host */
@media (max-width: 1024px) {
  .header__content {
    padding: 0.75rem 1rem;
  }
  
  .nav {
    margin: 0 1rem;
  }
  
  .sub-menu {
    min-width: 220px;
  }
}

@media (max-width: 768px) {
  .header__content {
    padding: 0.5rem;
  }
  
  .nav {
    display: none;
  }
  
  .nav__search {
    margin: 0 0.5rem;
    flex: 0 1 150px;
  }
  
  .search-trigger {
    width: 36px;
    height: 36px;
  }
  
  .search-trigger svg {
    width: 16px;
    height: 16px;
  }
  
  .logo__name {
    font-size: 1.25rem;
  }
  
  .logo__domain {
    font-size: 0.75rem;
  }
  
  .logo__icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* Menú móvil de armyred.host */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--nav-text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--nav-radius);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--nav-bg);
    padding: 5rem 1rem 1rem;
    flex-direction: column;
    gap: 1rem;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .nav.active {
    transform: translateX(0);
  }
  
  .elementor-nav-menu {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  
  .menu-item {
    width: 100%;
  }
  
  .menu-item a {
    width: 100%;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--nav-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
  }
  
  .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: #f9fafb;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
  }
  
  .sub-menu .sub-menu {
    position: static;
    margin-left: 1rem;
    margin-top: 0.5rem;
  }
  
  .elementor-sub-item {
    padding: 0.75rem;
    border-left: none;
    border-bottom: 1px solid var(--nav-border);
  }
  
  .elementor-sub-item:last-child {
    border-bottom: none;
  }
}

/* Animación para dropdowns */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sub-menu.active {
  animation: slideIn 0.2s ease forwards;
}

/* Hover states para elementos del menú */
.menu-item:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Abrir SOLO el submenú del elemento anidado que se está hovereando */
.sub-menu .menu-item:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Separadores sutiles entre elementos del dropdown */
.sub-menu > li + li .elementor-sub-item {
  border-top: 1px solid #eef2f7;
}

/* Estado activo claro */
.menu-item.current-menu-item > a,
.menu-item > a[aria-current="page"] {
  background: rgba(37,99,235,.08);
  color: var(--nav-primary);
  box-shadow: var(--shadow-sm);
}

.sub-menu .elementor-sub-item[aria-current="page"],
.sub-menu .elementor-sub-item.active {
  background: rgba(37,99,235,.08);
  border-left-color: var(--nav-primary);
  color: var(--nav-primary);
}

/* Caret refinado */
.sub-arrow i {
  font-size: 0.7rem;
  opacity: .6;
  transition: transform .18s ease, opacity .18s ease;
}

.has-submenu:hover .sub-arrow i { opacity: .95; transform: rotate(180deg); }

/* Estilos específicos para el menú de armyred.host */
.sm-nowrap {
  white-space: nowrap;
}

.elementor-item-anchor {
  cursor: pointer;
}

/* Estilos para las banderas */
.flag {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Estilos para los enlaces activos */
.menu-item.current-menu-item > a {
  color: var(--nav-primary);
  background: rgba(37, 99, 235, 0.05);
}

/* Estilos para los enlaces del dropdown activos */
.elementor-sub-item.active {
  color: var(--nav-primary);
  background: rgba(37, 99, 235, 0.05);
  border-left-color: var(--nav-primary);
}

/* ===== POPUP DE BÚSQUEDA ===== */

.search-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 5000;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.search-popup.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.search-popup-content {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  margin: auto;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.search-popup.active .search-popup-content {
  transform: scale(1);
}

.search-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--nav-border);
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.search-popup-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nav-text);
}

.search-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  color: var(--nav-secondary);
  transition: all 0.2s ease;
}

.search-popup-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--nav-text);
}

.search-popup-input-group {
  display: flex;
  gap: 0.75rem;
  padding: 2rem;
  background: #ffffff;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--nav-secondary);
  z-index: 1;
}

.search-popup-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--nav-border);
  border-radius: 12px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  background: #ffffff;
}

.search-popup-input:focus {
  outline: none;
  border-color: var(--nav-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-popup-btn {
  background: var(--nav-primary);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.search-popup-btn:hover {
  background: var(--nav-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.search-results {
  max-height: 300px;
  overflow-y: auto;
  padding: 0 2rem;
}

.search-results-header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--nav-border);
  margin-bottom: 1rem;
}

.search-results-header h4 {
  margin: 0;
  color: var(--nav-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-result-item {
  display: block;
  padding: 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--nav-text);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.search-result-item:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.1);
  transform: translateX(4px);
}

.search-result-category {
  font-size: 0.75rem;
  color: var(--nav-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.search-result-title {
  font-weight: 600;
  color: var(--nav-text);
  margin-bottom: 0.25rem;
}

.search-result-description {
  font-size: 0.875rem;
  color: var(--nav-secondary);
  line-height: 1.4;
}

.search-popup-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--nav-border);
  background: #f8fafc;
}

.search-shortcuts {
  text-align: center;
}

.search-shortcut-label {
  display: block;
  font-size: 0.875rem;
  color: var(--nav-secondary);
  margin-bottom: 1rem;
}

.search-shortcut-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.search-shortcut-tag {
  background: #ffffff;
  border: 1px solid var(--nav-border);
  color: var(--nav-text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.search-shortcut-tag:hover {
  background: var(--nav-primary);
  color: white;
  border-color: var(--nav-primary);
  transform: translateY(-1px);
}

/* Responsive para el popup de búsqueda */
@media (max-width: 768px) {
  .search-popup-content {
    width: 95%;
    max-height: 90vh;
    margin: 1rem auto;
  }
  
  .search-popup-header {
    padding: 1rem 1.5rem;
  }
  
  .search-popup-header h3 {
    font-size: 1.25rem;
  }
  
  .search-popup-input-group {
    padding: 1.5rem;
    flex-direction: column;
  }
  
  .search-popup-input {
    font-size: 1rem;
    padding: 0.875rem 0.875rem 0.875rem 2.5rem;
  }
  
  .search-popup-btn {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }
  
  .search-results {
    padding: 0 1.5rem;
    max-height: 250px;
  }
  
  .search-popup-footer {
    padding: 1rem 1.5rem;
  }
  
  .search-shortcut-tags {
    gap: 0.375rem;
  }
  
  .search-shortcut-tag {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }
}


