/* Responsive público — Records / Credens
   Solo layout/CSS. Vacío/metadata no cambia look de marca.
   Cierre mobile-fix 2026-11-11:
   - padding-top 34px SOLO si existe barra PRE (:has)
   - taps PRE / footer / hero
   - overflow, heroes, producto */

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  max-width: 100vw;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
}

video,
iframe {
  width: 100%;
  height: auto;
}
/* Embeds canal: height:auto aplasta iframes sin ratio intrínseco */
[class*="ytEmbed"] iframe,
[class*="spotify"] iframe,
[class*="Spotify"] iframe,
.entik-menu-portal iframe {
  height: 100% !important;
  max-width: 100%;
}
[class*="spotify"] iframe {
  min-height: 352px !important;
}

/* Marquees / tickers: contenedor recorta; la PISTA no se comprime al viewport */
[class*="ticker"]:not([class*="Pista"]):not([class*="pista"]):not([class*="Grupo"]):not([class*="grupo"]),
[class*="Ticker"]:not([class*="Pista"]):not([class*="pista"]):not([class*="Grupo"]):not([class*="grupo"]),
[class*="marquee"]:not([class*="Pista"]):not([class*="pista"]):not([class*="Grupo"]):not([class*="grupo"]),
[class*="Marquee"]:not([class*="Pista"]):not([class*="pista"]):not([class*="Grupo"]):not([class*="grupo"]),
[class*="carruselPortadas"],
[class*="carruselTicker"] {
  max-width: 100%;
  overflow: hidden;
}
[class*="carruselPista"],
[class*="carruselGrupo"],
[class*="tickerPista"],
[class*="TickerPista"],
[class*="marqueePista"],
[class*="MarqueePista"] {
  width: max-content !important;
  min-width: max-content !important;
  max-width: none !important;
}
[class*="carruselGrupo"] img,
[class*="carruselPista"] img {
  max-width: none !important;
}

[class*="dostFondo"],
[class*="dostArte"],
[class*="heroMedia"],
[class*="videoFondo"],
[class*="VideoFondo"] {
  max-width: 100%;
  overflow: hidden;
}

/* Barra PRE: una sola línea — evita solape con hero/producto */
#entik-pre-barra,
#credens-pre-barra {
  box-sizing: border-box;
  max-width: 100vw;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0.35rem !important;
  padding: 0 0.5rem !important;
  min-height: 34px;
  max-height: 34px;
  align-items: center;
  justify-content: flex-start !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}
#entik-pre-barra::-webkit-scrollbar,
#credens-pre-barra::-webkit-scrollbar {
  display: none;
}
#entik-pre-barra a,
#credens-pre-barra a {
  position: relative;
  flex-shrink: 0;
  min-height: 34px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.45rem;
  box-sizing: border-box;
}
/* Área táctil extendida sin engordar la cinta visual */
#entik-pre-barra a::before,
#credens-pre-barra a::before {
  content: "";
  position: absolute;
  inset: -6px -4px;
}

/* Padding superior SOLO cuando hay cinta PRE (no Credens MAIN ni /app) */
html body:has(#entik-pre-barra),
html body:has(#credens-pre-barra) {
  padding-top: 34px !important;
}

html.entik-in-editor body,
html[data-editor-probe="1"] body,
html.credens-in-editor body {
  padding-top: 0 !important;
}

/* Formularios: evita zoom iOS y desbordes */
input,
select,
textarea,
button {
  max-width: 100%;
}

main,
article,
section,
[class*="seccion"],
[class*="bloque"],
[class*="pagina"] {
  max-width: 100%;
  overflow-x: clip;
  min-width: 0;
}

img {
  height: auto;
}

@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Tap targets nav / CTA */
  header [class*="burger"],
  header [class*="Burger"],
  header [class*="carrito"],
  header [class*="Carrito"],
  header button {
    min-width: 44px;
    min-height: 44px;
  }

  header [class*="menuMovil"] a,
  header nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  header a[class*="brand"],
  header [class*="brand"] a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  footer a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.5rem;
    box-sizing: border-box;
  }

  footer [class*="social"] a,
  footer [class*="Social"] a,
  [class*="redes"] a,
  footer a[href*="x.com"],
  footer a[href*="twitter"],
  footer a[href*="instagram"],
  footer a[href*="facebook"],
  footer a[href*="youtube"],
  footer a[href*="spotify"],
  footer a[href*="soundcloud"] {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  [class*="ctas"] a,
  [class*="ctas"] button,
  [class*="contactoAcciones"] a,
  [class*="contactoAcciones"] button,
  a[class*="boton"],
  button[class*="boton"] {
    min-height: 44px;
  }

  [class*="grid"] {
    min-width: 0;
  }

  main,
  [class*="pagina"],
  [class*="bloque"] {
    min-width: 0;
    max-width: 100%;
  }

  /* Catálogo / producto: canal lateral cómodo */
  [class*="lanzamiento"] [class*="info"],
  [class*="producto"] [class*="info"],
  [class*="ficha"],
  [class*="detalle"],
  [class*="carrito"] main,
  [class*="pago"] main,
  main [class*="contenido"],
  .legal,
  [class*="legal"],
  main [class*="release"],
  [class*="catalogo"],
  [class*="Catalogo"] {
    padding-inline: max(1rem, env(safe-area-inset-left, 0), env(safe-area-inset-right, 0));
    box-sizing: border-box;
  }

  /* Grid catálogo: gutter mínimo usable */
  main [class*="grid"],
  [class*="releases"],
  [class*="Releases"] {
    gap: max(0.75rem, 2.5vw) !important;
    padding-inline: max(0.85rem, env(safe-area-inset-left, 0)) !important;
    box-sizing: border-box;
  }

  /* Redes hero: wrap limpio, sin huecos raros */
  [class*="redes"],
  [class*="Redes"],
  [class*="socials"],
  [class*="Socials"] {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    justify-content: flex-start;
    max-width: 100%;
  }

  [class*="redes"] a,
  [class*="Redes"] a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.25rem;
  }
}

@media (max-width: 480px) {
  body {
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
    line-height: 1.1;
  }

  h2,
  .h2Display,
  [class*="h2Display"] {
    font-size: clamp(1.25rem, 6vw, 1.85rem);
    line-height: 1.12;
  }

  /* Page heroes: evitar título enorme cortado */
  [class*="pageHero"] h1,
  [class*="pageHero"] h2,
  [class*="pageHeroInner"] h1,
  [class*="pageHeroInner"] h2,
  [class*="pageHeroInner"] .h2,
  /* 2026-11-30: excluye los titulares diseñados a pantalla completa
     (lema de la portada y h1 de /estudio), que ya se ajustan solos al ancho */
  [class*="hero"] h1:not([class*="lema"]):not([class*="estudio_h1"]) {
    font-size: clamp(1.55rem, 7.2vw, 2.2rem) !important;
    line-height: 1.12 !important;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  [class*="tickerPista"],
  [class*="marquee"],
  [class*="carruselPista"] {
    animation: none !important;
  }
}

/* fuerza barra PRE sobre estilo inline nginx (orden/caché) */
html body #entik-pre-barra,
html body #credens-pre-barra {
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow-x: auto !important;
  justify-content: flex-start !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  min-height: 34px !important;
  max-height: 34px !important;
  align-items: center !important;
}

/* Anula padding fantasma de reglas antiguas / inline nginx en admin sin cinta */
html body:not(:has(#entik-pre-barra)):not(:has(#credens-pre-barra)) {
  padding-top: 0 !important;
}


/* Vídeo de fondo sitio: no aplastar con height:auto global */
.video-sitio__media,
[class*="video-sitio__media"],
video[data-entik-hero] {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
}

/* 2026-11-30 · Cabecera fija justo debajo de la cinta PRE (34 px) */
html body:has(#entik-pre-barra) > header {
  top: 34px;
}
html.entik-in-editor body > header,
html[data-editor-probe="1"] body > header {
  top: 0;
}
