/* RUANGFLIX mobile UI polish v4
   - compact Netflix-style home hero
   - Menu + 18+ / MOVIE controls
   - cleaner rows and cards
   Desktop layout is intentionally untouched. */

.mobile-top-controls{display:none}

@media (max-width:700px){
  :root{--rf-mobile-header:62px}

  /* Header mobile v5: satu garis lurus, bersih, dan mudah dibaca. */
  .topbar{
    height:var(--rf-mobile-header)!important;
    min-height:var(--rf-mobile-header)!important;
    padding:0 12px!important;
    display:flex!important;
    align-items:center!important;
    gap:8px!important;
    background:linear-gradient(180deg,rgba(3,7,12,.99),rgba(3,7,12,.95))!important;
    border-bottom:1px solid rgba(255,255,255,.07)!important;
    box-shadow:0 8px 24px rgba(0,0,0,.22)!important;
    backdrop-filter:blur(14px);
  }
  .brand-logo-link{
    display:flex!important;
    align-items:center!important;
    flex:0 0 auto!important;
    min-width:0!important;
    margin:0!important;
  }
  .brand-logo-img{
    width:108px!important;
    height:auto!important;
    max-height:42px!important;
    display:block!important;
    object-fit:contain!important;
  }
  .topbar>.topbar-nav{display:none!important}

  .mobile-top-controls{
    display:flex!important;
    align-items:center!important;
    gap:7px!important;
    margin-left:auto!important;
    min-width:0!important;
  }
  .mobile-menu-pop{
    position:static!important;
    margin:0!important;
    padding:0!important;
  }
  .mobile-menu-pop>summary::-webkit-details-marker{display:none!important}
  .mobile-menu-pop>summary{list-style:none!important}
  .mobile-menu-trigger,
  .mobile-section-switch{
    height:36px!important;
    min-height:36px!important;
    box-sizing:border-box!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    margin:0!important;
    padding:0 12px!important;
    border-radius:9px!important;
    border:1px solid rgba(255,255,255,.13)!important;
    background:#101925!important;
    color:#f4f7fb!important;
    font-size:11.5px!important;
    font-weight:800!important;
    line-height:1!important;
    text-decoration:none!important;
    white-space:nowrap!important;
    cursor:pointer!important;
    box-shadow:none!important;
  }
  .mobile-menu-trigger span{
    color:#9eabb9!important;
    font-size:9px!important;
    transition:transform .18s ease!important;
  }
  .mobile-menu-pop[open] .mobile-menu-trigger{
    background:#162334!important;
    border-color:rgba(68,164,255,.48)!important;
    color:#fff!important;
  }
  .mobile-menu-pop[open] .mobile-menu-trigger span{transform:rotate(180deg)!important}
  .mobile-section-switch{
    min-width:46px!important;
    padding:0 10px!important;
    background:linear-gradient(135deg,#1a8dff,#0c66df)!important;
    border-color:rgba(98,184,255,.42)!important;
    color:#fff!important;
    box-shadow:0 7px 18px rgba(24,137,255,.18)!important;
  }
  .mobile-section-switch.adult{
    background:linear-gradient(135deg,#1f91ff,#0963da)!important;
  }

  /* Dropdown dibuat full-width di bawah header agar tidak miring/terpotong. */
  .mobile-menu-panel{
    position:fixed!important;
    z-index:500!important;
    top:calc(var(--rf-mobile-header) + 8px)!important;
    left:12px!important;
    right:12px!important;
    width:auto!important;
    max-width:none!important;
    max-height:calc(100vh - var(--rf-mobile-header) - 24px)!important;
    overflow:auto!important;
    padding:14px!important;
    border:1px solid rgba(255,255,255,.10)!important;
    border-radius:14px!important;
    background:rgba(7,11,17,.985)!important;
    box-shadow:0 24px 70px rgba(0,0,0,.62)!important;
    backdrop-filter:blur(20px)!important;
    transform:none!important;
  }
  .mobile-menu-head{
    display:flex!important;
    align-items:baseline!important;
    justify-content:space-between!important;
    gap:12px!important;
    padding:1px 2px 11px!important;
    border-bottom:1px solid rgba(255,255,255,.075)!important;
  }
  .mobile-menu-head strong{
    color:#fff!important;
    font-size:15px!important;
    font-weight:900!important;
    letter-spacing:-.01em!important;
  }
  .mobile-menu-head span{
    color:#7f8b99!important;
    font-size:10px!important;
    font-weight:600!important;
  }
  .mobile-menu-label{
    margin:14px 2px 8px!important;
    color:#7d8a9a!important;
    font-size:9px!important;
    font-weight:900!important;
    letter-spacing:.14em!important;
    text-transform:uppercase!important;
  }
  .mobile-menu-label-primary{margin-top:12px!important}
  .mobile-menu-primary{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
  }
  .mobile-menu-primary a{
    width:100%!important;
    min-height:42px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    padding:0 13px!important;
    border-radius:9px!important;
    background:#0e1621!important;
    border:1px solid rgba(255,255,255,.065)!important;
    color:#e8eef6!important;
    font-size:12px!important;
    font-weight:760!important;
    text-align:left!important;
    text-decoration:none!important;
  }
  .mobile-menu-primary a::after{
    content:'›'!important;
    margin-left:auto!important;
    color:#627083!important;
    font-size:18px!important;
    font-weight:500!important;
  }
  .mobile-menu-primary a:active{
    background:#142236!important;
    border-color:rgba(61,158,255,.30)!important;
  }
  .mobile-menu-genres{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
    overflow:visible!important;
    padding:0!important;
  }
  .mobile-menu-genres a{
    min-width:0!important;
    min-height:38px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    padding:0 11px!important;
    border-radius:9px!important;
    background:#0e1621!important;
    border:1px solid rgba(255,255,255,.065)!important;
    color:#cfd9e5!important;
    font-size:10.5px!important;
    font-weight:760!important;
    line-height:1.2!important;
    text-align:left!important;
    text-decoration:none!important;
    white-space:normal!important;
    word-break:break-word!important;
  }
  .mobile-menu-genres a.active{
    background:rgba(24,139,255,.16)!important;
    border-color:rgba(67,166,255,.38)!important;
    color:#fff!important;
  }

  .nav-actions{
    display:flex!important;
    align-items:center!important;
    flex:0 0 auto!important;
    margin-left:0!important;
    gap:0!important;
  }
  .nav-actions .avatar{display:none!important}
  .icon-btn{
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    border-radius:9px!important;
    color:#fff!important;
    font-size:20px!important;
    background:transparent!important;
  }
  .search-panel{
    top:calc(var(--rf-mobile-header) + 8px)!important;
    left:12px!important;
    right:12px!important;
    width:auto!important;
  }
  .search-panel form{width:100%!important;border-radius:10px!important}
  .search-panel input{width:auto!important;min-width:0!important;flex:1!important;padding:11px 12px!important}
  .search-panel button{padding:0 14px!important}

  /* Home hero becomes: media first, copy underneath. This mirrors the
     cleaner mobile streaming layout in the user's reference. */
  body.home-showcase .hero,
  body.adult-site.home-showcase .hero{
    display:block!important;
    min-height:0!important;
    padding-top:var(--rf-mobile-header)!important;
    background-size:100% auto!important;
    background-position:center var(--rf-mobile-header)!important;
    background-repeat:no-repeat!important;
    background-color:var(--bg)!important;
    overflow:hidden;
  }
  body.home-showcase .hero::after,
  body.adult-site.home-showcase .hero::after{display:none!important}

  body.home-showcase .hero-preview-video,
  body.adult-site.home-showcase .hero-preview-video{
    position:absolute!important;
    top:var(--rf-mobile-header)!important;
    left:0!important;
    right:0!important;
    bottom:auto!important;
    width:100%!important;
    height:56.25vw!important;
    max-height:270px!important;
    min-height:205px!important;
    object-fit:cover!important;
    object-position:center 28%!important;
    z-index:0!important;
  }
  body.home-showcase .hero-shade,
  body.adult-site.home-showcase .hero-shade{
    top:var(--rf-mobile-header)!important;
    bottom:auto!important;
    height:max(205px,min(56.25vw,270px))!important;
    background:
      linear-gradient(180deg,rgba(4,7,11,.05) 36%,rgba(4,7,11,.55) 76%,var(--bg) 100%),
      linear-gradient(90deg,rgba(4,7,11,.30),rgba(4,7,11,.02) 62%)!important;
  }
  body.home-showcase .hero-content,
  body.adult-site.home-showcase .hero-content{
    position:relative!important;
    z-index:3!important;
    width:100%!important;
    max-width:none!important;
    margin-top:max(205px,min(56.25vw,270px))!important;
    padding:15px 16px 24px!important;
    background:var(--bg);
  }
  body.home-showcase .hero .eyebrow,
  body.adult-site.home-showcase .hero .eyebrow{
    margin-bottom:7px!important;
    color:#62b0ff!important;
    font-size:9.5px!important;
    line-height:1.25!important;
    letter-spacing:.12em!important;
  }
  body.home-showcase .hero h1,
  body.adult-site.home-showcase .hero h1{
    width:100%!important;
    max-width:100%!important;
    margin:0 0 9px!important;
    font-size:clamp(28px,8vw,34px)!important;
    line-height:1.02!important;
    letter-spacing:-.035em!important;
    text-wrap:balance;
  }
  body.home-showcase .hero p,
  body.adult-site.home-showcase .hero p{
    display:-webkit-box!important;
    -webkit-line-clamp:3!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
    max-width:100%!important;
    margin:0 0 13px!important;
    color:#d6dce4!important;
    font-size:13px!important;
    line-height:1.45!important;
    text-shadow:none!important;
  }
  body.home-showcase .hero-actions,
  body.adult-site.home-showcase .hero-actions{
    margin-top:0!important;
    gap:7px!important;
    flex-wrap:wrap!important;
  }
  body.home-showcase .hero-actions .btn,
  body.adult-site.home-showcase .hero-actions .btn{
    min-height:36px!important;
    padding:0 12px!important;
    border-radius:5px!important;
    font-size:12px!important;
    gap:5px!important;
  }
  body.home-showcase .hero-stats,
  body.adult-site.home-showcase .hero-stats{
    margin-top:11px!important;
    gap:8px!important;
    color:#8f9baa!important;
    font-size:9.5px!important;
    text-shadow:none!important;
  }
  body.home-showcase .hero-stats .rating,
  body.adult-site.home-showcase .hero-stats .rating{
    padding:2px 5px!important;
    font-size:9px!important;
  }

  /* Catalogue starts immediately below the hero. */
  body.home-showcase .content,
  body.adult-site.home-showcase .content{
    margin-top:0!important;
    padding:8px 12px 54px!important;
  }
  body.home-showcase .rail,
  body.adult-site.home-showcase .rail{
    margin-bottom:22px!important;
  }
  body.home-showcase .rail-head,
  body.adult-site.home-showcase .rail-head{
    min-height:31px!important;
    gap:10px;
  }
  body.home-showcase .rail h2,
  body.adult-site.home-showcase .rail h2{
    min-width:0;
    margin:0 0 8px!important;
    color:#f4f7fb;
    font-size:15.5px!important;
    line-height:1.15!important;
    letter-spacing:.005em!important;
  }
  body.home-showcase .see-all,
  body.adult-site.home-showcase .see-all{
    min-height:27px!important;
    padding:0 10px!important;
    font-size:9px!important;
    border-radius:999px!important;
  }
  body.home-showcase .cards,
  body.adult-site.home-showcase .cards{
    gap:9px!important;
    padding:3px 0 12px!important;
    margin-bottom:0!important;
    scroll-padding-left:1px;
  }
  body.home-showcase .card,
  body.adult-site.home-showcase .card{
    flex:0 0 61vw!important;
    width:61vw!important;
    max-width:246px!important;
    min-width:0!important;
  }
  body.home-showcase .poster,
  body.adult-site.home-showcase .poster{
    border-radius:6px!important;
    box-shadow:0 8px 20px rgba(0,0,0,.38)!important;
  }
  body.home-showcase .card-summary,
  body.adult-site.home-showcase .card-summary{
    padding-top:6px!important;
  }
  body.home-showcase .card-summary h3,
  body.adult-site.home-showcase .card-summary h3{
    font-size:12px!important;
    line-height:1.25!important;
    margin-bottom:4px!important;
  }
  body.home-showcase .card-summary-meta,
  body.adult-site.home-showcase .card-summary-meta{
    font-size:9px!important;
    gap:6px!important;
  }
  body.home-showcase .empty-note,
  body.adult-site.home-showcase .empty-note{
    min-width:0!important;
    width:100%!important;
    padding:15px!important;
    font-size:11px!important;
  }

  /* Continue watching: first card visible like the reference, no huge dead gap. */
  body.home-showcase .continue-rail,
  body.adult-site.home-showcase .continue-rail{margin-top:2px!important}

  /* Keep information sections readable instead of oversized on phone. */
  .seo-zone{padding-left:16px!important;padding-right:16px!important}
  .seo-copy h2{font-size:27px!important;line-height:1.08!important}
  .seo-copy p{font-size:12.5px!important;line-height:1.65!important}
}

@media (max-width:370px){
  .brand-logo-img{width:105px!important}
  .mobile-menu-trigger,.mobile-section-switch{padding-left:9px;padding-right:9px;font-size:10px}
  .icon-btn{width:29px!important;height:29px!important}
  body.home-showcase .hero h1,body.adult-site.home-showcase .hero h1{font-size:27px!important}
  body.home-showcase .card,body.adult-site.home-showcase .card{flex-basis:66vw!important;width:66vw!important}
}
