/* ============================================================
   Want2peak — Herramientas de Accesibilidad
   ============================================================ */
:root {
  --a11y-scale: 1;
}

/* ---- Floating toggle (sobre el botón de WhatsApp) ---- */
.a11y-fab {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--red, #E5114B);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px -8px rgba(229,17,75,0.55);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease;
}
.a11y-fab:hover { transform: scale(1.07); }
.a11y-fab:focus-visible { outline: 3px solid var(--navy, #0F1F4D); outline-offset: 3px; }
.a11y-fab svg { width: 28px; height: 28px; }

/* ---- Panel ---- */
.a11y-panel {
  position: fixed;
  right: 24px;
  bottom: 162px;
  z-index: 61;
  width: 268px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 28px 70px -20px rgba(10,14,31,0.4), 0 6px 18px -8px rgba(10,14,31,0.2);
  padding: 22px 18px 18px;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.a11y-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.a11y-panel h2 {
  font-family: var(--font-display, sans-serif);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.15;
  text-align: center;
  color: var(--red, #E5114B);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.a11y-panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted, #6B7280);
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.a11y-panel-close:hover { background: rgba(15,31,77,0.08); color: var(--ink, #0A0E1F); }

.a11y-list { display: flex; flex-direction: column; gap: 9px; }

.a11y-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line, rgba(15,31,77,0.14));
  border-radius: 11px;
  background: #fff;
  color: var(--ink, #0A0E1F);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.a11y-btn svg { flex: none; color: var(--navy, #0F1F4D); }
.a11y-btn:hover { border-color: var(--red, #E5114B); transform: translateY(-1px); }
.a11y-btn:focus-visible { outline: 3px solid var(--navy, #0F1F4D); outline-offset: 2px; }
.a11y-btn.active {
  border-color: var(--red, #E5114B);
  background: rgba(229,17,75,0.08);
}
.a11y-btn.active svg { color: var(--red, #E5114B); }

.a11y-btn.read-page {
  justify-content: center;
  background: var(--red, #E5114B);
  border-color: var(--red, #E5114B);
  color: #fff;
  margin-top: 4px;
}
.a11y-btn.read-page svg { color: #fff; }
.a11y-btn.read-page:hover { background: var(--red-deep, #B30A39); border-color: var(--red-deep, #B30A39); }
.a11y-btn.read-page.active { background: var(--red-deep, #B30A39); }

.a11y-reset {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 4px;
  border: none;
  background: transparent;
  color: var(--muted, #6B7280);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.a11y-reset:hover { color: var(--red, #E5114B); }

/* ============================================================
   Estados aplicados al documento
   ============================================================ */

/* Escala de texto */
html.a11y-scaled body { font-size: calc(100% * var(--a11y-scale)); }

/* Fuente para dislexia */
html.a11y-dyslexia body,
html.a11y-dyslexia body * {
  font-family: 'OpenDyslexic', 'Comic Sans MS', 'Segoe UI', sans-serif !important;
  letter-spacing: 0.04em !important;
  word-spacing: 0.14em !important;
  line-height: 1.7 !important;
}

/* Alto contraste */
html.a11y-contrast {
  filter: contrast(1.32) saturate(1.15);
}
html.a11y-contrast body {
  background: #000 !important;
  color: #fff !important;
}
html.a11y-contrast a { color: #ffd60a !important; }

/* Resaltar enlaces */
html.a11y-links a {
  outline: 2px solid #ffd60a !important;
  outline-offset: 2px;
  background: rgba(255,214,10,0.22) !important;
  text-decoration: underline !important;
  border-radius: 2px;
}

/* Modo leer elemento seleccionado */
html.a11y-pick-mode,
html.a11y-pick-mode * { cursor: help !important; }
.a11y-read-highlight {
  outline: 3px dashed var(--red, #E5114B) !important;
  outline-offset: 2px;
  background: rgba(229,17,75,0.10) !important;
}

@media print {
  .a11y-fab, .a11y-panel { display: none !important; }
}

/* ============================================================
   Foco visible global por teclado (WCAG 2.4.7)
   Anillo amarillo con halo navy: visible sobre fondos claros y oscuros.
   Solo aparece en navegación por teclado, no al hacer clic con el mouse.
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 3px solid #FFD60A !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(15,31,77,0.45) !important;
  border-radius: 6px;
}
/* No mostrar el anillo al hacer clic con el mouse (navegadores modernos) */
:focus:not(:focus-visible) { outline: none; }

/* ---- Apertura de menús por teclado (no solo hover) ---- */
.nav-dropdown:focus-within > .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.nav-dropdown:focus-within .nav-chevron { transform: rotate(180deg); }
.nav-menu-item.has-sub:focus-within .nav-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---- Skip link (saltar al contenido) ---- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  transform: translateY(-160%);
  background: var(--navy, #0F1F4D);
  color: #fff;
  font-family: var(--font-body, system-ui, sans-serif);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,0.5);
  transition: transform .2s ease;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #FFD60A;
  outline-offset: 2px;
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
