/* ==========================================================
   MiYouTube Music - Estilos Móviles y Responsivos (PWA)
   Optimizado para celulares (Android / iPhone)
   ========================================================== */

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
    --player-height: 62px;
    --sidebar-width: 0px;
  }

  /* Prevenir cualquier tipo de desbordamiento horizontal */
  html, body, #app, .main-wrapper, .content-scrollable {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Ocultar barra lateral en móvil */
  .sidebar {
    display: none !important;
  }

  /* -------------------------------------------------------
     1. Header y Buscador en Móvil
     ------------------------------------------------------- */
  .top-header {
    height: var(--header-height);
    padding: 0 10px;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* En celular ocultar el texto largo de MiYouTube Music, dejando solo el logo icónico */
  .brand-section {
    flex-shrink: 0;
    gap: 0;
  }

  .brand-title {
    display: none !important;
  }

  .brand-logo-icon {
    width: 34px;
    height: 34px;
  }

  /* Buscador expandido y cómodo */
  .search-container {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 4px;
  }

  .search-bar {
    height: 38px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 19px;
  }

  .search-bar svg {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    flex-shrink: 0;
  }

  .search-input {
    font-size: 0.9rem;
    width: 100%;
    min-width: 0;
  }

  .header-actions {
    flex-shrink: 0;
    gap: 8px;
  }

  /* Ocultar botón de transmitir en móvil para darle todo el espacio al buscador */
  .cast-btn {
    display: none !important;
  }

  .login-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  /* -------------------------------------------------------
     2. Contenido y Carruseles
     ------------------------------------------------------- */
  .content-scrollable {
    padding: 10px 12px 140px 12px !important;
  }

  .mood-chips-bar {
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  .mood-chip {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .section-header {
    margin: 20px 0 12px 0;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .quick-picks-grid {
    grid-template-rows: repeat(4, 1fr);
    grid-auto-columns: minmax(260px, 80vw);
    gap: 8px 14px;
    max-width: 100%;
    overflow-x: auto;
  }

  .cards-carousel {
    grid-auto-columns: minmax(130px, 150px);
    gap: 12px;
    max-width: 100%;
    overflow-x: auto;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .mix-card {
    height: 140px;
    padding: 14px;
  }

  /* -------------------------------------------------------
     3. Reproductor Inferior en Móvil (Visible, con Play, Next y Prev)
     ------------------------------------------------------- */
  .bottom-player {
    display: flex !important;
    position: fixed !important;
    bottom: 56px !important; /* Justo encima de la barra de navegación móvil */
    left: 0 !important;
    right: 0 !important;
    height: var(--player-height) !important;
    background: #1C1C1C !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 0 10px !important;
    z-index: 750 !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.7) !important;
  }

  /* Pista y Carátula */
  .player-left {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
  }

  .player-thumb-wrap {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 4px;
  }

  .player-track-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .player-title {
    font-size: 0.86rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .player-artist {
    font-size: 0.74rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  /* Ocultar botones de like de la barra mini (se ven en el Drawer de pantalla completa) */
  .player-like-btns {
    display: none !important;
  }

  /* Controles de Reproducción: Mostrar Anterior, Play/Pause y Siguiente */
  .player-center {
    flex: 0 0 auto;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
  }

  .player-controls {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  /* Botones de Anterior y Siguiente visibles en móvil */
  .player-controls #player-prev-btn,
  .player-controls #player-next-btn {
    display: flex !important;
    padding: 6px;
    color: #FFFFFF;
    background: transparent;
  }

  .player-controls #player-prev-btn svg,
  .player-controls #player-next-btn svg {
    width: 24px;
    height: 24px;
    fill: #FFFFFF;
  }

  /* Botón Play/Pause grande y táctil */
  .play-pause-btn {
    display: flex !important;
    width: 38px;
    height: 38px;
    margin: 0 2px;
  }

  .play-pause-btn svg {
    width: 20px;
    height: 20px;
  }

  /* Ocultar controles secundarios en barra mini */
  .player-controls #player-shuffle-btn,
  .player-controls #player-repeat-btn,
  .player-time-display,
  .player-right {
    display: none !important;
  }

  /* -------------------------------------------------------
     4. Barra de Navegación Inferior Móvil (Mobile Bottom Nav)
     ------------------------------------------------------- */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #030303;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    justify-content: space-around;
    z-index: 800;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
  }

  .mobile-nav-item svg {
    fill: currentColor;
    width: 20px;
    height: 20px;
  }

  .mobile-nav-item.active {
    color: #FFFFFF;
  }

  .mobile-nav-item.active svg {
    fill: var(--ytm-red);
  }

  /* -------------------------------------------------------
     5. Drawer Pantalla Completa en Móvil
     ------------------------------------------------------- */
  .player-drawer {
    bottom: 0 !important;
    z-index: 900 !important;
  }

  .drawer-content {
    flex-direction: column;
    overflow-y: auto;
  }

  .drawer-left-art {
    width: 100%;
    padding: 24px 16px;
  }

  .drawer-big-cover {
    width: min(280px, 75vw);
  }

  .drawer-right-panel {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding: 16px;
  }

  /* Studio Admin en Móvil */
  .upload-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}
