/* ============================================================================
   SANSAT PLAYER — Mobile Vertical Live TV Styles (live-movil-vertical.css)
   Strictly scoped to html[data-device="mobile"] .mv-live-page
   Exact implementation of Screenshot 4: Category rails, horizontal card tracks,
   floating bottom pill "Categorías", floating quick action, and "Ver todo" grid.
   ============================================================================ */

html[data-device="mobile"] .mv-live-page {
    position: relative;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    min-height: 100dvh;
    background: var(--mv-bg, #060607);
    overflow-x: hidden;
    padding-bottom: 120px;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}

/* Header */
html[data-device="mobile"] .mv-live-page header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 12px;
}

html[data-device="mobile"] .mv-live-page header h1 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[data-device="mobile"] .mv-live-page header .cnt-badge {
    padding: 3px 9px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .75);
    font-size: 12px;
    font-weight: 700;
}

html[data-device="mobile"] .mv-live-page header .ib,
html[data-device="mobile"] .mv-live-page .ib {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: none;
    color: #fff;
    transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

html[data-device="mobile"] .mv-live-page header .ib:active,
html[data-device="mobile"] .mv-live-page .ib:active {
    transform: scale(0.93);
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

html[data-device="mobile"] .mv-live-page header .ib svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.2;
}

/* Search bar (Unifies 1:1 with VOD search pill) */
html[data-device="mobile"] .mv-live-page .search {
    margin: 14px 18px 0;
}

/* ============================================================================
   CATEGORY RAILS CONTAINER (Screenshot 4)
   ============================================================================ */
html[data-device="mobile"] .mv-live-rails-container {
    padding: 8px 0 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

html[data-device="mobile"] .mv-cat-rail-section {
    position: relative;
    display: flex;
    flex-direction: column;
}

html[data-device="mobile"] .mv-cat-rail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 10px;
}

html[data-device="mobile"] .mv-cat-rail-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

html[data-device="mobile"] .mv-cat-rail-title b {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[data-device="mobile"] .mv-cat-rail-title .cnt {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, .6);
    flex: none;
}

html[data-device="mobile"] .mv-rail-see-all {
    font-size: 11.5px;
    font-weight: 700;
    color: #ff3b47;
    background: rgba(229, 9, 20, 0.14);
    border: 1px solid rgba(255, 59, 71, 0.35);
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    padding: 3px 10px;
    flex: none;
    letter-spacing: 0.2px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

html[data-device="mobile"] .mv-rail-see-all:active {
    background: rgba(229, 9, 20, 0.28);
    border-color: rgba(255, 59, 71, 0.6);
    color: #fff;
    transform: scale(0.95);
}

/* Horizontal Track of Cards */
html[data-device="mobile"] .mv-cat-rail-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 18px 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

html[data-device="mobile"] .mv-cat-rail-track::-webkit-scrollbar {
    display: none;
}

/* Single Channel Card — Authentic Glassmorphism (Cristal Transparente) */
html[data-device="mobile"] .mv-rail-card {
    width: 108px;
    min-width: 108px;
    max-width: 108px;
    height: 144px;
    background: var(--glass) !important;
    border: 1px solid var(--line) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 18px;
    position: relative;
    padding: 10px 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

html[data-device="mobile"] .mv-rail-card:active {
    transform: scale(0.95);
    background: rgba(229, 9, 20, .18) !important;
    border-color: rgba(255, 59, 71, .45) !important;
    box-shadow: 0 8px 24px -6px rgba(229, 9, 20, .6);
}

/* Favorite Heart in Top Right */
html[data-device="mobile"] .mv-rail-card-fav {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

html[data-device="mobile"] .mv-rail-card-fav:active {
    transform: scale(1.2);
}

html[data-device="mobile"] .mv-rail-card-fav svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: rgba(255, 255, 255, .65);
    stroke-width: 2;
}

html[data-device="mobile"] .mv-rail-card-fav.is-fav {
    background: rgba(229, 9, 20, .25);
    border-color: rgba(255, 59, 71, .5);
}

html[data-device="mobile"] .mv-rail-card-fav.is-fav svg {
    fill: #e50914;
    stroke: #e50914;
}

/* Centered Logo with subtle glass backdrop */
html[data-device="mobile"] .mv-rail-card-logo {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    margin: auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

html[data-device="mobile"] .mv-rail-card-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

html[data-device="mobile"] .mv-rail-card-logo span {
    font-size: 13px;
    font-weight: 800;
    color: rgba(255, 255, 255, .8);
    letter-spacing: -0.2px;
}

/* Channel Name at Bottom (2 Lines) */
html[data-device="mobile"] .mv-rail-card-name {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: #fff;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    margin-top: 4px;
    padding: 0 2px;
}



/* ============================================================================
   GRID VIEW (For "Ver todo" and Search Results)
   ============================================================================ */
html[data-device="mobile"] .mv-live-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px 18px 100px;
}

@media (max-width: 374px) {
    html[data-device="mobile"] .mv-live-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

html[data-device="mobile"] .mv-live-grid .mv-rail-card {
    width: 100%;
    min-width: 0;
    max-width: none;
}

/* ============================================================================
   CATEGORIES BOTTOM SHEET
   ============================================================================ */
html[data-device="mobile"] .mv-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 280;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

html[data-device="mobile"] .mv-sheet {
    width: 100%;
    max-width: 430px;
    max-height: 80dvh;
    background: rgba(18, 18, 24, 0.94) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    border-top: 1px solid var(--line) !important;
    border-radius: 28px 28px 0 0;
    padding: 16px 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

html[data-device="mobile"] .mv-sheet-handle {
    width: 44px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .25);
    margin: 0 auto 6px;
}

html[data-device="mobile"] .mv-sheet-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

html[data-device="mobile"] .mv-sheet-head-row h3 {
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

html[data-device="mobile"] .mv-sheet-reorder-btn {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    color: rgba(255, 255, 255, .8);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

html[data-device="mobile"] .mv-sheet-reorder-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

html[data-device="mobile"] .mv-sheet-cat-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

html[data-device="mobile"] .mv-sheet-cat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .07);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: start;
}

html[data-device="mobile"] .mv-sheet-cat-item:active {
    background: rgba(255, 255, 255, .12);
}

html[data-device="mobile"] .mv-sheet-cat-item .mv-cat-ic {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex: none;
}

html[data-device="mobile"] .mv-sheet-cat-item .mv-cat-ic.heart {
    color: #e50914;
}

html[data-device="mobile"] .mv-sheet-cat-item .mv-cat-nm {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[data-device="mobile"] .mv-sheet-cat-item .mv-cat-cnt {
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, .5);
    flex: none;
}

/* Sort Options */
html[data-device="mobile"] .mv-sheet-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .09);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

html[data-device="mobile"] .mv-sheet-opt:active {
    background: rgba(255, 255, 255, .14);
}

/* ============================================================================
   2-SCREEN VERTICAL MULTIVISTA
   ============================================================================ */
html[data-device="mobile"] .mv-multiscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #000;
    display: flex;
    flex-direction: column;
}

html[data-device="mobile"] .mv-ms-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px;
    background: rgba(10, 10, 14, .92);
}

html[data-device="mobile"] .mv-ms-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

html[data-device="mobile"] .mv-multiscreen-grid-2v {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg, #060607);
    padding: 6px;
}

html[data-device="mobile"] .mv-ms-slot {
    flex: 1;
    position: relative;
    background: rgba(18, 18, 24, 0.94);
    border-radius: 16px;
    overflow: hidden;
    border: 1.5px solid var(--line);
    display: flex;
    flex-direction: column;
}

html[data-device="mobile"] .mv-ms-slot.is-audio-active {
    border-color: #3b82f6;
    box-shadow: 0 0 16px rgba(59, 130, 246, .45);
}

html[data-device="mobile"] .mv-ms-slot video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    z-index: 1;
}

html[data-device="mobile"] .mv-ms-slot-empty {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
}

html[data-device="mobile"] .mv-ms-slot-empty .plus-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff2a3b, #e50914);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(229, 9, 20, .6);
}

html[data-device="mobile"] .mv-ms-slot-empty .plus-circle svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.2;
}

html[data-device="mobile"] .mv-ms-slot-bar {
    position: relative;
    z-index: 3;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .88));
}

html[data-device="mobile"] .mv-ms-slot-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

html[data-device="mobile"] .mv-ms-btn {
    height: 32px;
    padding: 0 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

html[data-device="mobile"] .mv-ms-btn.is-on {
    background: linear-gradient(135deg, #ff2a3b, #e50914);
    border-color: rgba(255, 255, 255, .3);
}

html[data-device="mobile"] .mv-ms-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}
