/* ===========================================================
   BADHYBRIX — CAPA GLOBAL RESPONSIVE SOLO HORIZONTAL
   Base compartida para toda la web sin duplicar lógica visual
   =========================================================== */

/* ===========================================================
   BASE GLOBAL SEGURA
   Mantiene integridad visual y evita desbordes laterales
   =========================================================== */

html.bbx-horizontal-document {
  background: #1a0f00;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.bbx-horizontal-ready {
  max-width: 100%;
  overflow-x: hidden;
}

body.bbx-horizontal-ready *,
body.bbx-horizontal-ready *::before,
body.bbx-horizontal-ready *::after {
  box-sizing: border-box;
}

body.bbx-horizontal-ready img,
body.bbx-horizontal-ready video,
body.bbx-horizontal-ready canvas,
body.bbx-horizontal-ready svg {
  max-width: 100%;
}

/* ===========================================================
   BLOQUEO VISUAL EN VERTICAL
   No fuerza la rotación física del dispositivo, pero sí bloquea
   el uso en portrait y guía al usuario a landscape
   =========================================================== */

.bbx-rotate-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 107, 0, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(12, 7, 2, 0.98), rgba(0, 0, 0, 0.99));
  z-index: 2147483647;
}

.bbx-rotate-overlay__panel {
  width: min(100%, 420px);
  padding: 28px 24px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(34, 11, 1, 0.98), rgba(0, 0, 0, 0.99));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7);
  color: #fff;
  text-align: center;
}

.bbx-rotate-overlay__icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 107, 0, 0.95), rgba(91, 13, 0, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.bbx-rotate-overlay__phone {
  width: 30px;
  height: 52px;
  border-radius: 9px;
  border: 3px solid #fff;
  position: relative;
  transform: rotate(90deg);
}

.bbx-rotate-overlay__phone::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 10px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
}

.bbx-rotate-overlay__title {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 900;
  font-style: oblique;
  letter-spacing: 0.02em;
}

.bbx-rotate-overlay__text {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

body.bbx-portrait-blocked {
  overflow: hidden !important;
}

body.bbx-portrait-blocked > *:not(.bbx-rotate-overlay) {
  visibility: hidden;
}

body.bbx-portrait-blocked .bbx-rotate-overlay {
  display: flex;
}

/* ===========================================================
   AJUSTES GLOBALES — LAPTOPS Y TABLETS HORIZONTALES
   Corrige patrones repetidos del proyecto con offsets fijos
   =========================================================== */

@media (max-width: 1200px) and (orientation: landscape) {
  .main-header,
  .fixed-panel {
    height: auto !important;
    min-height: 70px;
    padding: 12px 18px !important;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
  }

  .header-logo,
  .title-block,
  .main-section {
    min-width: 0;
  }

  .home-controls {
    margin-right: 0 !important;
    gap: 10px !important;
    flex-wrap: wrap;
  }

  .header-right {
    position: static !important;
    top: auto !important;
    right: auto !important;
    width: auto !important;
    max-width: 100%;
    margin-left: auto;
    padding: 0 !important;
    gap: 10px !important;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .language-selector-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .direction-btn,
  .login-spotify-btn {
    position: static !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
  }

  .secondary-bar {
    height: auto !important;
    min-height: 70px;
    padding: 12px 16px !important;
  }

  .secondary-bar .container,
  .secondary-bar .sb-group,
  .tokens-container {
    width: 100%;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px 12px !important;
  }

  .dashboard-main-shell,
  .container {
    width: min(100%, calc(100% - 24px)) !important;
  }

  .dashboard-main-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr) !important;
  }

  .dashboard-side-column {
    grid-column: 1 / -1;
  }

  .playlists-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 28px !important;
  }

  .ranking-title-button {
    width: min(100%, calc(100% - 24px));
    font-size: clamp(1.05rem, 2vw, 1.4rem) !important;
    line-height: 1.35;
    margin-inline: auto;
  }

  .ranking-genres-container,
  .artist-grid {
    gap: 18px !important;
  }

  .artist-card {
    width: 100% !important;
    max-width: 160px;
    padding: 1rem !important;
  }

  .artist-card img {
    width: min(120px, 100%) !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin-inline: auto;
  }

  #pagos-container {
    width: min(100%, calc(100vw - 32px)) !important;
    padding: 16px !important;
    margin-left: 0 !important;
    gap: 16px !important;
  }

  .metodos-pago,
  .pix-panel,
  .credito-panel,
  .debito-panel,
  .paypal-panel,
  .wise-panel,
  .confirmacion-panel {
    width: min(100%, 420px) !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .pix-panel,
  .credito-panel,
  .debito-panel,
  .paypal-panel,
  .wise-panel,
  .confirmacion-panel {
    height: auto !important;
    min-height: 160px;
  }
}

/* ===========================================================
   AJUSTES GLOBALES — TABLET HORIZONTAL COMPACTA
   Reduce apilados y limpia bloques absolutos conflictivos
   =========================================================== */

@media (max-width: 960px) and (orientation: landscape) {
  .main-header,
  .fixed-panel {
    justify-content: center;
  }

  .header-logo,
  .title-block,
  .home-controls,
  .header-right,
  .beta-warning {
    width: 100%;
    justify-content: center !important;
    text-align: center;
    margin-left: 0 !important;
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
  }

  .curation-card,
  #processed-card {
    min-height: 360px !important;
  }

  .tokens-container,
  .secondary-bar .sb-group {
    justify-content: center;
  }

  #pagos-container {
    flex-direction: column;
  }

  .metodos-pago {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 10px !important;
  }

  .metodo-btn,
  .buy-tokens-btn,
  .pago-comprar-btn {
    width: 100% !important;
    max-width: none !important;
  }
}

/* ===========================================================
   AJUSTES GLOBALES — MÓVIL HORIZONTAL
   Mantiene una sola versión, pero limpia densidad visual
   =========================================================== */

@media (max-width: 767px) and (orientation: landscape) {
  .main-header,
  .fixed-panel,
  .secondary-bar {
    padding-inline: 12px !important;
  }

  .header-logo,
  .site-title,
  .logo-text {
    font-size: clamp(1rem, 2.4vw, 1.2rem) !important;
  }

  .nav-btn,
  .lang-btn,
  .login-btn,
  .curator-link,
  .spotify-btn,
  .language-selector,
  .year-btn {
    width: 100%;
    text-align: center;
  }

  .playlists-grid,
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .metric,
  .playlist-card,
  .artist-card {
    min-width: 0;
  }

  .playlist-footer,
  .curator {
    gap: 8px !important;
  }
}
