/* Modern SaaS Dropdowns - 2025-26 Style */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.nav-dropdown-btn:hover { 
  color: var(--text-primary); 
  background: rgba(255,255,255,0.05);
}
.nav-dropdown-btn::after { 
  content: '↓'; 
  font-size: 0.6rem; 
  transition: transform 0.2s ease;
}
.nav-dropdown:hover .nav-dropdown-btn::after { transform: rotate(180deg); }

/* Base dropdown content */
.nav-dropdown-content {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 220px;
  background: rgba(14, 14, 17, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  z-index: 1000;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-dropdown:hover .nav-dropdown-content { 
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Mega Menu for Servicios */
.nav-dropdown-content.mega {
  min-width: 680px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
}
.nav-dropdown:hover .nav-dropdown-content.mega {
  transform: translateX(-50%) translateY(0);
}

/* Grid layout for mega menu */
.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.mega-section {
  padding: 0.5rem 0.75rem;
}
.mega-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Dropdown items */
.nav-dropdown-content a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}
.nav-dropdown-content a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
.nav-dropdown-content a svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}
.nav-dropdown-content a:hover svg { opacity: 1; }

/* Highlighted item */
.nav-dropdown-content a.highlight {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}
.nav-dropdown-content a.highlight:hover {
  background: rgba(99, 102, 241, 0.25);
}

/* Arrow positioned above dropdown */
.nav-dropdown-content::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(14, 14, 17, 0.95);
  border-left: 1px solid rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Smaller dropdown for "Cómo Trabajamos" */
.nav-dropdown-content.small {
  min-width: 200px;
}
/* Stack items grid */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
}

/* Responsive Mobile Menu */
.mobile-menu-btn { display: none; }
.mobile-nav { display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: rgba(5,5,7,0.98); backdrop-filter: blur(20px); z-index: 999; overflow-y: auto; padding: 1.5rem; }
.mobile-nav.active { display: block; }
.mobile-nav-section { margin-bottom: 1.5rem; }
.mobile-nav-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.75rem; }
.mobile-nav-link { display: block; padding: 0.75rem 0; color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid var(--border); font-size: 1rem; }
.mobile-nav-link:hover { color: var(--text-primary); }
.mobile-nav-sub { padding-left: 1rem; }

@media (max-width: 1024px) {
  .nav-dropdown-content { display: none !important; }
  .nav-links { display: none !important; }
  .mobile-menu-btn { display: flex !important; }
  .mobile-nav { display: none; }
  .mobile-nav.active { display: block; }
}

/* Mobile menu button */
.mobile-menu-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* Theme CSS - Light/Dark toggle */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a1a1a1;
  --accent: #f5f5f5;
  --accent-hover: #e0e0e0;
  --border: #27272a;
}

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-card: #f4f4f5;
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --accent: #18181b;
  --accent-hover: #27272a;
  --border: #e4e4e7;
}

/* Animated Theme Toggle - RuixenUI style */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.toggle-track {
  position: absolute;
  inset: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.toggle-thumb {
  position: absolute;
  left: 3px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  border-radius: 50%;
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

[data-theme="light"] .toggle-thumb {
  transform: translateX(28px);
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
}

.toggle-icons {
  display: flex;
  width: 100%;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.toggle-icon {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  transition: opacity 0.3s;
}

[data-theme="light"] .sun-icon {
  opacity: 1;
}

[data-theme="light"] .moon-icon {
  opacity: 0.3;
}

.moon-icon {
  opacity: 0.3;
}

[data-theme="light"] .moon-icon {
  opacity: 1;
}

[data-theme="light"] .sun-icon {
  opacity: 0.3;
}