/* ==========================================
   0. PERFORMANCE & iOS OPTIMIZATIONS
   ========================================== */

/* ==========================================
   1. RESET, ESTRUCTURA Y BLINDAJE
   ========================================== */

/* html: regla única (rendimiento + estructura) */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    margin: 0;
    padding: 0;
    height: 100%;
    scroll-behavior: smooth;
    text-size-adjust: 100%; /* Evita zoom de texto en iOS al rotar */
}

/* Aceleración por hardware para elementos animados */
.animated-text::after {
    will-change: transform;
}
.swiper-slide {
    will-change: transform;
    backface-visibility: hidden; /* Fix flickering en Safari/iOS */
}
.swiper-wrapper {
    will-change: transform;
}

/* Touch: eliminar el retraso de 300ms en tap (móvil) */
a, button, [onclick] {
    touch-action: manipulation;
}

body {
    background-image: url('../img/nuevo-fondo.webp.jpg') !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-color: #1a1a1a;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative;
    height: 100%;
    padding-top: 80px !important;
    /* Espacio para el reproductor de audio fijo (78px) en la parte inferior */
    padding-bottom: 90px !important;
}

/* Soporte iPhone/iPad — max-device-width REEMPLAZADO por max-width */
@media screen and (max-width: 1024px) {
    body {
        background-attachment: scroll !important;
        background-image: none !important;
    }
    body::before {
        content: "";
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background-image: url('../img/nuevo-fondo.webp.jpg');
        background-size: cover;
        background-position: center center;
        z-index: -1;
    }
}

/* ==========================================
   2. NAVBAR Y MENÚ
   ========================================== */
.navbar-pro {
    background: rgba(0, 0, 0, 0.95) !important;
    border-bottom: 3px solid #00bfff !important;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.8) !important;
    height: 70px !important;
    display: flex !important;
    align-items: center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.nav-logo { font-size: 26px; font-weight: 900; color: #fff; text-decoration: none; }
.nav-logo span { color: #4B6EA4; }

.nav-links { display: flex; list-style: none; gap: 15px; margin: 0; padding: 0; }
.nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
}
.nav-links a:hover { background: rgba(75, 110, 164, 0.5); border: 1px solid #00bfff; }

@media screen and (max-width: 992px) {
    .menu-toggle {
        display: block !important;
        background: none;
        border: none;
        color: white;
        font-size: 28px;
        cursor: pointer;
    }
}

@media screen and (max-width: 992px) and (orientation: portrait) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px; left: 0;
        width: 100%;
        background: rgba(0,0,0,0.98);
        padding: 20px 0;
        border-bottom: 2px solid #00bfff;
    }
    .nav-links.active { display: flex !important; }
}

/* ==========================================
   3. MARQUESINA, VIDEO Y CONTENEDORES
   ========================================== */
.animated-text {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 0;
    font-weight: 900;
    border-bottom: 2px solid #4B6EA4;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.animated-text::after {
    content: "Desde Corral de Almaguer - Castilla La Mancha - Toledo - España - Transmite - CORRAL TV RADIO - TU RADIO - LA RADIO DEL PUEBLO --- ";
    display: inline-block;
    padding-left: 100%;
    animation: marquee 25s linear infinite;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(75, 110, 164, 0.8);
}
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

.contenedor-transmision-pc {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
}

.seccion-principal { flex: 0 0 750px; z-index: 10; }
.video-container-pro {
    border: 5px solid #4B6EA4;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 30px rgba(0, 0, 191, 0.5);
    position: relative;
}

.columna-lateral { flex: 1; display: flex; flex-direction: column; gap: 20px; z-index: 5; }

/* ==========================================
   4. RELOJES Y PERSIANAS
   ========================================== */
.reloj-container { color: #ffffff; font-weight: 900; text-align: center; text-shadow: 0 0 15px rgba(0, 191, 255, 1) !important; }
.estilo-hora { font-size: 50px; line-height: 1; }
.estilo-dia { font-size: 18px; text-transform: uppercase; opacity: 0.8; }

.persiana-item { perspective: 1000px; }
.persiana-encabezado {
    background: linear-gradient(135deg, #001f5b 0%, #000000 100%);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 900;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 110, 255, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s;
    text-transform: uppercase;
    border: 1px solid rgba(75, 110, 164, 0.5);
    text-shadow: 0 0 10px white;
    letter-spacing: 1px;
}
.persiana-encabezado:hover { transform: translateY(-3px); box-shadow: 0 6px 25px rgba(0, 191, 255, 0.9); }

.persiana-cuerpo {
    max-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 0 0 10px 10px;
    transition: max-height 0.5s ease-out;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border: 1px solid transparent;
}
.persiana-cuerpo.abierto {
    max-height: 1000px;
    padding: 20px;
    border: 1px solid #4B6EA4;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}
.persiana-cuerpo p { color: #ffffff; font-size: 16px; line-height: 1.5; text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }

/* QR APP */
.qr-container {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    border: 1px solid #4B6EA4;
}
.qr-code {
    width: 150px;
    height: 150px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    margin: 0 auto 10px auto;
    cursor: pointer;
    border: 2px solid #00bfff;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
    transition: all 0.3s ease;
    animation: latido-qr 3s infinite;
}
.qr-link:hover .qr-code {
    transform: scale(1.05);
    box-shadow: 0 0 25px #00bfff;
    border-color: #ffffff;
}
.qr-link:active .qr-code {
    transform: scale(0.92);
    filter: brightness(1.2);
    box-shadow: 0 0 40px #00ffff !important;
    transition: all 0.1s ease;
}
@keyframes latido-qr {
    0%   { box-shadow: 0 0 10px rgba(0, 191, 255, 0.4); }
    50%  { box-shadow: 0 0 20px rgba(0, 191, 255, 0.8); }
    100% { box-shadow: 0 0 10px rgba(0, 191, 255, 0.4); }
}
.descargar-app-text { color: #fff; font-weight: bold; font-size: 14px; text-transform: uppercase; text-shadow: 0 0 5px #00bfff; }

/* ==========================================
   5. GALERÍA 3 - BORDES Y NEÓN
   ========================================== */
.mySwiper {
    width: 100% !important;
    max-width: 1000px !important;
    margin: 20px auto !important;
    overflow: visible !important;
    padding: 20px 0 !important;
}

.swiper-slide {
    position: relative;
    width: 280px;
    height: 380px;
    border-radius: 15px;
    border: 3px solid #00ffff !important;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6) !important;
    transform-style: preserve-3d !important;
    backface-visibility: visible !important;
}

.swiper-slide::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: var(--bg-img);
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.4);
    transform: scale(1.1);
    z-index: 1;
}

.swiper-slide img {
    position: relative;
    width: auto !important;
    max-width: 95%;
    height: 100% !important;
    object-fit: contain !important;
    z-index: 2;
    border-radius: 10px;
}

/* Horizontal Móvil Galería 3 */
@media (max-height: 500px) and (orientation: landscape) {
    .swiper-slide { width: 220px !important; height: 260px !important; }
}

/* ==========================================
   6. GALERÍA 2 - DIFUMINADO Y AJUSTES
   ========================================== */
#galeria2-contenedor {
    border: none !important;
    outline: none !important;
}

#galeria2-contenedor .swiper-slide {
    position: relative;
    background: #000 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#galeria2-contenedor .swiper-slide::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: var(--bg-img);
    background-size: cover;
    background-position: center;
    filter: blur(25px) brightness(0.6) !important;
    transform: scale(1.2);
    z-index: 1;
}

#galeria2-contenedor .swiper-slide img {
    position: relative;
    z-index: 2;
    max-width: 95% !important;
    max-height: 95% !important;
    object-fit: contain !important;
    border-radius: 5px;
}

/* ==========================================
   7. GALERÍA 2 Y 3 — TAMAÑO CONJUNTO
   ========================================== */
#galeria3-contenedor .swiper-slide,
#galeria2-contenedor .swiper-slide {
    width: auto !important;
    max-width: 90vw !important;
    height: 400px !important;
    background: #000 !important;
    border: 3px solid #00ffff !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

@media screen and (max-width: 768px) {
    #galeria3-contenedor .swiper-slide,
    #galeria2-contenedor .swiper-slide {
        height: 280px !important;
    }
}

/* Landscape: galería más grande */
@media screen and (orientation: landscape) {
    .mySwiper {
        height: 70vh !important;
        max-width: 90% !important;
    }
    #galeria2-contenedor .swiper-slide {
        width: 60% !important;
        height: 100% !important;
    }
    body {
        padding-top: 80px !important;
    }
}

/* ==========================================
   8. BOTONES NEÓN, FOOTER Y PLAYER
   ========================================== */
.nav-container-buttons {
    display: flex !important;
    gap: 20px !important;
    justify-content: center !important;
    margin: 30px 0 100px 0 !important;
    padding-bottom: 20px !important;
    position: relative;
    z-index: 100;
}

.btn-flotante {
    background: linear-gradient(145deg, #000b18, #0056b3) !important;
    color: #fff !important;
    padding: 12px 25px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    border: 2px solid #00bfff !important;
    box-shadow: 0 0 15px #00bfff !important;
    transition: 0.3s;
}
.btn-flotante:hover { transform: scale(1.05); box-shadow: 0 0 25px #00ffff !important; }

.footer-radio {
    background: rgba(0, 0, 0, 0.9);
    border-top: 2px solid #4B6EA4;
    padding: 10px 0 75px 0 !important; /* Reducido al límite del reproductor */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-superior {
    text-align: center !important;
    padding: 5px 0 !important; /* Reducido al mínimo */
}

.footer-inferior {
    text-align: center !important;
    color: #ffffff !important;
    font-size: 12px;
    padding: 10px 0 !important; /* Mínimo margen */
    margin: 0 !important;
    border-top: 1px solid rgba(75, 110, 164, 0.5);
    width: 90%;
    max-width: 800px;
}

.player-fijo-bottom {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    height: 75px;
    z-index: 2000;
    background: black;
    border-top: 2px solid #4B6EA4;
}

/* Badge En Vivo */
.live-badge {
    position: absolute;
    top: 15px; left: 15px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 10;
}
.live-badge .dot {
    height: 10px; width: 10px;
    background-color: white;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.1; } 100% { opacity: 1; } }

/* ==========================================
   9. RESPONSIVE GENERAL
   ========================================== */
@media screen and (max-width: 1200px) {
    .contenedor-transmision-pc { flex-wrap: wrap; }
    .seccion-principal { flex: 0 0 100%; max-width: 750px; order: 1; }
    .columna-lateral { flex: 0 0 45%; order: 2; }
}

/* ==========================================
   10. TÍTULO COLABORADORES
   ========================================== */
.titulo-colaboradores {
    text-align: center !important;
    color: #ffffff !important;
    font-size: 38px !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    margin: 40px auto 20px auto !important;
    display: block;
    text-shadow:
        0 0 10px #fff,
        0 0 20px #00bfff,
        0 0 30px #00bfff,
        0 0 40px #00bfff !important;
    background: radial-gradient(circle, rgba(0, 191, 255, 0.2) 0%, rgba(0,0,0,0) 70%);
    padding: 15px 0;
}

@media screen and (max-width: 768px) {
    .titulo-colaboradores {
        font-size: 26px !important;
        margin: 20px auto !important;
    }
}

.titulo-galeria2 {
    text-align: center;
    color: white;
    font-size: 30px;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.7);
    margin: 20px 0;
    text-transform: uppercase;
}

/* ==========================================
   11. SECCIÓN COLABORADORES (CARRUSEL PUBLI)
   ========================================== */
.seccion-colaboradores {
    width: 100%;
    overflow: hidden;
    padding: 10px 0 40px 0;
    background: rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
}

.swiper-publi {
    width: 100% !important;
    overflow: hidden !important;
    padding: 20px 0 !important;
}

.swiper-publi .swiper-wrapper {
    display: flex !important;
    align-items: center !important;
}

.swiper-publi .swiper-slide {
    width: fit-content !important;
    height: fit-content !important;
    min-width: unset !important;
    max-width: 88vw !important;
    padding: 0 !important;
    display: inline-block !important;
    line-height: 0 !important;
    border: 3px solid #00bfff !important;
    border-radius: 12px !important;
    box-shadow: 0 0 18px rgba(0, 191, 255, 0.7) !important;
    overflow: hidden !important;
    background: transparent !important;
}

.swiper-publi .swiper-slide::before {
    display: none !important;
}

.swiper-publi .swiper-slide img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 84vw !important;
    max-height: 62vh !important;
    object-fit: contain !important;
    border-radius: 9px !important;
    position: static !important;
}

@media screen and (max-width: 768px) {
    .swiper-publi .swiper-slide {
        max-width: 92vw !important;
        border-radius: 10px !important;
    }
    .swiper-publi .swiper-slide img {
        max-width: 88vw !important;
        max-height: 50vh !important;
    }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
    .swiper-publi .swiper-slide img {
        max-width: 70vw !important;
        max-height: 72vh !important;
    }
}

/* ==========================================
   12. ESCUDO, CONTADOR Y FOOTER
   ========================================== */
.escudo-footer {
    width: 65px !important; /* Achicado general más fuerte */
    height: auto !important;
    display: block !important;
    margin: 0 auto 5px auto !important;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

/* Ocultar escudos sueltos, mostrar solo el del contador */
.footer-superior > img.escudo-footer { display: none !important; }
.caja-contador-pro .escudo-footer    { display: block !important; }

/* Ocultar contador externo verde */
div[id^="sfc"],
a[href*="contadorvisitasgratis"],
img[src*="contadorvisitasgratis"] {
    display: none !important;
}

.escudo-footer, .texto-footer, .creditos-pro {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.caja-contador-pro {
    margin-top: 15px;
    text-align: center;
    display: block !important;
}

.titulo-contador-nuevo {
    color: #00bfff !important;
    font-size: 16px !important;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
    display: block !important;
}

.contador-digital-azul {
    display: flex !important;
    gap: 5px;
    justify-content: center;
    margin-bottom: 20px;
}

.cuadrito-azul {
    background: linear-gradient(180deg, #0056b3 0%, #002d5a 100%) !important;
    color: white !important;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #00bfff;
    font-family: 'Courier New', monospace;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

/* ==========================================
   13. WIDGET DE CALIFICACIÓN (ESTRELLAS)
   ========================================== */
.rating-widget-profe {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffcc00;
    border-radius: 12px;
    padding: 15px;
    margin: 20px auto;
    width: 100%;
    max-width: 280px;
    box-sizing: border-box;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.2);
    text-align: center;
}

.estrellas-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    direction: ltr;
}

.estrella {
    font-size: 35px;
    color: #555;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}

.estrella:active {
    transform: scale(1.3);
}

/* ==========================================
   14. REDES SOCIALES DEL FOOTER
   ========================================== */
.redes-sociales-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
}

.redes-sociales-footer a {
    color: #ffffff;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 1px solid #4B6EA4;
}

.redes-sociales-footer a:hover {
    background: #00bfff;
    color: #000000;
    box-shadow: 0 0 10px #00bfff;
    transform: scale(1.1);
    border-color: #00bfff;
}

/* ==========================================
   13. AJUSTES FOOTER Y CONTENEDORES MÓVIL
   ========================================== */
@media screen and (max-width: 768px) and (orientation: portrait) {
    /* Permitir que la columna lateral ocupe el 100% de la pantalla para que el chat, contador, etc crezcan */
    .columna-lateral {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 10px !important; /* un poquito de aire a los lados para que no quede totalmente pegado al borde del telefono */
        box-sizing: border-box !important;
    }

    .footer-radio {
        padding: 5px 0 75px 0 !important; /* Espacio hiper apretado para el movil */
    }
    .footer-superior {
        padding: 0 !important; /* Cero padding */
    }
    .footer-inferior {
        padding: 5px 0 10px 0 !important; /* Al limite */
        margin: 0 !important;
    }
    .escudo-footer {
        width: 50px !important; /* Escudo super chico en movil */
        margin-bottom: 5px !important;
    }
    .caja-contador-pro {
        margin-top: 0 !important;
    }
    .titulo-contador-nuevo {
        font-size: 12px !important;
        margin-bottom: 5px !important;
    }
    .cuadrito-azul {
        padding: 3px 5px !important;
        font-size: 16px !important;
    }
}