/* =====================================================================
   static/global/mya-accesibilidad.css
   Accesibilidad para TODO el sistema (admin, empleado, proveedor, cliente
   y páginas públicas). Cada opción se activa con un atributo en <html>
   (lo pone mya-accesibilidad.js o el script corto del <head>):

     data-mya-contraste   alto contraste
     data-mya-oscuro      modo oscuro
     data-mya-fuente      fuente de fácil lectura (Atkinson Hyperlegible)
     data-mya-espaciado   más espacio entre letras, palabras y líneas
     data-mya-enlaces     enlaces subrayados y resaltados
     data-mya-cursor      cursor grande
     data-mya-botones     botones y campos más grandes (≥ 44 px)
     data-mya-letra       (ya existía) tamaño de letra
     data-mya-sin-animacion (ya existía) reducir animaciones

   Pautas WCAG 2.1 nivel AA (NTC 5854 · Resolución MinTIC 1519 de 2020).

   Multi YA 1.1.0 (2026-11-24) · Sin cambios de código en esta versión
   ===================================================================== */

@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/vendor/fuentes/archivos/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF; }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/vendor/fuentes/archivos/atkinson-hyperlegible-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/vendor/fuentes/archivos/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF; }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/vendor/fuentes/archivos/atkinson-hyperlegible-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }

/* ── Siempre activo: foco visible y «saltar al contenido» ─────────── */
:focus-visible {
  outline: 3px solid #14532d !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(34, 197, 94, .35) !important;
}
.mya-saltar {
  position: fixed; top: 8px; left: 8px; z-index: 2147483400;
  padding: 12px 18px; border-radius: 10px; background: #14532d; color: #fff !important;
  font: 700 15px/1.2 system-ui, sans-serif; text-decoration: none;
  transform: translateY(-160%); transition: transform .15s ease;
}
.mya-saltar:focus { transform: translateY(0); }
.mya-solo-lector {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Alto contraste y modo oscuro ────────────────────────────────────
   Se aplican como filtro sobre toda la página: funcionan igual en los
   cuatro portales sin reescribir cada hoja de estilos. Las fotos se
   «des-invierten» para que se vean con sus colores reales. */
/* Alto contraste: bordes y textos grises se oscurecen (sin borrar el
   fondo de tarjetas y botones); un filtro suave refuerza los colores. */
html[data-mya-contraste] { filter: contrast(1.1) saturate(1.08); }
/* Grises suaves de cada portal → tonos oscuros legibles (contraste ≥ 7:1).
   Solo se tocan los grises: el texto blanco sobre fondos verdes no cambia. */
html[data-mya-contraste] {
  --muted: #334155; --muted-lt: #3f4b5c; --muted-light: #3f4b5c; --soft: #0f172a; --text-soft: #0f172a;
  --text-muted: #334155; --text-sub: #0f172a; --ink-soft: #0f172a; --tn-gris: #26332b; --tn-suave: #1f2a23;
  --mya-suave: #1e293b; --border: #64748b; --border-sub: #94a3b8; --line-soft: #94a3b8; --border-soft: #94a3b8;
  --mya-borde: #64748b; --tn-borde: #64748b;
}
html[data-mya-contraste] ::placeholder { color: #475569 !important; opacity: 1 !important; }
html[data-mya-oscuro] { filter: invert(.92) hue-rotate(180deg); background: #fff; }
html[data-mya-oscuro][data-mya-contraste] { filter: invert(.95) hue-rotate(180deg) contrast(1.15); }
html[data-mya-oscuro] :is(img, video, picture, canvas, iframe, [style*="background-image"], .banner-imagen-1,
  .banner-imagen-2, .hero-photo, .valores-foto, .trabajo-imagen, .mya-a11y-sin-invertir) {
  filter: invert(1) hue-rotate(180deg);
}
html[data-mya-oscuro] :is(img, video, canvas) :is(img, video, canvas) { filter: none; }
html[data-mya-contraste] :is(body, p, li, td, th, label, small, span, dd, dt) { text-shadow: none !important; }
html[data-mya-contraste] :is(input, select, textarea) { border-width: 2px !important; border-color: #334155 !important; }
html[data-mya-contraste] ::placeholder { color: #475569 !important; opacity: 1 !important; }

/* ── Fuente de fácil lectura ─────────────────────────────────────────
   (los íconos usan fuentes propias: no se tocan) */
html[data-mya-fuente] body,
html[data-mya-fuente] body :where(*:not(i):not(.ti):not([class^="ti-"]):not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands):not(.bx):not([class^="bx"]):not(.material-icons)) {
  font-family: 'Atkinson Hyperlegible', 'Verdana', system-ui, sans-serif !important;
}

/* ── Espaciado de texto (WCAG 1.4.12) ─────────────────────────────── */
html[data-mya-espaciado] body :is(p, li, td, th, label, dd, dt, small, blockquote, h1, h2, h3, h4, h5, h6, .chatbot-msg) {
  letter-spacing: .06em !important; word-spacing: .14em !important; line-height: 1.75 !important;
}
html[data-mya-espaciado] body :is(p, li) { margin-bottom: .6em; }

/* ── Enlaces resaltados ──────────────────────────────────────────── */
html[data-mya-enlaces] body a:not(.mya-saltar) {
  text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important;
}
html[data-mya-enlaces] body :is(a, button, [role="button"]):hover {
  outline: 2px dashed #16a34a !important; outline-offset: 2px !important;
}

/* ── Cursor grande ───────────────────────────────────────────────── */
html[data-mya-cursor], html[data-mya-cursor] * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M6 3l28 16-12 3-6 12z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto !important;
}
html[data-mya-cursor] :is(a, button, [role="button"], select, label[for], summary, input[type="checkbox"], input[type="radio"]),
html[data-mya-cursor] :is(a, button, [role="button"]) * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46' viewBox='0 0 46 46'%3E%3Cpath d='M16 4a4 4 0 018 0v14l8 2a5 5 0 014 6l-3 12a6 6 0 01-6 5H20a6 6 0 01-5-3l-8-13a4 4 0 016-5l3 3z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 18 4, pointer !important;
}
html[data-mya-cursor] :is(input:not([type="checkbox"]):not([type="radio"]), textarea, [contenteditable]) { cursor: text !important; }

/* ── Botones y campos más grandes (WCAG 2.5.5) ───────────────────── */
html[data-mya-botones] body :is(button, .btn, a.btn, [role="button"], input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select) {
  min-height: 44px !important;
}
html[data-mya-botones] body :is(button, [role="button"]) { min-width: 44px !important; }
html[data-mya-botones] body :is(input[type="checkbox"], input[type="radio"]) { width: 22px !important; height: 22px !important; }

/* ── Guía de lectura (franja que sigue al ratón) ─────────────────── */
.mya-guia {
  position: fixed; left: 0; right: 0; height: 46px; pointer-events: none; z-index: 2147483300;
  box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .42);
  border-top: 3px solid #22c55e; border-bottom: 3px solid #22c55e;
  transform: translateY(-50%);
}

/* ── Lo que se está leyendo en voz alta ──────────────────────────── */
.mya-leyendo { outline: 3px solid #16a34a !important; outline-offset: 3px !important; background-color: rgba(34, 197, 94, .1) !important; }
.mya-voz-burbuja {
  position: absolute; z-index: 2147483300; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; border: none; cursor: pointer;
  background: #15803d; color: #fff; font: 700 14px/1 system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .3);
}

/* ── Botón y panel de accesibilidad ──────────────────────────────── */
.mya-a11y-btn {
  position: fixed; right: 0; top: 46%; z-index: 99980;
  width: 40px; height: 50px; padding: 0 0 0 3px; border: none; border-radius: 14px 0 0 14px; cursor: pointer;
  background: linear-gradient(150deg, #22c55e, #15803d); color: #fff; display: grid; place-items: center;
  box-shadow: -4px 6px 18px rgba(21, 128, 61, .35); transition: width .15s ease, background .15s ease;
}
.mya-a11y-btn:hover, .mya-a11y-btn:focus-visible, .mya-a11y-btn[aria-expanded="true"] { width: 54px; background: linear-gradient(150deg, #16a34a, #14532d); }
.mya-a11y-btn svg { width: 28px; height: 28px; }
.mya-a11y-btn .mya-a11y-activo {
  position: absolute; top: 5px; left: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: #facc15; border: 2px solid #15803d;
}
.mya-a11y-btn .mya-a11y-activo[hidden] { display: none; }
@media print { .mya-a11y-btn, .mya-a11y-panel, .mya-guia, .mya-saltar, .mya-voz-burbuja { display: none !important; } }

.mya-a11y-panel {
  position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 2147483200;
  width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto;
  background: #fff; color: #0f172a; border-radius: 18px; border: 1px solid #e2e8f0;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35);
  font: 400 15px/1.45 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.mya-a11y-panel[hidden] { display: none; }
.mya-a11y-cab {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px; background: linear-gradient(125deg, #0f3d24 0%, #14532d 45%, #166534 75%, #1a7a3e 100%); color: #fff; border-radius: 18px 18px 0 0;
}
.mya-a11y-cab h2 { margin: 0; font-family: inherit; letter-spacing: 0; text-transform: none; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; color: #fff; }
.mya-a11y-cab h2 svg { width: 26px; height: 26px; }
.mya-a11y-cab small { display: block; font-size: 12.5px; opacity: .85; font-weight: 500; }
.mya-a11y-x {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12);
  color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.mya-a11y-cuerpo { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.mya-a11y-sec h3 { margin: 0 0 8px; font-family: inherit; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #475569; font-weight: 800; }
.mya-a11y-letra { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mya-a11y-letra button {
  padding: 10px 6px; border-radius: 12px; border: 2px solid #e2e8f0; background: #f8fafc; color: #0f172a;
  font-weight: 800; cursor: pointer; font-family: inherit;
}
.mya-a11y-letra button:nth-child(1) { font-size: 15px; }
.mya-a11y-letra button:nth-child(2) { font-size: 19px; }
.mya-a11y-letra button:nth-child(3) { font-size: 23px; }
.mya-a11y-letra button[aria-pressed="true"] { border-color: #16a34a; background: #f0fdf4; color: #15803d; }
.mya-a11y-rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mya-a11y-op {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 12px; border-radius: 14px; border: 2px solid #e2e8f0; background: #f8fafc; color: #0f172a;
  cursor: pointer; font: inherit; min-height: 84px; position: relative; transition: border-color .15s, background .15s;
}
.mya-a11y-op:hover { border-color: #86efac; }
.mya-a11y-op[aria-pressed="true"] { border-color: #16a34a; background: #f0fdf4; }
.mya-a11y-op[aria-pressed="true"]::after {
  content: '✓'; position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: #16a34a; color: #fff; font-size: 13px; font-weight: 800;
}
.mya-a11y-op svg { width: 26px; height: 26px; color: #15803d; }
.mya-a11y-op b { font-size: 14.5px; }
.mya-a11y-op small { font-size: 12.5px; color: #475569; line-height: 1.3; }
.mya-a11y-voz { display: flex; flex-wrap: wrap; gap: 8px; }
.mya-a11y-accion {
  flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 2px solid #16a34a; background: #16a34a; color: #fff;
  font: 700 14.5px/1.2 inherit; font-family: inherit; cursor: pointer;
}
.mya-a11y-accion.sec { background: #fff; color: #15803d; }
.mya-a11y-accion svg { width: 20px; height: 20px; }
.mya-a11y-vel { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; color: #334155; }
.mya-a11y-vel input { flex: 1; accent-color: #16a34a; }
.mya-a11y-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: #475569; }
.mya-a11y-reset {
  padding: 9px 14px; border-radius: 10px; border: 2px solid #e2e8f0; background: #fff; color: #b91c1c;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
kbd.mya-tecla { display: inline-block; padding: 1px 6px; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 6px; background: #f8fafc; font: 600 12px/1.4 ui-monospace, monospace; color: #0f172a; }

/* El panel no se invierte en modo oscuro: ya está pensado con buen contraste */
html[data-mya-oscuro] :is(.mya-a11y-panel, .mya-a11y-btn, .mya-voz-burbuja, .mya-saltar) { filter: invert(1) hue-rotate(180deg); }

@media (max-width: 640px) {
  /* En celular queda a media altura del borde derecho: abajo están el chat,
     Yami y el carrito, que no deben quedar tapados */
  .mya-a11y-btn { top: 42%; bottom: auto; width: 34px; height: 46px; }
  .mya-a11y-btn svg { width: 22px; height: 22px; }
  .mya-a11y-panel { top: auto; bottom: 0; right: 0; transform: none; width: 100vw; max-height: 88vh; border-radius: 18px 18px 0 0; }
  .mya-a11y-cab { border-radius: 18px 18px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .mya-a11y-btn, .mya-saltar { transition: none; } }
