/* Reproductor de la radio en la barra superior violeta (#a143f7) del tema news-magazine-x */
#bi-radio {
  --bir-violeta: #a143f7;
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; padding-left: 14px; flex: none;
  height: 30px; color: #fff; font-size: 13px; line-height: 1;
  white-space: nowrap; position: relative; z-index: 2;
  background: linear-gradient(90deg, rgba(161, 67, 247, 0), var(--bir-violeta) 14px);
}
.newsx-top-section-wrap .newsx-builder-grid-row { display: flex; align-items: center; }
.newsx-top-section-wrap .newsx-grid-column-left { min-width: 0; flex: 1 1 auto; overflow: hidden; }

#bi-radio .bir-play {
  width: 24px; height: 24px; min-width: 24px; padding: 0; border: 0; border-radius: 50%;
  background: #fff; color: #5b1aa6; display: inline-grid; place-items: center; cursor: pointer;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .5);
}
#bi-radio .bir-play svg { width: 12px; height: 12px; fill: currentColor; }
#bi-radio .bir-ic-pausa, #bi-radio.bir-on .bir-ic-play { display: none; }
#bi-radio.bir-on .bir-ic-pausa { display: block; }
#bi-radio .bir-play:focus-visible, #bi-radio .bir-pop:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

#bi-radio .bir-txt { display: inline-flex; align-items: baseline; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
#bi-radio .bir-txt b { font-weight: 700; }
#bi-radio .bir-tema { overflow: hidden; text-overflow: ellipsis; opacity: .9; }

/* Ondas: quietas hasta que suena */
#bi-radio .bir-ondas { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
#bi-radio .bir-ondas i { width: 3px; height: 4px; background: #fff; border-radius: 1px; opacity: .55; }
#bi-radio.bir-on .bir-ondas i { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  #bi-radio.bir-on .bir-ondas i { animation: bir-onda 1s ease-in-out infinite; }
  #bi-radio.bir-on .bir-ondas i:nth-child(2) { animation-delay: .2s; }
  #bi-radio.bir-on .bir-ondas i:nth-child(3) { animation-delay: .4s; }
  #bi-radio.bir-cargando .bir-play { animation: bir-pulso 1s ease-out infinite; }
}
@keyframes bir-onda { 0%, 100% { height: 4px; } 50% { height: 12px; } }
@keyframes bir-pulso { to { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); } }

#bi-radio .bir-pop { color: #fff; opacity: .85; display: inline-grid; place-items: center; width: 22px; height: 22px; }
#bi-radio .bir-pop:hover { opacity: 1; }
#bi-radio .bir-pop svg { width: 13px; height: 13px; fill: currentColor; }

/* Si el tema cambia y no está la barra, queda flotando abajo a la derecha */
#bi-radio.bir-flotante {
  position: fixed; right: 12px; bottom: 12px; height: 40px; padding: 0 12px; border-radius: 20px;
  background: var(--bir-violeta); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); z-index: 9999;
}

@media (max-width: 768px) {
  #bi-radio { padding-left: 10px; gap: 6px; }
  #bi-radio .bir-tema, #bi-radio .bir-pop { display: none; }
  #bi-radio .bir-txt b { font-size: 12px; }
}

/* Widget de barra lateral para abrir la ventanita (en mobile el ícono de la barra no entra) */
.bir-widget {
  background: radial-gradient(120% 120% at 50% 0%, #5b1aa6 0%, #2a0a4f 75%); color: #fff;
  border-radius: 10px; padding: 16px; text-align: center; font-size: 15px; line-height: 1.35;
}
.bir-widget p { margin: 0; color: inherit; }
.bir-widget .birw-vivo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.bir-widget .birw-vivo i { width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; }
.bir-widget .birw-txt { margin: 6px 0 12px; opacity: .9; }
.bir-widget .birw-abrir {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 22px; background: #fff; color: #5b1aa6; font-weight: 700; text-decoration: none;
}
.bir-widget .birw-abrir:hover { color: #5b1aa6; background: #f1e6ff; }
.bir-widget .birw-abrir:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.bir-widget .birw-abrir svg { width: 14px; height: 14px; fill: currentColor; }
.bir-widget .birw-nota { margin-top: 8px; font-size: 13px; opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  .bir-widget .birw-vivo i { animation: birw-luz 1.4s ease-in-out infinite; }
}
@keyframes birw-luz { 50% { opacity: .3; } }

/* Botón flotante abajo a la izquierda (a la derecha está el "volver arriba" del tema) */
#bi-radio-flota {
  position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 9998;
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 14px; border-radius: 23px;
  background: #5b1aa6; color: #fff; font-size: 15px; font-weight: 700; line-height: 1; text-decoration: none;
  box-shadow: 0 6px 18px rgba(42, 10, 79, .35);
}
#bi-radio-flota:hover { background: #4a1489; color: #fff; }
#bi-radio-flota:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px #5b1aa6; }
#bi-radio-flota svg { width: 14px; height: 14px; fill: currentColor; }
#bi-radio-flota .birf-luz { width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; }
@media (prefers-reduced-motion: no-preference) {
  #bi-radio-flota .birf-luz { animation: birw-luz 1.4s ease-in-out infinite; }
}
@media print { #bi-radio-flota { display: none; } }
