/* =========================================================
   V295 — Mobile/celular: shell, Home pública e área autenticada
   Base: V294 aprovada. Escopo exclusivo <= 960px.

   Correção-raiz:
   ui-v222/topnav-poster-push.css possui uma regra final com
   display:flex!important para .prime-nav/.uv198-primary-nav.
   Em celular ela vencia as regras históricas de ocultação e fazia
   os links de desktop atravessarem logo, busca, PT, grade e perfil.
   Esta camada restaura o contrato mobile sem alterar desktop/cards.
   ========================================================= */

@media (max-width:960px){
  /* O menu desktop nunca disputa espaço com o cabeçalho mobile. */
  html body.prime-v086 .prime-header .prime-nav,
  html body.prime-public-v086 .public-header .uv198-primary-nav,
  html body.prime-public-v086 .public-header .public-nav,
  html body.prime-experience-v205 .uv198-primary-nav,
  html body :is(.prime-nav,.uv198-primary-nav,.public-nav){
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  /* Cabeçalhos utilizam apenas a largura real do aparelho. */
  html body :is(.prime-header,.public-header,.uv198-header){
    width:100%!important;
    max-width:100vw!important;
    overflow:visible!important;
  }
  html body :is(.prime-header .header-inner,.public-header .public-header-inner,.uv198-header .uv198-header-inner){
    width:100%!important;
    max-width:100vw!important;
    min-width:0!important;
    box-sizing:border-box!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    margin:0!important;
  }
  html body :is(.stream-brand,.public-brand,.uv198-brand){
    flex:0 0 auto!important;
    min-width:0!important;
    max-width:max-content!important;
  }
  html body :is(.header-actions,.public-header-actions,.uv198-header-actions){
    flex:0 0 auto!important;
    min-width:0!important;
    margin-left:auto!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
  }

  /* Menus/popovers nunca ultrapassam a tela. */
  html body :is(.profile-menu,.uv198-mega-menu,.v217-global-search-panel){
    max-width:calc(100vw - 20px)!important;
    box-sizing:border-box!important;
  }
}

@media (max-width:680px){
  :root{--u295-mobile-header:58px}
  html,body{max-width:100%;overflow-x:hidden}
  html body :is(main,.page-shell,.public-main){min-width:0;max-width:100%}

  /* ---------- Cabeçalho público: logo + busca + grade + conta ---------- */
  html body.prime-public-v086 :is(.public-header,.uv198-header){
    height:var(--u295-mobile-header)!important;
    min-height:var(--u295-mobile-header)!important;
  }
  html body.prime-public-v086 :is(.public-header .public-header-inner,.uv198-header .uv198-header-inner){
    height:var(--u295-mobile-header)!important;
    min-height:var(--u295-mobile-header)!important;
    padding:0 12px!important;
    gap:6px!important;
  }
  html body.prime-public-v086 :is(.public-brand,.uv198-brand){gap:0!important}
  html body.prime-public-v086 :is(.public-brand,.uv198-brand) .brand-logo-img{
    width:34px!important;
    height:34px!important;
    max-width:34px!important;
    max-height:34px!important;
    object-fit:contain!important;
  }
  html body.prime-public-v086 :is(.public-brand,.uv198-brand)>span{display:none!important}
  html body.prime-public-v086 .uv198-language{display:none!important}
  html body.prime-public-v086 .uv198-join,
  html body.prime-public-v086 .public-signup{display:none!important}
  html body.prime-public-v086 :is(.public-header-actions,.uv198-header-actions){gap:2px!important}
  html body.prime-public-v086 :is(.uv198-icon-action,.public-search-link,.uv198-avatar){
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    margin:0!important;
    border-radius:50%!important;
  }
  html body.prime-public-v086 .uv198-avatar img{
    width:32px!important;
    height:32px!important;
    max-width:32px!important;
    max-height:32px!important;
  }
  /* O grid é a navegação principal do shell público no celular. */
  html body.prime-public-v086 .uv198-header-actions>.uv198-icon-action:first-child{display:grid!important}
  html body.prime-public-v086 .uv198-grid-trigger{display:grid!important}

  /* ---------- Cabeçalho autenticado: logo + busca + grade + perfil ---------- */
  html body.prime-v086 .prime-header{
    height:var(--u295-mobile-header)!important;
    min-height:var(--u295-mobile-header)!important;
  }
  html body.prime-v086 .prime-header .header-inner{
    height:var(--u295-mobile-header)!important;
    min-height:var(--u295-mobile-header)!important;
    padding:0 12px!important;
    gap:6px!important;
  }
  html body.prime-v086 .stream-brand{gap:0!important}
  html body.prime-v086 .stream-brand .brand-logo-img{
    width:34px!important;
    height:34px!important;
    max-width:34px!important;
    max-height:34px!important;
  }
  html body.prime-v086 .stream-brand-copy{display:none!important}
  html body.prime-v086 .pv205-header-language{display:none!important}
  html body.prime-v086 .header-actions{gap:2px!important}
  html body.prime-v086 :is(.header-icon-btn,.pv205-header-grid){
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    margin:0!important;
    border-radius:50%!important;
  }
  html body.prime-v086 .profile-menu-wrap{flex:0 0 auto!important;min-width:0!important}
  html body.prime-v086 .profile-trigger{
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
  }
  html body.prime-v086 .profile-trigger .chevron{display:none!important}
  html body.prime-v086 .profile-trigger .profile-avatar{
    width:34px!important;
    min-width:34px!important;
    height:34px!important;
  }

  /* ---------- Home pública: primeira dobra realmente mobile ---------- */
  html body.public-home-v198 .uv198-hero{
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    padding-top:var(--u295-mobile-header)!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  html body.public-home-v198 .uv198-hero-visual{
    order:1!important;
    width:100%!important;
    min-width:0!important;
    height:clamp(280px,78vw,350px)!important;
    min-height:clamp(280px,78vw,350px)!important;
    max-height:350px!important;
  }
  html body.public-home-v198 .uv198-hero-copy{
    order:2!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    box-sizing:border-box!important;
    padding:26px 18px 34px!important;
    background:#000!important;
  }
  html body.public-home-v198 .uv198-hero-copy h1{
    max-width:11.5ch!important;
    margin:0 0 18px!important;
    font-size:clamp(34px,10.2vw,42px)!important;
    line-height:1!important;
    letter-spacing:-.035em!important;
    text-wrap:balance!important;
  }
  html body.public-home-v198 :is(.uv198-hero-lead,.uv198-hero-note){
    width:100%!important;
    max-width:none!important;
    font-size:15px!important;
    line-height:1.42!important;
    letter-spacing:-.008em!important;
  }
  html body.public-home-v198 .uv198-hero-note{margin-top:13px!important;color:#d5d5d5!important}
  html body.public-home-v198 .uv198-hero-cta{
    width:100%!important;
    max-width:none!important;
    margin-top:22px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr)!important;
    align-items:center!important;
    gap:7px!important;
  }
  html body.public-home-v198 .uv198-hero-button{
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
    height:46px!important;
    padding:0 10px!important;
    border-radius:8px!important;
    font-size:13px!important;
    line-height:1.15!important;
    text-align:center!important;
  }
  html body.public-home-v198 .uv198-hero-or{
    width:28px!important;
    height:46px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:0!important;
    font-size:10px!important;
    color:#aaa!important;
  }
  html body.public-home-v198 .uv198-hero-or:before,
  html body.public-home-v198 .uv198-hero-or:after{display:none!important}
  html body.public-home-v198 .uv203-home-register-link{
    margin-top:12px!important;
    font-size:11px!important;
    line-height:1.35!important;
  }
  html body.public-home-v198 .uv198-hero-catalog-count{
    margin-top:10px!important;
    font-size:10px!important;
  }

  /* Trilhos/cards: preserva scroll horizontal e remove largura acidental da página. */
  html body :is(.course-rail,.pv-public-rail,.pv205-rail-track,.v217-streaming-rail){
    max-width:100%!important;
  }
  html body :is(.rail-shell,.pv-public-rail-shell,.pv205-rail-shell){
    min-width:0!important;
    max-width:100%!important;
  }

  /* Cursos/Assinatura: conteúdo respeita gutter do aparelho. */
  html body.prime-experience-v205 :is(.pv205-page,.sub205-page,.sub205-catalog,.pv203-showcase,.catalog-page){
    min-width:0!important;
    max-width:100%!important;
  }
}

@media (max-width:420px){
  html body.prime-public-v086 :is(.public-header .public-header-inner,.uv198-header .uv198-header-inner),
  html body.prime-v086 .prime-header .header-inner{padding-inline:10px!important}
  html body.public-home-v198 .uv198-hero-visual{
    height:clamp(270px,80vw,320px)!important;
    min-height:clamp(270px,80vw,320px)!important;
  }
  html body.public-home-v198 .uv198-hero-copy{padding:24px 16px 30px!important}
  html body.public-home-v198 .uv198-hero-copy h1{font-size:clamp(33px,10.4vw,40px)!important}
  html body.public-home-v198 :is(.uv198-hero-lead,.uv198-hero-note){font-size:14.5px!important}
  html body.public-home-v198 .uv198-hero-button{font-size:12.5px!important}
}

@media (max-width:360px){
  /* Em aparelhos muito estreitos, mantém busca + grade + conta sem esmagar logo. */
  html body.prime-public-v086 :is(.uv198-icon-action,.public-search-link,.uv198-avatar),
  html body.prime-v086 :is(.header-icon-btn,.pv205-header-grid){
    flex-basis:36px!important;
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
  }
  html body.public-home-v198 .uv198-hero-cta{grid-template-columns:1fr!important;gap:7px!important}
  html body.public-home-v198 .uv198-hero-or{display:none!important}
}
