/* ==========================================================================
   components.css — botones, enlaces del menú y botón hamburguesa
   ========================================================================== */

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--color-red);
  color: var(--color-white);
}

.btn--primary:hover {
  background: var(--color-red-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-text);
}

.btn--ghost:hover {
  background: var(--color-text);
  color: var(--color-surface);
}

/* ---------- Enlaces del menú ---------- */

.nav__link {
  position: relative;
  padding: 6px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  transition: color var(--transition);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--color-red);
  transition: width var(--transition);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--color-red);
}

.nav__link:hover::after,
.nav__link:focus-visible::after {
  width: 100%;
}

/* ---------- Botón de modo claro / oscuro ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid #2a2a2e;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* En modo oscuro el botón se invierte y muestra el sol */
:root[data-theme="dark"] .theme-toggle {
  background: #f5f5f7;
  color: #111111;
  border-color: #d0d0d4;
}

.theme-toggle__sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

/* ---------- Botón hamburguesa (móvil) ---------- */

.menu-toggle {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Estado abierto: la X */
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
