/* MiExperienxia · piezas comunes de interfaz (ui.css) · 188, 190
   Se carga al final, después de estilos.css y del <style> de cada página. */

/* ---------- Ventana de confirmación (MXUI.confirmar) ---------- */
.mx-confirmar-abierta, .mx-confirmar-abierta body { overflow: hidden; }
.mx-confirmar-fondo {
  position: fixed; inset: 0; z-index: 20000;
  background: rgba(28, 20, 36, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.mx-confirmar {
  width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: #FFFFFF; color: #1C1424;
  border-radius: 20px; padding: 22px 18px 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 12px 40px rgba(28, 20, 36, 0.25);
  font-family: "Figtree", system-ui, sans-serif;
}
.mx-confirmar-etiqueta {
  align-self: flex-start; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: #FCE4EE; color: #8A1040;
}
.mx-confirmar-titulo { margin: 0; font-family: "Bricolage Grotesque", "Figtree", sans-serif; font-size: 21px; line-height: 1.25; }
.mx-confirmar-consecuencia { margin: 0; font-size: 15px; line-height: 1.45; color: #3A3442; }
.mx-confirmar-reversible { margin: 0; font-size: 13px; line-height: 1.4; color: #5A5463; }
.mx-confirmar-acciones { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.mx-confirmar-acciones button {
  min-height: 48px; border-radius: 12px; font: 700 16px "Figtree", system-ui, sans-serif; cursor: pointer;
}
.mx-confirmar-si { border: 0; background: #1C1424; color: #FFFFFF; }
.mx-confirmar-si.mx-confirmar-peligro { background: #A8321F; }
.mx-confirmar-no { border: 1.5px solid #D3D6DD; background: #FFFFFF; color: #1C1424; }
.mx-confirmar-acciones button:focus-visible { outline: 3px solid #C2185B; outline-offset: 2px; }

/* ---------- Hoja al frente (guías del "?") ---------- */
.hoja-al-frente:not([hidden]) {
  position: fixed; z-index: 900;
  left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 560px); box-sizing: border-box;
  max-height: 85vh; overflow-y: auto; margin: 0;
  border-radius: 24px 24px 0 0;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 0 0 100vmax rgba(28, 20, 36, 0.45);
}

/* ---------- Tarjeta desplegable ---------- */
details.tarjeta-desplegable > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
details.tarjeta-desplegable > summary::-webkit-details-marker { display: none; }
details.tarjeta-desplegable > summary::after { content: "▾"; font-size: 18px; transition: transform 0.15s; }
details.tarjeta-desplegable[open] > summary::after { transform: rotate(180deg); }
details.tarjeta-desplegable > summary > * { margin: 0; }

/* ---------- 190 · Esqueleto: barra superior ---------- */
.mx-barra-superior {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 60px; padding: 8px 12px; box-sizing: border-box;
  background: #FFFFFF; border-bottom: 1px solid #E4E6EB;
}
.mx-barra-superior[hidden] { display: none; }
.mx-boton-redondo {
  position: relative; flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 22px; background: #F4F5F7; color: #1C1424; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.mx-boton-redondo:focus-visible, .mx-marca-boton:focus-visible, .mx-menu-item:focus-visible, .mx-hoja-item:focus-visible, .mx-aviso:focus-visible { outline: 3px solid #C2185B; outline-offset: 2px; }
.mx-boton-menu::before, .mx-boton-avisos::before {
  content: ""; width: 22px; height: 22px; background-color: currentColor;
  -webkit-mask: var(--icono) center / 22px 22px no-repeat; mask: var(--icono) center / 22px 22px no-repeat;
}
.mx-boton-menu { --icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E"); }
.mx-boton-avisos { --icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16V11a6 6 0 0 1 12 0v5l2 2H4z'/%3E%3Cpath d='M10 20a2 2 0 0 0 4 0'/%3E%3C/svg%3E"); }
.mx-boton-avisos[hidden] { display: none; }
.mx-contador {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: #C2185B; color: #FFFFFF; font: 700 11px/18px "Figtree", system-ui, sans-serif; text-align: center;
}
.mx-contador[hidden] { display: none; }
.mx-marca-boton { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; align-items: center; min-height: 44px; border: 0; background: transparent; padding: 0 4px; cursor: pointer; color: #1C1424; }
span.mx-marca-boton { cursor: default; }
.mx-marca { font-family: "Bricolage Grotesque", "Figtree", sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; white-space: nowrap; overflow-wrap: normal; }
.mx-marca-acento { color: #C2185B; }

/* ---------- 190 · Capas (menú, hojas, avisos) ---------- */
.mx-capa-abierta, .mx-capa-abierta body { overflow: hidden; }
.mx-capa { position: fixed; inset: 0; z-index: 15000; background: rgba(28, 20, 36, 0.45); display: flex; }
.mx-capa-derecha { justify-content: flex-end; }
.mx-capa-abajo { align-items: flex-end; justify-content: center; }
.mx-capa > div:focus { outline: none; }

.mx-menu {
  width: min(320px, 86vw); height: 100%; box-sizing: border-box; overflow-y: auto;
  background: #FFFFFF; color: #1C1424; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 4px; font-family: "Figtree", system-ui, sans-serif;
}
.mx-menu-cabecera { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mx-boton-cerrar { font-size: 22px; line-height: 1; }
.mx-menu-usuario { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: #F4F5F7; margin-bottom: 8px; }
.mx-menu-avatar { flex: 0 0 44px; height: 44px; border-radius: 22px; background: #FCE4EE; color: #8A1040; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.mx-menu-usuario-textos { display: flex; flex-direction: column; min-width: 0; }
.mx-menu-nombre { font-weight: 700; }
.mx-menu-detalle { font-size: 13px; color: #5A5463; }
.mx-menu-lista { display: flex; flex-direction: column; }
.mx-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px; padding: 0 8px; border: 0; border-bottom: 1px solid #ECEDF1; background: transparent;
  color: #1C1424; font: 500 16px "Figtree", system-ui, sans-serif; text-align: left; text-decoration: none; cursor: pointer;
}
.mx-menu-flecha { color: #8A8494; font-size: 20px; }
.mx-menu-relleno { flex: 1 1 auto; min-height: 16px; }
.mx-menu-salir {
  min-height: 48px; border: 1.5px solid #A8321F; border-radius: 12px; background: #FFFFFF; color: #A8321F;
  font: 700 16px "Figtree", system-ui, sans-serif; cursor: pointer;
}
.mx-menu-pie { margin: 8px 0 0; font-size: 12px; color: #5A5463; text-align: center; }

.mx-hoja {
  width: min(100%, 560px); max-height: 85vh; overflow-y: auto; box-sizing: border-box;
  background: #FFFFFF; color: #1C1424; border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px; font-family: "Figtree", system-ui, sans-serif;
}
.mx-hoja-asa { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: #D3D6DD; }
.mx-hoja-titulo { margin: 0; font-family: "Bricolage Grotesque", "Figtree", sans-serif; font-size: 22px; }
.mx-hoja-nota { margin: 0; font-size: 13px; color: #5A5463; }
.mx-hoja-rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mx-hoja-item {
  min-height: 96px; border: 0; border-radius: 16px; background: #F4F5F7; color: #1C1424; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px; text-align: center;
}
.mx-hoja-ini { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.mx-hoja-texto { font-size: 13px; font-weight: 600; line-height: 1.2; }
.mx-tono-rosa { background: #FCE4EE; color: #8A1040; }
.mx-tono-azul { background: #E5EBFA; color: #1F3C8F; }
.mx-tono-ambar { background: #FFF0CC; color: #7A4E00; }
.mx-tono-verde { background: #E4F2E6; color: #2B5E33; }
.mx-tono-rojo { background: #FBE0DC; color: #8A2A19; }

.mx-aviso {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 14px; border: 0; border-radius: 16px;
  background: #F4F5F7; color: #1C1424; text-align: left; cursor: pointer; font-family: inherit;
}
.mx-aviso-punto { flex: 0 0 12px; height: 12px; margin-top: 5px; border-radius: 6px; }
.mx-aviso-punto.mx-tono-rojo { background: #A8321F; }
.mx-aviso-punto.mx-tono-rosa { background: #C2185B; }
.mx-aviso-punto.mx-tono-ambar { background: #E0A100; }
.mx-aviso-punto.mx-tono-verde { background: #2F6B4A; }
.mx-aviso-punto.mx-tono-azul { background: #2B4FB8; }
.mx-aviso-textos { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mx-aviso-titulo { font-weight: 700; font-size: 15px; }
.mx-aviso-texto { font-size: 14px; color: #5A5463; }
.mx-avisos-vacio { margin: 8px 0; color: #5A5463; }
.mx-hoja-avisos .mx-confirmar-no { min-height: 48px; border-radius: 12px; font: 700 16px "Figtree", system-ui, sans-serif; cursor: pointer; }

/* 195: enlaces con forma de botón */
a.boton-principal, a.boton-secundario { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }

/* 200: barra de navegación inferior (Súper Admin y bazar) */
.mx-nav-inferior {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  min-height: 72px; padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #FFFFFF; border-top: 1px solid #E4E6EB; box-sizing: border-box;
}
.mx-nav-inferior[hidden] { display: none; }
html.con-mx-nav body { padding-bottom: 96px; }
.mx-nav-boton {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 56px; min-width: 0; padding: 4px 2px; border: 0; border-radius: 12px; background: transparent;
  color: #5A5463; font: 500 12px "Figtree", system-ui, sans-serif; line-height: 1.1; white-space: nowrap; cursor: pointer;
}
.mx-nav-boton::before {
  content: ""; width: 24px; height: 24px; background-color: currentColor;
  -webkit-mask: var(--icono) center / 24px 24px no-repeat; mask: var(--icono) center / 24px 24px no-repeat;
}
.mx-nav-boton.mx-nav-activo { color: #1C1424; font-weight: 700; }
.mx-nav-boton.mx-nav-activo::after { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: #C2185B; }
.mx-nav-boton:focus-visible { outline: 2px solid #1C1424; outline-offset: 2px; }
.mx-nav-contador {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #A8321F; color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.mx-nav-contador[hidden] { display: none; }
.mx-icono-inicio { --icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E"); }
.mx-icono-negocios { --icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M3 9h18M8 14h8'/%3E%3C/svg%3E"); }
.mx-icono-bazar { --icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l2-5h14l2 5'/%3E%3Cpath d='M3 9h18v2a3 3 0 0 1-6 0 3 3 0 0 1-6 0 3 3 0 0 1-6 0z'/%3E%3Cpath d='M5 13v7h14v-7'/%3E%3C/svg%3E"); }
.mx-icono-mas { --icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5' cy='12' r='1.5'/%3E%3Ccircle cx='12' cy='12' r='1.5'/%3E%3Ccircle cx='19' cy='12' r='1.5'/%3E%3C/svg%3E"); }

/* 201: aviso flotante */
.mx-aviso-flotante {
  position: fixed; left: 50%; top: calc(72px + env(safe-area-inset-top, 0px)); z-index: 300;
  width: min(92vw, 440px); padding: 14px 16px 14px 44px; border-radius: 14px; box-sizing: border-box;
  background: #2F6B4A; color: #FFFFFF; font: 600 15px/1.35 "Figtree", system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(28, 20, 36, 0.22); cursor: pointer;
  opacity: 0; pointer-events: none; transform: translate(-50%, -12px); transition: opacity 0.2s, transform 0.2s;
}
.mx-aviso-flotante::before { content: "✓"; position: absolute; left: 16px; top: 12px; font-size: 18px; font-weight: 800; }
.mx-aviso-flotante.mx-aviso-error { background: #A8321F; }
.mx-aviso-flotante.mx-aviso-error::before { content: "!"; }
.mx-aviso-flotante.mx-aviso-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .mx-aviso-flotante { transition: none; } }
.mx-aviso-sin-red { position: fixed; top: 0; left: 0; right: 0; z-index: 2147483000; padding: 12px 16px; background: #A8321F; color: #FFFFFF; font-size: 15px; font-weight: 700; line-height: 1.35; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.mx-aviso-sin-red[hidden] { display: none; }


/* 257: sin el recuadro que pinta el navegador al tocar; en su lugar, un leve hundimiento */
html { -webkit-tap-highlight-color: transparent; }
a, button, [role="button"], label, summary, input[type="checkbox"], input[type="radio"], select { -webkit-tap-highlight-color: transparent; }
button:not(:disabled):active, .boton-principal:active, .boton-secundario:active, .mx-boton-redondo:active, .mx-nav-boton:active, .mx-menu-item:active, .mx-hoja-item:active, .tarjeta-modulo:active { transform: scale(0.97); }
button, .boton-principal, .boton-secundario, .mx-boton-redondo, .mx-nav-boton, .mx-menu-item, .mx-hoja-item, .tarjeta-modulo { transition: transform 0.08s ease; }
@media (prefers-reduced-motion: reduce) { button:active, .boton-principal:active, .boton-secundario:active, .mx-boton-redondo:active, .mx-nav-boton:active, .mx-menu-item:active, .mx-hoja-item:active, .tarjeta-modulo:active { transform: none; } }
body { overflow-wrap: anywhere; }
