/* ============================================
   ff-base.css — Reglas tipograficas globales del plugin
   Carga ANTES que los demas CSS del plugin para garantizar que TODOS
   los contenedores ff-* heredan Montserrat, incluso si el theme del WP
   tiene reglas con alta specificity para tags concretos (body p, h1, etc.).
   ============================================ */

/* Aplica Montserrat a todos los contenedores ff-* y a TODOS sus hijos
   (excepto SVGs y sus internos, que no usan font-family). El selector
   :is() agrupa los contenedores principales del plugin para mantener la
   regla legible. */
.ff-cajon,
.ff-cajon *:not(svg):not(svg *),
.ff-resultados,
.ff-resultados *:not(svg):not(svg *),
.ff-salidas,
.ff-salidas *:not(svg):not(svg *),
.ff-horarios,
.ff-horarios *:not(svg):not(svg *),
.ff-call-center,
.ff-call-center *:not(svg):not(svg *),
.ff-gestion,
.ff-gestion *:not(svg):not(svg *),
.ff-checkout,
.ff-checkout *:not(svg):not(svg *),
.ff-callback,
.ff-callback *:not(svg):not(svg *),
.ff-modal-tarifas,
.ff-modal-tarifas *:not(svg):not(svg *),
.ff-metodos-pago,
.ff-metodos-pago *:not(svg):not(svg *) {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Form elements (input, button, select, textarea) no heredan font-family
   por defecto en algunos navegadores/themes. Forzar inherit para que tomen
   Montserrat del contenedor padre. */
.ff-cajon button, .ff-cajon input, .ff-cajon select, .ff-cajon textarea,
.ff-resultados button, .ff-resultados input, .ff-resultados select, .ff-resultados textarea,
.ff-call-center button, .ff-call-center input,
.ff-gestion button, .ff-gestion input, .ff-gestion select, .ff-gestion textarea,
.ff-checkout button, .ff-checkout input, .ff-checkout select, .ff-checkout textarea,
.ff-callback button, .ff-callback input,
.ff-modal-tarifas button {
    font-family: inherit;
}

/* Asegurar que [hidden] oculta siempre dentro de nuestros contenedores —
   algunos themes / builders (Cornerstone, etc.) sobreescriben la regla
   nativa del browser y dejan visibles los paneles de estado, mostrando
   rectangulos vacios encima/debajo del contenido activo.

   Selector amplio: cualquier elemento del plugin con [hidden]
   (los forms de Redsys, modales, paneles de estado, etc.).
*/
[class^="ff-"][hidden],
[class*=" ff-"][hidden],
[id^="ff-"][hidden],
.ff-cajon [hidden],
.ff-resultados [hidden],
.ff-salidas [hidden],
.ff-horarios [hidden],
.ff-call-center [hidden],
.ff-gestion [hidden],
.ff-checkout [hidden],
.ff-callback [hidden],
.ff-modal-tarifas [hidden] {
    display: none !important;
}

/* Limpieza de wrappers fantasma generados por wpautop/Cornerstone:
   cuando un shortcode genera HTML estructurado, WP a veces lo envuelve en
   <p> o lo embebe en <code> y deja restos vacios alrededor. Esos <p></p>
   y <code></code> heredan estilos del theme (borde gris, fondo) y se ven
   como rectangulos vacios. Los ocultamos con specificity alta para ganar
   a las reglas del theme.

   `body` aumenta specificity para vencer reglas del theme con !important
   en `code` o similares. */
body .entry-content p:empty,
body .entry-content code:empty,
body .entry-content pre:empty,
body .x-text p:empty,
body .x-text code:empty,
body .x-text pre:empty,
body .x-content p:empty,
body .x-content code:empty,
body .x-content pre:empty {
    display: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    width: 0 !important;
    height: 0 !important;
}
/* Tambien <p> que solo contiene espacios o un <br> */
.entry-content p > br:only-child,
.x-text p > br:only-child {
    display: none;
}

/* ULTIMA LINEA DE DEFENSA: en Cornerstone Text element (.x-text), un
   <code> hijo directo es SIEMPRE un artefacto de wpautop o del editor —
   no es contenido legitimo. Lo matamos sin mas. Si algun dia el cliente
   quiere un <code> legitimo dentro de un Text element, debe envolverlo
   en algun otro tag. */
body .x-text > code,
body .x-text > p > code:only-child {
    display: none !important;
}
