/* ============================================================
   RADIO ANZORC — FAB flotante compacto (YouTube IFrame API)
   ============================================================ */

/* Contenedor fixed — z-index bajo del navbar; visible solo mientras hero está en viewport */
.radio-fab {
    position: fixed;
    top: 145px;                         /* debajo del navbar con margen extra */
    right: 20px;
    z-index: 40;                        /* nav suele ser 100+, no debe taparlo */
    font-family: inherit;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
    pointer-events: none;
}
.radio-fab.is-hero-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

/* ---- Botón colapsado (default) ---- */
.radio-fab__toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 10px 12px;
    background: linear-gradient(135deg, #0f1a12 0%, #003c19 100%);
    color: white;
    border: 1px solid rgba(237,206,27,.3);
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    box-shadow: 0 12px 32px -8px rgba(0,60,25,.5), inset 0 1px 0 rgba(255,255,255,.08);
    transition: transform .18s, box-shadow .18s;
}
.radio-fab__toggle:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -8px rgba(0,60,25,.6); }
.radio-fab__toggle > i {
    font-size: 18px;
    color: var(--anzorc-amarillo);
}
.radio-fab__label { position: relative; z-index: 1; }
.radio-fab__pulse {
    position: absolute;
    top: 50%; left: 15px;
    transform: translateY(-50%);
    width: 22px; height: 22px;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 0 0 rgba(237,206,27,.7);
    animation: radioFabPulse 2s ease-out infinite;
    pointer-events: none;
}
@keyframes radioFabPulse {
    0% { box-shadow: 0 0 0 0 rgba(237,206,27,.6); }
    70% { box-shadow: 0 0 0 14px rgba(237,206,27,0); }
    100% { box-shadow: 0 0 0 0 rgba(237,206,27,0); }
}
.radio-fab.is-playing .radio-fab__toggle {
    background: linear-gradient(135deg, #003c19 0%, var(--anzorc-verde) 100%);
    border-color: var(--anzorc-amarillo);
}

/* Cuando panel abierto: ocultar el botón toggle */
.radio-fab.is-expanded .radio-fab__toggle { display: none; }

/* ---- Panel expandido ---- */
.radio-fab__panel {
    width: 300px;
    background: #0f1a12;
    background-image:
        radial-gradient(circle at 20% 15%, rgba(237,206,27,.14), transparent 55%),
        radial-gradient(circle at 80% 85%, rgba(0,128,55,.22), transparent 55%);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 14px 14px 12px;
    color: white;
    box-shadow: 0 24px 48px -12px rgba(0,60,25,.5), 0 8px 20px -6px rgba(0,0,0,.3);
    overflow: hidden;
    animation: radioFabIn .22s cubic-bezier(.16,.68,.24,1);
}
[data-fab-panel][hidden] { display: none !important; }
@keyframes radioFabIn {
    from { opacity: 0; transform: translateY(-8px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.radio-fab__head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.radio-fab__brand { display: flex; align-items: center; gap: 6px; }
.radio-fab__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239,68,68,.6);
    animation: radioFabDot 1.4s ease-in-out infinite;
}
@keyframes radioFabDot {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.7); }
    50%     { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.radio-fab__brand-lbl {
    font-size: 10px; font-weight: 800; letter-spacing: .16em;
    color: white; text-transform: uppercase;
}
.radio-fab__close {
    background: rgba(255,255,255,.08);
    border: 0;
    color: rgba(255,255,255,.7);
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: grid; place-items: center;
    font-size: 12px;
    transition: background .15s;
}
.radio-fab__close:hover { background: rgba(255,255,255,.15); color: white; }

.radio-fab__now {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.radio-fab__cover {
    width: 48px; height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.radio-fab__cover img {
    width: 100%; height: 100%; object-fit: cover;
    display: block;
}
.radio-fab__cover-ph {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--anzorc-verde-oscuro), #003114);
    color: var(--anzorc-amarillo);
    font-size: 22px;
}
.radio-fab.is-playing .radio-fab__cover::after {
    content: "";
    position: absolute; inset: 0;
    box-shadow: inset 0 0 0 2px var(--anzorc-amarillo);
    border-radius: 8px;
    pointer-events: none;
}
.radio-fab__info { min-width: 0; }
.radio-fab__label {
    font-size: 8px; letter-spacing: .18em;
    color: var(--anzorc-amarillo);
    font-weight: 800;
    margin-bottom: 2px;
}
.radio-fab__title {
    font-size: 12px; font-weight: 700;
    color: white; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; word-break: break-word;
}
.radio-fab__channel {
    font-size: 10px; color: rgba(255,255,255,.55);
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.radio-fab__progress {
    height: 3px;
    background: rgba(255,255,255,.12);
    border-radius: 999px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 10px;
}
.radio-fab__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--anzorc-amarillo), var(--anzorc-verde));
    width: 0%;
    transition: width .3s linear;
    border-radius: 999px;
}

.radio-fab__chips {
    display: flex; gap: 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.radio-fab__chip {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.7);
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    font-family: inherit;
    transition: all .15s;
}
.radio-fab__chip:hover { background: rgba(255,255,255,.1); color: white; }
.radio-fab__chip.is-active {
    background: var(--anzorc-verde);
    border-color: var(--anzorc-verde);
    color: white;
}
.radio-fab__chip i { font-size: 10px; }

.radio-fab__ctrls {
    display: flex; align-items: center; gap: 4px;
    justify-content: center;
}
.radio-fab__btn {
    background: rgba(255,255,255,.06);
    border: 0;
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: grid; place-items: center;
    cursor: pointer;
    font-size: 12px;
    transition: background .15s, transform .15s;
}
.radio-fab__btn:hover { background: rgba(255,255,255,.15); }
.radio-fab__btn:active { transform: scale(.92); }

.radio-fab__play {
    background: var(--anzorc-amarillo);
    border: 0;
    color: #0f1a12;
    width: 42px; height: 42px;
    border-radius: 50%;
    display: grid; place-items: center;
    cursor: pointer;
    font-size: 18px;
    padding-left: 3px;
    box-shadow: 0 6px 16px -3px rgba(237,206,27,.5);
    margin: 0 4px;
    transition: transform .15s, box-shadow .15s;
}
.radio-fab__play:hover {
    background: #ffd83a;
    transform: scale(1.05);
    box-shadow: 0 8px 20px -3px rgba(237,206,27,.6);
}
.radio-fab__play:active { transform: scale(.96); }

.radio-fab__yt {
    background: rgba(255,255,255,.06);
    color: #ff4444;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: grid; place-items: center;
    text-decoration: none;
    font-size: 14px;
    margin-left: 4px;
    transition: background .15s;
}
.radio-fab__yt:hover { background: rgba(255,68,68,.15); text-decoration: none; }

/* Iframe con tamaño real 240×135 (evita que browsers descarten audio en background).
   Se mantiene en el viewport pero completamente transparente y no interactivo. */
.radio-fab__yt-frame {
    position: fixed;
    top: 0; left: 0;
    width: 240px; height: 135px;
    overflow: hidden;
    opacity: 0.01;                      /* casi 0 pero no cero — evita optimización agresiva */
    pointer-events: none;
    z-index: -1;
    visibility: visible;                /* NUNCA hidden — corta audio */
}
.radio-fab__yt-frame iframe {
    width: 240px !important;
    height: 135px !important;
    border: 0 !important;
}

/* Mobile: baja a bottom-right */
@media (max-width: 900px) {
    .radio-fab { top: auto; bottom: 16px; right: 12px; }
}
@media (max-width: 480px) {
    .radio-fab { right: 8px; bottom: 8px; }
    .radio-fab__panel { width: calc(100vw - 16px); max-width: 320px; }
    .radio-fab__toggle { padding: 9px 14px 9px 10px; font-size: 11px; }
    .radio-fab__toggle > i { font-size: 16px; }
}
