/* ===================================================
   RESPONSIVE FINAL - CALI RADIO SALSA
   Versión limpia Fase 9
=================================================== */


/* ===================================================
   TABLETS
=================================================== */

@media (max-width: 1100px) {

    .app-layout {
        flex-direction: column;
        padding: 16px;
        gap: 18px;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        top: 0;
    }

    .contenido-principal {
        width: 100%;
    }

}


/* ===================================================
   PC / ESCRITORIO
=================================================== */

@media (min-width: 769px) {

    .spotify-section-featured {
        max-width: 100%;
    }

    .grid-secciones.layout-fase7 {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr);
        grid-template-areas:
            "history lyrics"
            "social app";
        gap: 25px;
        align-items: stretch;
    }

    .layout-fase7 .history-section {
        grid-area: history;
    }

    .layout-fase7 .lyrics-section {
        grid-area: lyrics;
    }

    .layout-fase7 .social-section {
        grid-area: social;
    }

    .layout-fase7 .app-section {
        grid-area: app;
    }

}


/* ===================================================
   MÓVILES
=================================================== */

@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        margin: 0;
        padding: 0;
    }

    img,
    canvas,
    video,
    iframe {
        max-width: 100%;
    }

    .app-layout {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        padding: 12px;
        gap: 16px;
    }

    .contenido-principal {
        width: 100%;
    }

    /* Ocultar botón viejo de tema */
    #themeButton,
    .theme-switch-container {
        display: none !important;
    }

    /* Botón de tema superior derecho */
    .sidebar-theme-toggle {
        display: inline-flex !important;
        top: 14px;
        right: 14px;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        font-size: 17px;
    }

    /* Sidebar */

    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        top: 0;
        padding: 22px;
        border-radius: 24px;
    }

    .logo-app,
    .logo-app-vertical {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: center;
        margin-bottom: 26px;
        gap: 12px;
        padding-top: 22px;
    }

    .logo-app img,
    .logo-app-vertical img,
    .logo-app-img {
        width: 115px;
        height: 115px;
        object-fit: contain;
        border-radius: 22px;
    }

    .logo-app h2,
    .logo-app-text h2 {
        font-size: 25px;
        line-height: 1.15;
        margin: 0;
    }

    .logo-app span,
    .logo-app-text span {
        font-size: 16px;
    }

    .menu-app {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .menu-item {
        justify-content: center;
        align-items: center;
        flex-direction: column;
        text-align: center;
        padding: 14px 10px;
        gap: 7px;
        font-size: 13px;
    }

    .menu-item i {
        width: auto;
        font-size: 20px;
    }

    /* Topbar */

    .topbar {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
        padding: 0;
    }

    .search-box {
        width: 100%;
        max-width: 100%;
        min-height: 54px;
        padding: 13px 18px;
    }

    .search-box input {
        width: 100%;
        font-size: 14px;
    }

    .topbar-actions {
        display: none !important;
    }

    /* Reproductor */

    .reproductor-salsa {
        width: 100%;
        border-radius: 24px;
    }

    .card-content {
        padding: 24px 18px;
    }

    #trackInfo {
        font-size: 18px;
        line-height: 1.5;
    }

    #caratula-img {
        width: 220px;
        height: 220px;
        max-width: 80vw;
        max-height: 80vw;
    }

    .controles-layout {
        gap: 20px;
    }

    #btnPlayPausa {
        width: 78px;
        height: 78px;
        font-size: 26px;
    }

    .redes-compartir-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .redes-compartir-grid button {
        height: 54px;
        border-radius: 15px;
        font-size: 21px;
    }

    .mini-title,
    .playing-label {
        font-size: 12px;
        letter-spacing: 2px;
        padding: 6px 12px;
    }

    .mensaje-logo,
    .song-extra span {
        font-size: 13px;
        padding: 8px 12px;
    }

    /* Se elimina Explora Cali Radio */

    .recent-section {
        display: none !important;
    }

    /* Spotify debajo del reproductor */

    .spotify-section-featured {
        margin-top: 20px;
    }

    .spotify-body,
    .spotify-artist-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .spotify-img,
    .spotify-cover {
        width: 135px;
        height: 135px;
        object-fit: cover;
        border-radius: 18px;
    }

    .spotify-info h3 {
        font-size: 20px;
    }

    .spotify-link {
        width: 100%;
        max-width: 260px;
    }

    /* Grid móvil */

    .grid-secciones.layout-fase7 {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "lyrics"
            "history"
            "social"
            "app";
        gap: 18px;
        margin-top: 20px;
    }

    .layout-fase7 .lyrics-section {
        grid-area: lyrics;
        position: relative;
        top: auto;
    }

    .layout-fase7 .history-section {
        grid-area: history;
    }

    .layout-fase7 .social-section {
        grid-area: social;
    }

    .layout-fase7 .app-section {
        grid-area: app;
    }

    .card-section {
        width: 100%;
        max-width: 100%;
        padding: 22px;
        border-radius: 24px;
    }

    .card-section h2 {
        font-size: 20px;
        gap: 10px;
        margin-bottom: 18px;
    }

    /* Letra en vivo */

    #lyricsContainer,
    .layout-fase7 #lyricsContainer {
        max-height: 340px;
        overflow-y: auto;
        padding-right: 8px;
    }

    .lyrics-line {
        font-size: 15px;
        line-height: 1.8;
    }

    /* Historial */

    .historial-item {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
    }

    .historial-cover {
        width: 58px;
        height: 58px;
        flex-shrink: 0;
        object-fit: cover;
    }

    .historial-song {
        font-size: 15px;
    }

    .historial-artist {
        font-size: 13px;
    }

    /* Redes sociales */

    .social-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .social-grid a {
        height: 58px;
        min-height: 58px;
        border-radius: 16px;
        font-size: 23px;
    }

    /* Aplicación móvil */

    .app-section {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .app-section .btn-app,
    .btn-app,
    #btnInstallApp,
    #btnDescargarApp,
    [data-install-app] {
        width: 100% !important;
        max-width: 100% !important;
        height: 60px !important;
        margin: 8px auto 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        line-height: 1 !important;
        padding: 0 18px !important;
    }

}


/* ===================================================
   TELÉFONOS PEQUEÑOS
=================================================== */

@media (max-width: 480px) {

    .app-layout {
        padding: 10px;
    }

    .sidebar {
        padding: 18px;
        border-radius: 22px;
    }

    .logo-app img,
    .logo-app-vertical img,
    .logo-app-img {
        width: 100px;
        height: 100px;
    }

    .logo-app h2,
    .logo-app-text h2 {
        font-size: 23px;
    }

    .menu-app {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .menu-item {
        font-size: 12px;
        padding: 12px 8px;
    }

    .menu-item i {
        font-size: 19px;
    }

    .card-section {
        padding: 18px;
        border-radius: 22px;
    }

    .card-section h2 {
        font-size: 19px;
    }

    #caratula-img {
        width: 190px;
        height: 190px;
    }

    #trackInfo {
        font-size: 16px;
    }

    .social-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .social-grid a {
        height: 52px;
        min-height: 52px;
        font-size: 21px;
    }

    .redes-compartir-grid button {
        height: 50px;
        font-size: 20px;
    }

    #lyricsContainer,
    .layout-fase7 #lyricsContainer {
        max-height: 300px;
    }

    .lyrics-line {
        font-size: 14px;
    }

}
/* ===================================================
   AJUSTE MOBILE - MANTENER BOTÓN TEMA EN SIDEBAR
=================================================== */

@media (max-width: 768px) {

    .topbar-theme-toggle {
        display: none !important;
    }

    .sidebar-theme-toggle {
        display: inline-flex !important;
    }

}