.theme-toggle {
  border: none;
  border-radius: 20px;
  cursor: pointer;
  width: 56px;
  height: 30px;
  padding: 0;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  background: linear-gradient(135deg, #1e1b4b, #0f172a);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35), 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .theme-toggle {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.theme-toggle::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a5b4fc, #6366f1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.45);
  transform: translateX(26px);
  /* cubic-bezier con overshoot: el círculo "rebota" ligeramente al llegar a la posición */
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}

[data-theme="light"] .theme-toggle::before {
  background: linear-gradient(135deg, #fff, #fef3c7);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
  transform: translateX(0);
}

.theme-toggle .icon-moon,
.theme-toggle .icon-sun {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  pointer-events: none;
  transition: opacity 0.2s;
}

.theme-toggle .icon-sun  { left: 7px; }
.theme-toggle .icon-moon { right: 6px; }

[data-theme="light"] .theme-toggle .icon-sun  { opacity: 1; }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0.3; }
[data-theme="dark"]  .theme-toggle .icon-sun,
:root:not([data-theme="light"]) .theme-toggle .icon-sun  { opacity: 0.3; }
[data-theme="dark"]  .theme-toggle .icon-moon,
:root:not([data-theme="light"]) .theme-toggle .icon-moon { opacity: 1; }

.navbar.bg-black {
  position: sticky;
  top: 0;
  z-index: 1030;
  /* base del fondo: --nav-bg (picker propio del admin) + overlays sutiles
     teñidos con los acentos (--nav-highlight y --nav-highlight-2). */
  background:
    linear-gradient(135deg, var(--nav-highlight), transparent 45%),
    linear-gradient(225deg, var(--nav-highlight-2), transparent 50%),
    var(--nav-bg) !important;
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.28);
}

.navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.28);
}

.nav-link-custom {
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem !important;
  border-radius: var(--radius);
  position: relative;
}

/* Subrayado que crece desde el centro al hacer hover */
.nav-link-custom::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 0.65rem;
  right: 0.65rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2-bright));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-fast);
}

.nav-link-custom:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link-custom:hover::after,
.nav-link-custom.active::after {
  transform: scaleX(1);
}

.nav-link-custom.active {
  color: #fff !important;
}

.btn-nav-contact {
  font-size: 0.88rem;
  padding: 0.45rem 1.25rem;
  border-radius: var(--radius);
}

.lang-dropdown-toggle {
  text-decoration: none !important;
}

.lang-dropdown-toggle::after {
  margin-left: 0.15rem;
  vertical-align: 0.12em;
}

.lang-dropdown-toggle__flag {
  display: block;
  width: 26px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.lang-dropdown-toggle__code {
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.95;
}

.lang-dropdown-menu {
  min-width: 12rem;
  padding: 0.35rem;
  border-radius: var(--radius);
}

.lang-dropdown-item img {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lang-dropdown-item.active {
  background: rgba(99, 102, 241, 0.18);
}

[data-theme="light"] .lang-dropdown-item.active {
  background: rgba(79, 70, 229, 0.12);
}

.navbar .dropdown-menu {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 0.45rem 0;
  box-shadow: var(--shadow-soft);
}

.navbar .dropdown-item {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
  padding: 0.5rem 1.1rem;
}

.navbar .dropdown-item .text-muted {
  color: rgba(255, 255, 255, 0.45) !important;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.navbar .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 991px) {
  .navbar-actions {
    width: 100%;
  }

  .navbar-actions .dropdown {
    width: 100%;
  }

  .lang-dropdown-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .navbar .lang-dropdown-menu {
    width: 100%;
    min-width: 0;
  }

  /* Evitar que el dropdown de idioma salga de la pantalla en móvil */
  .navbar .lang-dropdown-menu[data-bs-popper] {
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
  }

  .navbar .lang-dropdown-item .flex-grow-1 {
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .btn-nav-contact {
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
  }
}

[data-theme="light"] .navbar.bg-black {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .navbar .navbar-toggler {
  border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280%2C0%2C0%2C0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="light"] .nav-link-custom {
  color: rgba(20, 30, 50, 0.75) !important;
}

[data-theme="light"] .nav-link-custom:hover {
  color: #0c1a2e !important;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav-link-custom.active {
  color: #0c1a2e !important;
}

[data-theme="light"] .navbar .dropdown-menu {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .navbar .dropdown-item {
  color: rgba(20, 30, 50, 0.85);
}

[data-theme="light"] .navbar .dropdown-item .text-muted {
  color: rgba(20, 30, 50, 0.45) !important;
}

[data-theme="light"] .navbar .dropdown-item:hover,
[data-theme="light"] .navbar .dropdown-item:focus {
  background-color: rgba(0, 0, 0, 0.05);
  color: #0c1a2e;
}

[data-theme="light"] .navbar .dropdown-divider {
  border-color: rgba(0, 0, 0, 0.1);
}

footer.bg-dark {
  background:
    radial-gradient(900px 420px at 18% 0%, var(--footer-highlight), transparent 60%),
    linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, transparent 42%),
    var(--footer-bg) !important;
  border-top: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.footer-link {
  opacity: 0.85;
  transition: opacity 0.18s, color 0.18s;
}

.footer-link:hover {
  opacity: 1;
  color: var(--accent) !important;
}

[data-theme="light"] footer.bg-dark {
  color: var(--text);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  /* mismo patrón que el footer en oscuro: overlay sutil con el acento + --footer-bg como base */
  background:
    radial-gradient(900px 420px at 18% 0%, var(--footer-highlight), transparent 60%),
    var(--footer-bg) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="light"] footer.bg-dark .text-white,
[data-theme="light"] footer.bg-dark p,
[data-theme="light"] footer.bg-dark li,
[data-theme="light"] footer.bg-dark h6 {
  color: var(--text) !important;
}

[data-theme="light"] footer.bg-dark .text-white-50 {
  color: var(--muted) !important;
}

[data-theme="light"] footer.bg-dark hr {
  border-color: rgba(0, 0, 0, 0.12) !important;
}
