/* Visor de fichas técnicas — MAPYESSA. Hereda tipografía y color de texto del tema. */
.mfx {
  --mfx-blue: #0089e4;
  --mfx-blue-dark: #0a4f8a;   /* texto/acentos sobre blanco con contraste AA */
  --mfx-bg: #f5f8fa;
  --mfx-line: #d5dee6;
  max-width: 1100px;
  margin: 0 auto;
  font: inherit;
  color: inherit;
}
.mfx:not(.is-ready) { min-height: 820px; } /* reserva el espacio mientras JS arma el visor (evita saltos de layout) */
.mfx *, .mfx *::before, .mfx *::after { box-sizing: border-box; }
.mfx [hidden] { display: none !important; }

/* Selectores */
.mfx-filters {
  /* Selectores centrados: se muestran 3 o 4 según la cascada (Serie sólo aparece si la marca la tiene) */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: var(--mfx-bg);
  border-radius: 12px;
}
.mfx-field { flex: 0 1 300px; min-width: 220px; }
.mfx-field[hidden] { display: none; }
.mfx-field label { display: block; margin: 0 0 6px; font-weight: 600; }
.mfx-field select {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #8aa0b3;
  border-radius: 4px;
}
.mfx-field select:disabled { background: #eef2f5; color: #5b6b78; }

.mfx-notice { margin: 16px 0 0; padding: 12px 16px; background: #fff7e0; border-left: 4px solid #f59e0b; border-radius: 4px; }
.mfx-notice:empty { display: none; }
.mfx-notice a { color: var(--mfx-blue-dark); font-weight: 600; }
.mfx-status { margin: 18px 0 8px; font-size: .95em; color: #3c4b57; }

/* Botones: azul oscuro de la marca para que el texto blanco cumpla contraste AA (#0089e4 da 3.7:1) */
.mfx-btn {
  display: inline-block;
  min-height: 44px;
  padding: 10px 22px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--mfx-blue-dark);
  border: 2px solid var(--mfx-blue-dark);
  border-radius: 4px;
  cursor: pointer;
}
.mfx-btn:hover { background: #083e6e; border-color: #083e6e; color: #fff; }
.mfx-btn--ghost { color: var(--mfx-blue-dark); background: #fff; }
.mfx-btn--ghost:hover { color: #fff; }
.mfx-btn--sm { min-height: 38px; padding: 6px 14px; font-size: .92em; }
.mfx a:focus-visible, .mfx button:focus-visible, .mfx select:focus-visible, .mfx [tabindex]:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

/* Tabla */
.mfx-table-wrap { border: 1px solid var(--mfx-line); border-radius: 8px; overflow: hidden; }
.mfx-table { width: 100%; margin: 0; border-collapse: collapse; background: #fff; }
.mfx-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mfx-table th, .mfx-table td { padding: 12px 16px; text-align: left; vertical-align: middle; border: 0; border-bottom: 1px solid var(--mfx-line); }
.mfx-table thead th { background: var(--mfx-blue-dark); color: #fff; font-weight: 600; }
.mfx-table tbody th { font-weight: 600; }
.mfx-table tbody tr:last-child > * { border-bottom: 0; }
.mfx-table tr.is-selected > * { background: #e6f3fc; }
.mfx-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mfx-table-wrap + .mfx-btn { display: block; margin: 16px auto 0; }

/* Visor */
.mfx-viewer { margin-top: 32px; scroll-margin-top: 90px; }
.mfx-viewer[hidden] { display: none; }
.mfx-viewer h2 { margin: 0 0 12px; }
.mfx-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.mfx-frame { display: block; width: 100%; height: 75vh; min-height: 420px; background: var(--mfx-bg); border: 1px solid var(--mfx-line); border-radius: 8px; }
.mfx-note { margin: 10px 0 0; font-size: .92em; color: #3c4b57; }

/* CTA */
.mfx-cta { margin-top: 40px; text-align: center; }
.mfx-cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.mfx-btn--wa { display: inline-flex; align-items: center; gap: 10px; }
.mfx-btn--wa svg { flex: none; }
.mfx-cta-text { margin: 0 0 14px; font-size: 1.15em; font-weight: 600; }

/* Tablet / móvil */
@media (max-width: 921px) {
  .mfx-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mfx-field { min-width: 0; }
}
@media (max-width: 640px) {
  .mfx-filters { display: grid; grid-template-columns: 1fr; padding: 16px; }
  .mfx-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mfx-table, .mfx-table tbody, .mfx-table tr, .mfx-table th, .mfx-table td { display: block; width: 100%; }
  .mfx-table tr { padding: 10px 0; border-bottom: 1px solid var(--mfx-line); }
  .mfx-table tbody tr:last-child { border-bottom: 0; }
  .mfx-table th, .mfx-table td { padding: 4px 16px; border: 0; }
  .mfx-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; }
  .mfx-table td.mfx-row-actions::before { content: none; }
  .mfx-table td.mfx-row-actions { display: flex; padding-top: 8px; }
  .mfx-frame { height: 65vh; }
}
@media (prefers-reduced-motion: reduce) { .mfx * { scroll-behavior: auto !important; } }
