/* ============================================================
   RESPONSIVE — Media queries de mayor a menor breakpoint
   Las secciones en móvil usan min-height en lugar de height fija
   para evitar que el contenido se recorte en pantallas pequeñas
   ============================================================ */

/* ---- Tablet ancho (hasta 1024px) ---------------------- */
@media (max-width: 1024px) {

  .albums-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .album-cover { width: 140px; }

  .contacto-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .contacto-text { text-align: center; }
  .contacto-info { align-items: center; }
  .contacto-text p { margin-inline: auto; }
  #contacto { height: auto; min-height: 100svh; overflow: visible; }
  .contacto-main { padding-block: calc(var(--header-h) + 3rem) 3rem; }
}

/* ---- Tablet (hasta 900px) ----------------------------- */
@media (max-width: 900px) {

  #nav-dots { right: 0.8rem; }

  .gallery-grid {
    grid-template-columns: minmax(430px, 62vw);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-columns: clamp(175px, 27vw, 230px);
  }
}

/* ---- Móvil (hasta 768px) ------------------------------ */
@media (max-width: 768px) {
  :root {
    --header-h: 66px;
  }

  #header {
    height: var(--header-h);
    top: 0;
    margin-top: 0;
    padding-top: 0;
  }

  .nav-logo img {
    height: 52px;
  }

  /* Contenedor más ancho para más contenido visible */
  .container { width: min(1180px, 96%); }

  /* Nav */
  .nav-links { display: none; }
  #nav-dots  { display: none; }

  /* Secciones: altura automática */
  #hero, #musica, #tienda, #fotos, #redes, #contacto {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  /* Música y Redes: en móvil el contenido fluye de arriba a abajo
     (sin centrado flex) para que el pie de página siempre se alcance
     al hacer scroll. 'overflow: clip' recorta el aro decorativo ::after
     (bottom negativo en depth.css) que si no añade scroll vacío tras el pie. */
  #musica, #redes {
    display: block;
    overflow: clip;
  }
  .musica-inner, .redes-inner {
    padding-bottom: 3rem;
  }

  #fotos {
    height: 100svh;
    min-height: 100svh;
    align-items: center;
    overflow: hidden;
  }

  .fotos-inner {
    max-height: 100svh;
    padding-top: var(--header-h);
    padding-bottom: 0.75rem;
  }

  /* Hero: título más grande y protagonista */
  .hero-title    { font-size: clamp(3.2rem, 15vw, 5.5rem); }
  .hero-subtitle { font-size: 0.82rem; letter-spacing: 0.08em; }

  /* Orbe más grande y vivo en móvil */
  .hero-orb {
    width: 420px;
    height: 420px;
    top: 5%;
    right: -30%;
    background: radial-gradient(circle, rgba(212,120,154,0.18) 0%, transparent 70%);
    animation: orbFloat 6s ease-in-out infinite alternate, orbPulse 4s ease-in-out infinite;
  }

  /* Segundo orbe inferior */
  .hero-orb::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(160,100,180,0.12) 0%, transparent 70%);
    bottom: -60%;
    left: -40%;
    animation: orbFloat 9s ease-in-out infinite alternate-reverse;
  }

  /* Pulso suave en botones btn-rose en móvil */
  .btn-rose {
    animation: btnGlow 3s ease-in-out infinite;
  }

  /* Entrada escalonada en tarjetas de álbum y tienda */
  .album-card, .shop-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .album-card:active, .shop-card:active {
    transform: scale(0.97);
  }

  /* Cabeceras de sección: más compactas */
  .section-head  { margin-bottom: 1.4rem; }
  .section-title { font-size: clamp(1.6rem, 6vw, 2.2rem); }

  /* Música: 2 columnas, card visual simplificada */
  .musica-inner  { padding-bottom: 2.5rem; }
  .albums-grid   { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

  /* Desactivar backdrop-filter costoso en móvil */
  .album-card    { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .musica-bg     { filter: blur(8px) brightness(0.14) saturate(0.5); }

  .album-card {
    flex-direction: column;
    border-radius: 14px;
  }
  .album-cover {
    width: 100%;
  }
  .album-info {
    padding: 0.75rem 0.85rem 0.9rem;
    gap: 0.3rem;
  }
  .album-year { display: none; }
  .album-title  { font-size: 0.92rem; line-height: 1.3; }
  .track-list {
    display: flex;
    gap: 0.2rem;
    margin-top: 0.15rem;
  }
  .track-item {
    align-items: flex-start;
    font-size: 0.68rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .track-item::before { margin-top: 0.45em; }

  /* Tienda: 2 columnas ajustadas en móvil */
  .shop-grid  { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .tienda-inner { padding-bottom: 2.5rem; }
  .shop-body  { padding: 0.9rem 1rem 1rem; gap: 0.25rem; }
  .shop-title { font-size: 0.95rem; }
  .shop-subtitle { font-size: 0.72rem; }
  .shop-price { font-size: 1rem; margin-bottom: 0.5rem; }
  .shop-img   { aspect-ratio: 1 / 1; }

  /* Galería: misma composición editorial de PC, ajustada al móvil */
  .gallery-grid {
    grid-template-columns: clamp(210px, calc(74vw - 0.75rem), 430px);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-flow: column;
    grid-auto-columns: clamp(150px, 44vw, 220px);
    height: clamp(300px, calc(100svh - var(--header-h) - 180px), 460px);
    min-height: 0;
    gap: 0.6rem;
  }

  .gallery-item { aspect-ratio: auto; }

  .gallery-item-featured {
    grid-column: 1;
    grid-row: 1 / -1;
    aspect-ratio: auto;
  }

  .gallery-featured-caption {
    left: 0.8rem;
    bottom: 0.8rem;
  }
  .gallery-featured-caption span { display: none; }
  .gallery-featured-caption strong { font-size: 1.05rem; }
  .gallery-note { line-height: 1.5; }

  /* Redes */
  .social-grid { gap: 0.7rem; }
  .social-card {
    min-width: 0;
    padding: 1.3rem 1.2rem;
  }

  /* Contacto */
  .contacto-grid { gap: 1.5rem; }
  .form-row { grid-template-columns: 1fr; }

  /* Lightbox */
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }

  /* Press kit */
  .pk-stats { grid-template-columns: repeat(2, 1fr); }


  .pk-photos { grid-template-columns: repeat(2, 1fr); }
  .pk-header { flex-direction: column; text-align: center; gap: 1rem; }
  .pk-grid   { grid-template-columns: 1fr; gap: 0; }
}

/* ---- Móvil pequeño (hasta 480px) ---------------------- */
@media (max-width: 480px) {
  :root {
    --header-h: 60px;
  }

  .nav-logo img {
    height: 44px;
  }

  .container { width: 100%; padding-inline: 1rem; }

  .hero-title    { font-size: clamp(2.8rem, 17vw, 4.5rem); }
  .hero-subtitle { display: none; } /* más limpio en pantallas muy pequeñas */
  .section-title { font-size: 1.55rem; }

  /* Tienda y música: mantener 2 columnas, solo achicar el espaciado */
  .shop-grid   { gap: 0.6rem; }
  .albums-grid { gap: 0.6rem; }

  /* Redes */
  .social-card { min-width: 0; max-width: none; }

  .form-card { padding: 1.2rem 1rem; }
}

/* ---- Keyframes móvil ——————————————————————————————————— */
@keyframes orbPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.12); }
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(212,120,154,0); }
  50%       { box-shadow: 0 0 18px rgba(212,120,154,0.45); }
}

/* ---- Pantallas muy altas (tall screens) ——————————————— */
@media (min-height: 900px) {
  .albums-grid   { gap: 2rem; }
  .tienda-inner  { margin-top: 0; }
}

/* ============================================================
   MÓVIL EN VISTA HORIZONTAL / LANDSCAPE (max-height: 520px)
   Ajustes ergonómicos para pantallas apaisadas de teléfonos
   ============================================================ */
@media (max-height: 520px) and (orientation: landscape), (max-height: 460px) {
  :root {
    --header-h: 52px;
  }

  /* Header */
  #header {
    height: 52px;
    padding-inline: 1.5rem;
  }
  .nav-logo img {
    height: 42px !important;
  }
  .nav-links {
    gap: 1.4rem;
  }
  .nav-links a {
    font-size: 0.68rem;
  }
  .nav-toggle {
    padding: 4px;
  }
  #nav-mobile {
    width: min(300px, 75vw);
    padding: 1.2rem 1.8rem;
    overflow-y: auto;
  }
  .nav-mobile-link {
    padding: 0.65rem 0;
    font-size: 0.78rem;
  }
  #nav-dots {
    display: none !important;
  }

  /* Splash */
  .splash-logo {
    max-height: 55px;
    width: auto;
  }

  /* Secciones base */
  #hero, #musica, #tienda, #fotos, #redes, #contacto {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  /* Hero */
  #hero {
    height: 100svh;
    min-height: 300px;
    overflow: hidden;
  }
  .hero-scroll {
    display: none;
  }
  .hero-orb {
    width: 280px;
    height: 280px;
    top: 0;
    right: -10%;
  }

  /* Home Preview */
  #home-preview {
    padding: 2.8rem 0;
  }
  #home-preview .container {
    grid-template-columns: minmax(0, 360px) auto 1fr !important;
    gap: 0 !important;
    align-items: start;
  }
  .hprev-divider {
    display: block !important;
    width: 1px !important;
    height: auto !important;
    align-self: stretch !important;
  }
  .hprev-gallery {
    padding-right: 1.5rem !important;
  }
  .hprev-gallery-layout {
    grid-template-columns: 1fr 62px !important;
    gap: 0.45rem !important;
  }
  .hprev-music {
    padding-left: 1.5rem !important;
  }
  .hprev-title {
    font-size: 1.5rem !important;
  }
  .hprev-gallery-label,
  .hprev-music-label {
    margin-bottom: 1rem !important;
  }
  .hprev-platforms {
    margin-bottom: 1rem !important;
    gap: 0.35rem !important;
  }
  .hprev-platform-row {
    padding: 0.45rem 0.65rem !important;
    gap: 0.55rem !important;
  }
  .hprev-platform-icon {
    width: 24px !important;
    height: 24px !important;
  }
  .hprev-platform-icon svg,
  .hprev-platform-icon img {
    width: 14px !important;
    height: 14px !important;
  }
  .hprev-platform-name {
    font-size: 0.72rem !important;
  }
  .hprev-prod-card {
    min-height: 82px !important;
  }
  .hprev-prod-img {
    width: 82px !important;
  }
  .hprev-prod-body {
    padding: 0.55rem 0.85rem !important;
    flex-direction: row !important;
    align-items: center !important;
  }
  .hprev-prod-title {
    font-size: 0.82rem !important;
  }
  .hprev-prod-price {
    font-size: 0.78rem !important;
  }
  .hprev-prod-btn {
    padding: 0.35rem 0.75rem !important;
    font-size: 0.6rem !important;
  }

  /* Música */
  #musica {
    padding-top: 52px;
    padding-bottom: 2rem;
  }
  .musica-inner {
    padding-bottom: 1.5rem;
  }
  .albums-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  .album-card {
    flex-direction: row !important;
    align-items: center;
  }
  .album-cover {
    width: 95px !important;
    height: 95px !important;
    flex-shrink: 0;
  }
  .album-info {
    padding: 0.6rem 0.8rem !important;
  }
  .album-title {
    font-size: 0.85rem !important;
  }

  /* Tienda */
  #tienda {
    padding-top: 52px;
    padding-bottom: 2rem;
  }
  .tienda-inner {
    padding-bottom: 1.5rem;
  }
  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 0.75rem !important;
  }
  .shop-img {
    aspect-ratio: 16 / 10 !important;
  }
  .shop-body {
    padding: 0.7rem 0.8rem !important;
  }
  .shop-title {
    font-size: 0.85rem !important;
  }
  .shop-price {
    font-size: 0.85rem !important;
    margin-bottom: 0.4rem !important;
  }

  /* Fotos / Galería */
  #fotos {
    height: auto !important;
    min-height: 100svh !important;
    overflow: visible !important;
    padding-top: 52px;
    padding-bottom: 2rem;
  }
  .fotos-inner {
    max-height: none !important;
    padding-top: 0 !important;
  }
  .gallery-grid {
    grid-template-columns: minmax(240px, 38vw) !important;
    grid-template-rows: repeat(2, 115px) !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 135px !important;
    height: 245px !important;
    gap: 0.45rem !important;
  }

  /* Redes */
  #redes {
    padding-top: 52px;
    padding-bottom: 2rem;
  }
  .social-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.55rem !important;
  }
  .social-card {
    padding: 0.8rem 0.65rem !important;
  }
  .social-card-icon {
    width: 36px !important;
    height: 36px !important;
    margin-bottom: 0.4rem !important;
  }
  .social-card-name {
    font-size: 0.78rem !important;
  }
  .social-card-handle {
    font-size: 0.65rem !important;
    margin-bottom: 0.4rem !important;
  }
  .social-card-btn {
    padding: 0.32rem 0.65rem !important;
    font-size: 0.62rem !important;
  }

  /* Contacto */
  #contacto {
    padding-top: 52px;
    padding-bottom: 2rem;
  }
  .contacto-main {
    padding-block: 0 1.5rem !important;
  }
  .contacto-grid {
    grid-template-columns: 1fr 1.25fr !important;
    gap: 1.5rem !important;
    text-align: left !important;
  }
  .contacto-info {
    align-items: flex-start !important;
  }
  .contacto-text p {
    margin-inline: 0 !important;
  }
  .form-card {
    padding: 1.1rem !important;
  }
  .form-row {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Lightbox */
  .lightbox-img-wrap {
    max-height: 85vh;
    max-width: 85vw;
  }
  #lightbox-img {
    max-height: 80vh;
    max-width: 80vw;
    object-fit: contain;
  }
}

/* ---- Reducción de movimiento (accesibilidad) ——————————— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero-bg { animation: none; }
}
