/**
 * KMUSIC RADIO — SISTEMA RESPONSIVE MOBILE-FIRST
 * Breakpoints específicos: 360px, 390px, 768px, 1024px, 1440px
 */

/* ==========================================================================
   TABLET & DESKTOP MEDIO (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  .hamburger-btn {
    display: inline-flex;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2xl);
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .hero-content, .hero-visual {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .hero-player-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: var(--space-md);
  }

  .hero-card-actions {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .hero-card-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .hero-content {
    text-align: center;
    align-items: center;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .hero-description {
    width: 100%;
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
    width: 100%;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .advertising-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }
}

/* ==========================================================================
   TABLETS PEQUEÑAS Y MÓVILES GRANDES (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --container-padding: 16px;
  }

  #btnCloseMobileDrawer {
    width: auto !important;
    min-width: 40px;
    height: 40px;
    padding: 8px !important;
    flex-shrink: 0;
  }

  /* Header móvil limpio sin desbordamiento */
  .brand-logo img, .brand-logo svg {
    height: 36px;
    max-width: 140px;
  }

  #btnHeaderListen {
    display: none; /* En móvil se utiliza el reproductor persistente o el botón del Hero */
  }

  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
  }

  .section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }

  .hero-section {
    padding-top: calc(var(--header-height) + var(--space-xl));
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-features-row {
    flex-direction: column;
    align-items: center;
    gap: 8px !important;
  }

  /* Player compacto en móvil */
  .persistent-player {
    height: var(--player-height-mobile);
  }

  .player-inner {
    grid-template-columns: 1fr auto auto;
    gap: var(--space-xs);
    align-items: center;
  }

  .player-station-info {
    gap: var(--space-sm);
    min-width: 0;
  }

  .hero-player-card {
    padding: 12px;
  }

  .hero-card-body {
    gap: 10px;
  }

  .hero-card-img-wrap {
    width: 60px;
    height: 60px;
  }

  .hero-card-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-card-actions .btn {
    width: 100%;
  }

  .player-thumb-wrap {
    width: 46px;
    height: 46px;
  }

  .player-station-name {
    font-size: var(--text-xs);
    max-width: 130px;
  }

  .player-right-controls {
    display: flex !important;
    align-items: center;
    gap: 4px;
    margin-left: auto;
  }

  .player-volume-wrap,
  .player-eq-badge {
    display: none !important;
  }

  .player-more-wrap {
    display: flex !important;
  }

  .player-center-controls {
    flex-direction: row;
    gap: var(--space-xs);
  }

  .player-station-select-wrap {
    display: none; /* En móvil se selecciona tocando la tarjeta o selector modal */
  }

  .btn-play-master {
    width: 42px;
    height: 42px;
  }

  .btn-play-master svg {
    width: 18px;
    height: 18px;
  }

  .site-footer {
    padding-bottom: calc(var(--player-height-mobile) + 40px);
  }

  /* Grids a 1 columna */
  .services-catalog {
    grid-template-columns: 1fr;
  }

  .about-pillars {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .form-group.grid-2 {
    grid-template-columns: 1fr;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: calc(var(--player-height-mobile) + 12px);
  }

  .schedule-on-air-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   MÓVILES ESTÁNDAR Y COMPACTOS (<= 390px - ej. iPhone 12/13/14, Galaxy S21)
   ========================================================================== */
@media (max-width: 390px) {
  .hero-title {
    font-size: 1.85rem;
  }

  .btn {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 100%;
  }

  .btn-lg {
    padding: 12px 20px;
  }

  .player-station-name {
    max-width: 100px;
  }

  .donations-card {
    padding: var(--space-lg);
  }

  .amount-chip {
    padding: 8px 16px;
    font-size: var(--text-base);
  }
}

/* ==========================================================================
   MÓVILES ULTRA COMPACTOS (<= 360px - ej. Galaxy A series, pantallas pequeñas)
   ========================================================================== */
@media (max-width: 360px) {
  :root {
    --container-padding: 12px;
  }

  .hero-title {
    font-size: 1.5rem;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: break-word;
    width: 100%;
    max-width: 100%;
  }

  .hero-description {
    font-size: var(--text-sm);
    width: 100%;
    max-width: 100%;
  }

  .hero-actions {
    width: 100%;
    max-width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    font-size: var(--text-xs);
  }

  .hero-player-card {
    padding: 12px;
  }

  .hero-card-body {
    gap: 10px;
  }

  .hero-card-img-wrap {
    width: 60px;
    height: 60px;
  }

  .hero-card-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-card-actions .btn {
    width: 100%;
  }

  .player-thumb-wrap {
    width: 40px;
    height: 40px;
  }

  .player-station-name {
    max-width: 80px;
    font-size: 11px;
  }

  .btn-play-master {
    width: 38px;
    height: 38px;
  }
}

/* ==========================================================================
   PANTALLAS GRANDES Y MONITORES DE ALTA RESOLUCIÓN (>= 1440px / 1920px)
   ========================================================================== */
@media (min-width: 1440px) {
  :root {
    --container-max: 1360px;
  }

  .hero-title {
    font-size: 4rem;
  }
}

@media (min-width: 1920px) {
  :root {
    --container-max: 1480px;
  }
}
