/* ============================================================
   vxm — mobile app shell (Netflix-style app experience on web)
   Everything is scoped to ≤991.98px (phones + tablets). Desktop
   is untouched. The native app webview never renders this markup
   (body.html gates on $is_mobileapp). Kill switch:
   config disable_mobile_web_ui = '1'.
   ============================================================ */

/* Tab bar markup renders for every visitor — keep it out of the
   desktop flow entirely; the media query below reveals it. */
.vxm-tabbar {
    display: none;
}

/* ============================================================
   Profile & More screen (route /more) — app-style stacked rows.
   Base styles apply at every width (desktop just gets the same
   centered column); the media query only adds mobile tweaks.
   ============================================================ */

.vxm-more {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.vxm-more__title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 24px;
}

.vxm-more__profileBlock {
    margin-bottom: 24px;
}

.vxm-more__profileLabel {
    color: #9b9ba3;
    font-size: 15px;
    margin-bottom: 14px;
}

.vxm-more__profile {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* horizontal switcher — all profiles, scrolls if many */
.vxm-more__profiles {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.vxm-more__profiles::-webkit-scrollbar {
    display: none;
}

.vxm-more__profiles .vxm-more__profile {
    flex: 0 0 auto;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.vxm-more__profiles .vxm-more__profile--current .vxm-more__avatar {
    outline: 2px solid var(--vod-primary, #e50914);
    outline-offset: 2px;
}

.vxm-more__profiles .vxm-more__profile[disabled] {
    cursor: default;
}

.vxm-more__avatar {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    object-fit: cover;
}

.vxm-more__avatar--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #cfcfd6;
    font-size: 44px;
}

.vxm-more__profileName {
    color: #fff;
    font-weight: 600;
}

.vxm-more__manage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    color: #cfcfd6;
    font-weight: 600;
    text-decoration: none;
}

.vxm-more__manage:hover {
    color: #fff;
    text-decoration: none;
}

.vxm-more__guest {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.vxm-more__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.vxm-more__heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a8a93;
    margin: 4px 0 2px;
}

.vxm-more__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.vxm-more__row:hover,
.vxm-more__row:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
}

.vxm-more__row.text-danger:hover {
    color: #ff6b6b;
}

/* Language picker — native <details>, no JS toggle needed */
.vxm-more__langWrap {
    border-radius: 10px;
}

.vxm-more__rowSummary {
    cursor: pointer;
    list-style: none;
}

.vxm-more__rowSummary::-webkit-details-marker {
    display: none;
}

.vxm-more__langWrap[open] .vxm-more__rowSummary .mdi-chevron-down {
    transform: rotate(180deg);
}

.vxm-more__langList {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 4px 2px;
}

.vxm-more__langBtn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #cfcfd6;
    font-weight: 500;
    text-align: start;
    cursor: pointer;
}

.vxm-more__langBtn:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.vxm-more__langBtn.is-active {
    color: #fff;
    font-weight: 700;
}

/* Pills + category sheet are mobile-only chrome */
.vxm-pills,
.vxm-sheet {
    display: none;
}

/* App-like navigation feel: native cross-fade between page loads
   (View Transitions API — progressive; unsupported browsers just
   navigate normally). Scoped to all viewports on purpose: desktop
   benefits too and it cannot break layout. */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.22s;
}

@media (max-width: 991.98px) {

    :root {
        --vxm-tabbar-h: 56px;
        --vxm-header-h: 68px;
    }

    /* ---- Netflix-style filter pills under the top bar -------- */
    .vxm-pills {
        position: fixed;
        top: var(--vxm-header-h);
        inset-inline: 0;
        z-index: 1029; /* just under the tab bar / header */
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 16px 10px;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .vxm-pills.is-hidden {
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
    }

    /* many pills (Live TV + group pages) scroll horizontally like the app */
    .vxm-pills {
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .vxm-pills::-webkit-scrollbar {
        display: none;
    }

    /* the pills' Categories sheet replaces the cateselector block
       (title + Genres dropdown) on the movies / tv-shows homes and
       on the per-category pages */
    body.page-movies .vxb,
    body.page-tv_shows .vxb,
    body.page-video_categories .vxb,
    body.page-series_categories .vxb,
    body.page-all-movies .vxb,
    body.page-all-tv-shows .vxb {
        display: none !important;
    }

    .vxm-pill {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 7px 14px;
        border: 1px solid rgba(255, 255, 255, 0.45);
        border-radius: 999px;
        background: rgba(10, 10, 15, 0.35);
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .vxm-pill:hover,
    .vxm-pill:focus {
        color: #fff;
        text-decoration: none;
    }

    .vxm-pill.is-active {
        background: rgba(255, 255, 255, 0.18);
        border-color: transparent;
    }

    .vxm-pill--reset {
        padding: 7px 9px;
    }

    .vxm-pill--menu .mdi {
        font-size: 15px;
        line-height: 1;
    }

    /* ---- Categories bottom sheet ----------------------------- */
    .vxm-sheet.is-open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1040; /* above tab bar, below Bootstrap modals */
    }

    .vxm-sheet__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
    }

    .vxm-sheet__panel {
        position: absolute;
        bottom: 0;
        inset-inline: 0;
        max-height: 75dvh;
        display: flex;
        flex-direction: column;
        padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px));
        border-radius: 16px 16px 0 0;
        background: #17171c;
    }

    .vxm-sheet__title {
        font-size: 17px;
        font-weight: 700;
        color: #fff;
        margin-bottom: 12px;
    }

    .vxm-sheet__list {
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .vxm-sheet__link {
        padding: 13px 4px;
        color: #cfcfd6;
        font-size: 16px;
        font-weight: 500;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .vxm-sheet__link:hover,
    .vxm-sheet__link:focus {
        color: #fff;
        text-decoration: none;
    }

    .vxm-sheet__closeBtn {
        align-self: center;
        margin-top: 14px;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 50%;
        background: #fff;
        color: #000;
        font-size: 22px;
        cursor: pointer;
    }

    /* ---- bottom tab bar ---------------------------------- */
    .vxm-tabbar {
        position: fixed;
        bottom: 0;
        inset-inline: 0;
        z-index: 1030; /* below Bootstrap modals (1050) */
        display: flex;
        align-items: stretch;
        height: calc(var(--vxm-tabbar-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--mobile-bottomNavigationBarColor,
                    var(--vod-body-back-color, #0b0b0f));
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        /* own compositor layer: keeps the fixed bar stable while rails
           and the hero trailer animate behind it */
        transform: translateZ(0);
    }

    .vxm-tabbar__item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        color: #9b9ba3;
        font-size: 10px;
        line-height: 1.2;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .vxm-tabbar__item:hover,
    .vxm-tabbar__item:focus {
        color: #cfcfd6;
        text-decoration: none;
    }

    .vxm-tabbar__item.is-active {
        color: #fff;
    }

    .vxm-tabbar__item i {
        font-size: 22px;
        line-height: 1;
    }

    .vxm-tabbar__item span {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        max-width: 100%;
        padding-inline: 4px;
    }

    .vxm-tabbar__avatar {
        width: 24px;
        height: 24px;
        border-radius: 4px;
        object-fit: cover;
    }

    .vxm-tabbar__item.is-active .vxm-tabbar__avatar {
        outline: 2px solid #fff;
        outline-offset: 1px;
    }

    /* Content must never hide behind the fixed bar. :has() keeps the
       padding off pages where body.html doesn't render the bar at all
       (login, signup, profiles gate, native app webview). */
    body:has(.vxm-tabbar) {
        padding-bottom: calc(var(--vxm-tabbar-h) + env(safe-area-inset-bottom, 0px));
    }

    /* The giant transparent LCP-hack image makes Chromium paint a
       ghost duplicate of the fixed tab bar near the top of the
       viewport (its 99vw×99vh composited layer captures the bar's
       first paint). Verified: removing the image removes the ghost.
       The LCP trick is dispensable on mobile. */
    img.vx-lcp-hack {
        display: none;
    }

    /* ---- hide website chrome (app look) ------------------- */
    /* Footer */
    footer.vxf,
    .vxf {
        display: none !important;
    }

    /* Burger + drawer (replaced by the More screen), header
       search (Search tab), language + user dropdowns (both
       move into Profile & More) */
    .vxh__burger,
    .vxh-drawer,
    .vxh__search,
    .vxh__lang,
    .vxh__user {
        display: none !important;
    }

    /* ---- Search screen — app-style big rounded input -------- */
    /* Redundant "All results / <keyword>" heading (also masks the
       pre-existing "/ null" empty-query cosmetic bug on mobile) */
    body.page-search #searchPage h2.h3 {
        display: none;
    }

    body.page-search #searchPage .text-right {
        text-align: start !important;
    }

    body.page-search #searchPage .serachBlock {
        flex-direction: column;
        justify-content: flex-start;
        gap: 12px;
    }

    body.page-search #searchPage .searchHolder {
        /* vodlix.css pins .searchHolder to width:18%!important (header widget
           sizing) — the search page input must be full-bleed like the app */
        width: 100% !important;
        overflow: visible;
        text-align: start;
        /* collapse to the input's height so the absolute magnify icon centers */
        display: flex;
        align-items: center;
    }

    body.page-search #searchPage .searchBlock {
        width: 100%;
    }

    body.page-search #searchPage .searchBlock input.form-control {
        width: 100%;
        height: 52px;
        border: 0;
        border-radius: 10px;
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
        font-size: 16px;
        /* leave room for the magnify button pinned on the left */
        padding-inline: 46px 16px;
    }

    /* keep the mdi magnify button and pin it inside the field, left-centered
       (an inline-SVG background in the `background` shorthand gets dropped by
       the CSS parser, so use the existing icon element instead) */
    body.page-search #searchPage .searchBlock {
        position: relative;
    }

    body.page-search #searchPage .searchBtn1 {
        position: absolute;
        inset-inline-start: 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        color: #9b9ba3;
        font-size: 20px;
        pointer-events: none;
    }

    body.page-search #searchPage .btn-group {
        display: flex;
        gap: 8px;
        margin-left: 0 !important;
        width: 100%;
    }

    body.page-search #searchPage .btn-group .btn {
        flex: 1 1 0;
        min-width: 0;
        border-radius: 999px !important;
        border: 1px solid rgba(255, 255, 255, 0.25);
        background: rgba(255, 255, 255, 0.08);
    }

    /* ---- My List / content-list screens ---------------------- */
    body.page-content_list #lists h2.h3 {
        text-align: center;
        font-weight: 600 !important;
    }

    body.page-content_list #lists .text-center.pt-4 {
        padding: 90px 16px;
        color: #9b9ba3;
        font-size: 16px;
    }

    /* ---- Editors-pick hero: app-style boxed card ------------- */
    /* Design mode comes from config('mobile_editors_pick_design') —
       the same knob the native app reads. The component adds
       .vxe-mob-portrait (default: still 2:3 card, no trailer) or
       .vxe-mob-landscape (16:9 card, trailer allowed, info below). */

    /* Shared card frame — only on the home screens where the hero is
       the first thing under the transparent header + pills */
    body.page-home #new-editorpick,
    body.page-movies #new-editorpick,
    body.page-tv_shows #new-editorpick {
        margin-top: calc(var(--vxm-header-h) + 58px);
        margin-inline: 16px !important; /* swiper-container sets its own margins */
        width: calc(100% - 32px) !important;
        border-radius: 16px;
        /* the featured swiper forces overflow:visible for the desktop
           billboard bleed — that leaks the next slide past the card */
        overflow: hidden !important;
    }

    /* -- portrait: Netflix-style 2:3 poster card ---------------- */
    /* the featured swiper sizes slides for the desktop billboard
       (fixed width/height) — pin everything to the card box */
    .vxe-mob-portrait .swiper-slide {
        width: 100% !important;
        height: auto !important;
    }

    .vxe-mob-portrait .swiper-slide .relative,
    .vxe-mob-portrait .relative {
        height: auto !important;
    }

    .vxe-mob-portrait .ratio-16x9,
    .vxe-mob-portrait .ratio.ratio-16x9 {
        aspect-ratio: 2 / 3;
        width: 100% !important;
        height: auto !important; /* billboard CSS pins a viewport height */
        padding-top: 0 !important;
        padding-bottom: 0 !important; /* the ratio classes use padding hacks */
    }

    .vxe-mob-portrait .ratio-16x9 img,
    .vxe-mob-portrait .ratio.ratio-16x9 img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* the slide carries an xs-only fallback button block below the
       artwork (pre-app-shell design); the billboard overlay is the
       real UI in both card modes — kill the duplicate */
    .vxe-mob-portrait .swiper-slide > div.d-lg-none.d-md-none.d-sm-none,
    .vxe-mob-landscape .swiper-slide > div.d-lg-none.d-md-none.d-sm-none {
        display: none !important;
    }

    /* no trailer in portrait mode — hide the video, its controls and
       the Trailer button (the anchor with the play-speed icon) */
    .vxe-mob-portrait video,
    .vxe-mob-portrait .vxe-controls,
    .vxe-mob-portrait .sldieBtns a:has(.mdi-play-speed) {
        display: none !important;
    }

    /* bottom-anchored overlay: two equal buttons like the app */
    .vxe-mob-portrait .sldieBtns {
        display: flex !important;
        gap: 8px;
    }

    .vxe-mob-portrait .sldieBtns .btn {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
    }

    /* -- landscape: 16:9 card, info block below (native app look) */
    .vxe-mob-landscape .swiper-slide {
        width: 100% !important;
        height: auto !important;
    }

    .vxe-mob-landscape .swiper-slide .relative,
    .vxe-mob-landscape .relative {
        height: auto !important;
    }

    .vxe-mob-landscape .ratio-16x9,
    .vxe-mob-landscape .ratio.ratio-16x9 {
        aspect-ratio: 16 / 9;
        width: 100% !important;
        height: auto !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        border-radius: 16px;
        overflow: hidden;
    }

    .vxe-mob-landscape .ratio-16x9 img,
    .vxe-mob-landscape .ratio.ratio-16x9 img,
    .vxe-mob-landscape .ratio-16x9 video,
    .vxe-mob-landscape .ratio.ratio-16x9 video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .vxe-mob-landscape .swiperInfo.vxe-billboard {
        position: static !important;
        background: none !important;
        padding: 14px 4px 0 !important;
        min-height: 0 !important;
    }

    /* overlay scrims make no sense once the info sits below the card */
    .vxe-mob-landscape .relative::before,
    .vxe-mob-landscape .relative::after {
        display: none !important;
    }

    /* mute lives at the card's top-right; .relative now includes the
       static info block, so bottom-anchoring would sit on the buttons */
    .vxe-mob-landscape .vxe-controls {
        top: 12px !important;
        bottom: auto !important;
        inset-inline-end: 12px;
    }

    .vxe-mob-landscape .sldieBtns {
        display: flex !important;
        gap: 8px;
    }

    .vxe-mob-landscape .sldieBtns .btn {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        margin-right: 0 !important;
    }

    /* ---- Details screens (movie / series) — app-style ------- */
    /* Full-bleed card, Netflix-style full-width play CTA with the
       action circles (my list / rate / share) spread beneath it. */
    body.page-video_details .detailsContainer,
    body.page-series_details .detailsContainer {
        padding-inline: 0 !important;
        max-width: 100%;
    }

    body.page-video_details .detailsContainer .card,
    body.page-series_details .detailsContainer .card {
        border-radius: 0;
    }

    /* On mobile this is a page, not an overlay — the X is confusing */
    body.page-video_details .series-detail-close,
    body.page-series_details .series-detail-close {
        display: none;
    }

    body.page-video_details .detailsIcon,
    body.page-series_details .detailsIcon {
        width: 100%;
        justify-content: space-around;
        row-gap: 12px;
    }

    body.page-video_details .detailsIcon .playResumeBtn,
    body.page-series_details .detailsIcon .playResumeBtn {
        flex: 1 1 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-block: 12px;
        font-size: 17px;
        font-weight: 700;
        margin-right: 0 !important;
    }

    /* ---- immersive pages: no tab bar ---------------------- */
    body.page-watch_video .vxm-tabbar,
    body.page-live_v2 .vxm-tabbar,
    body.page-live_details .vxm-tabbar,
    body.page-epg .vxm-tabbar {
        display: none;
    }

    body.page-watch_video,
    body.page-live_v2,
    body.page-live_details,
    body.page-epg {
        padding-bottom: 0;
    }

    /* ---- top spacing under the fixed header + pills ---------- */
    /* body.html wraps content in .contentHolder.pt-5.mt-5. On home
       the hero card carries its own top margin, so the holder needs
       none; the movies/tv-shows homes start with the heading + rails
       and must clear the fixed header + pills row instead. */
    body.page-home .contentHolder.pt-5 {
        padding-top: 0 !important;
    }

    /* home without an editors pick (body.notEditorPick) needs the
       cushion too — nothing else provides it */
    body.page-home.notEditorPick .contentHolder.pt-5,
    body.page-movies .contentHolder.pt-5,
    body.page-tv_shows .contentHolder.pt-5,
    body.page-video_categories .contentHolder.pt-5,
    body.page-series_categories .contentHolder.pt-5,
    body.page-all-movies .contentHolder.pt-5,
    body.page-all-tv-shows .contentHolder.pt-5 {
        padding-top: calc(var(--vxm-header-h) + 58px) !important;
    }

    body.page-home .contentHolder.mt-5,
    body.page-movies .contentHolder.mt-5,
    body.page-tv_shows .contentHolder.mt-5 {
        margin-top: 0 !important;
    }
}
