/**
 * SANSAT Player — Mobile Vertical Shared Styles (shared-movil-vertical.css)
 * Strictly scoped to html[data-device="mobile"] (Android Mobile & iOS Mobile).
 * Completely isolated from TV / Desktop horizontal layouts.
 * Hardened with native-webview-ui rules (no bounce, 100dvh, safe areas, RTL/LTR).
 */

html[data-device="mobile"] {
  --bg: #060607;
  --line: rgba(255, 255, 255, .09);
  --red: #e50914;
  --red2: #ff3b47;
  --mut: rgba(255, 255, 255, .58);
  --glass: rgba(255, 255, 255, .07);
  background: #060607 !important;
  overscroll-behavior-y: contain !important;
  -webkit-text-size-adjust: 100%;
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Hard reset for body on mobile vertical: MUST BE SCROLLABLE (Overrides TV position:fixed) */
html[data-device="mobile"] body,
body.device-mobile:not(.device-tablet) {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  min-height: 100dvh !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior-y: contain !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Unlock Portrait Mode on Mobile Devices (Hide legacy "Gira tu dispositivo" overlay) */
html[data-device="mobile"] #orientation-lock-overlay,
html[data-device="mobile"] .orientation-lock-overlay,
body.device-mobile:not(.device-tablet) #orientation-lock-overlay,
body.device-mobile:not(.device-tablet) .orientation-lock-overlay {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -9999 !important;
}

html[data-device="mobile"] #app,
html[data-device="mobile"] .app-main,
body.device-mobile:not(.device-tablet) #app,
body.device-mobile:not(.device-tablet) .app-main {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 100% !important;
  min-height: 100dvh !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  background: var(--bg) !important;
}

html[data-device="mobile"] #splash-screen:not(.hidden),
body.device-mobile:not(.device-tablet) #splash-screen:not(.hidden) {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Clean, Responsive Landscape support for Mobile Devices without off-screen voids */
@media screen and (orientation: landscape) {
  html[data-device="mobile"]:not([data-fullscreen-player="true"]),
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) body {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    transform: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) #app,
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) .app-main {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    min-height: 100dvh !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--bg) !important;
  }
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) .mv-app {
    max-width: 100% !important;
    margin: 0 auto !important;
    width: 100% !important;
    padding-left: max(env(safe-area-inset-left, 0px), 16px) !important;
    padding-right: max(env(safe-area-inset-right, 0px), 16px) !important;
    box-sizing: border-box !important;
  }
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) .mv-app nav.mv-bottom-nav,
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) .mv-app > nav {
    width: min(calc(100% - 32px), 520px) !important;
    height: 56px !important;
    border-radius: 28px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
    padding: 0 12px !important;
  }
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) .mv-app .tab {
    font-size: 10px !important;
    padding: 2px 0 !important;
    gap: 2px !important;
  }
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) .mv-app .tab svg {
    width: 20px !important;
    height: 20px !important;
  }
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) .mv-app .pill {
    width: 46px !important;
    height: 22px !important;
    border-radius: 12px !important;
  }
  html[data-device="mobile"]:not([data-fullscreen-player="true"]) .mv-app .tab.on .pill {
    height: 28px !important;
  }
}

html[data-device="mobile"],
html[data-device="mobile"] *,
html[data-device="mobile"] *::before,
html[data-device="mobile"] *::after,
html[data-device="mobile"] h1,
html[data-device="mobile"] h2,
html[data-device="mobile"] h3,
html[data-device="mobile"] h4,
html[data-device="mobile"] h5,
html[data-device="mobile"] h6,
html[data-device="mobile"] b,
html[data-device="mobile"] strong,
html[data-device="mobile"] p,
html[data-device="mobile"] span,
html[data-device="mobile"] div,
html[data-device="mobile"] button,
html[data-device="mobile"] input,
html[data-device="mobile"] textarea,
html[data-device="mobile"] a,
html[data-device="mobile"] small,
html[data-device="mobile"] em {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

html[data-device="mobile"][dir="rtl"],
html[data-device="mobile"][dir="rtl"] *,
html[data-device="mobile"][dir="rtl"] *::before,
html[data-device="mobile"][dir="rtl"] *::after,
html[data-device="mobile"][dir="rtl"] h1,
html[data-device="mobile"][dir="rtl"] h2,
html[data-device="mobile"][dir="rtl"] h3,
html[data-device="mobile"][dir="rtl"] h4,
html[data-device="mobile"][dir="rtl"] h5,
html[data-device="mobile"][dir="rtl"] h6,
html[data-device="mobile"][dir="rtl"] b,
html[data-device="mobile"][dir="rtl"] strong,
html[data-device="mobile"][dir="rtl"] p,
html[data-device="mobile"][dir="rtl"] span,
html[data-device="mobile"][dir="rtl"] div,
html[data-device="mobile"][dir="rtl"] button,
html[data-device="mobile"][dir="rtl"] input,
html[data-device="mobile"][dir="rtl"] textarea,
html[data-device="mobile"][dir="rtl"] a,
html[data-device="mobile"][dir="rtl"] small,
html[data-device="mobile"][dir="rtl"] em {
  font-family: "Cairo", "Noto Sans Arabic", "Tajawal", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  letter-spacing: 0 !important;
}

/* Never show TV red focus outline/border on Mobile Vertical buttons or tabs */
html[data-device="mobile"] *:focus,
html[data-device="mobile"] *:focus-visible,
html[data-device="mobile"] .nav-focused,
html[data-device="mobile"] .nav-focused:not(input):not(textarea):not(select),
html[data-device="mobile"] .mv-app .nav-focused,
html[data-device="mobile"] .mv-app button:focus,
html[data-device="mobile"] .mv-app .tab:focus,
html[data-device="mobile"] .mv-app .tab.nav-focused {
  outline: none !important;
  outline-width: 0 !important;
  outline-style: none !important;
  outline-color: transparent !important;
}

html[data-device="mobile"] body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Tajawal", "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  color: #fff;
  background: #000 !important;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

html[data-device="mobile"] input,
html[data-device="mobile"] textarea {
  user-select: text;
  -webkit-user-select: text;
}

/* Main Vertical Mobile App Container (.mv-app) */
html[data-device="mobile"] .mv-app {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  color: #fff;
  overflow-x: hidden;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 120px);
  box-sizing: border-box;
}

html[data-device="mobile"] .mv-app::before {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  top: -160px;
  height: 460px;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(229, 9, 20, .33), rgba(229, 9, 20, .1) 55%, rgba(229, 9, 20, 0));
  z-index: 0;
}

html[data-device="mobile"] .mv-app > * {
  position: relative;
  z-index: 1;
}

html[data-device="mobile"] .mv-app svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

html[data-device="mobile"] .mv-app .ib {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, background 0.14s ease;
}

html[data-device="mobile"] .mv-app .ib:active {
  transform: scale(0.93);
  background: rgba(255, 255, 255, .14);
}

html[data-device="mobile"] .mv-app .ib svg {
  width: 20px;
  height: 20px;
}

html[data-device="mobile"][dir="rtl"] .mv-app > header > .ib:first-child svg,
html[data-device="mobile"] .mv-app[dir="rtl"] > header > .ib:first-child svg,
html[data-device="mobile"][dir="rtl"] .mv-app .ib.mv-back-btn svg,
html[data-device="mobile"] .mv-app[dir="rtl"] .ib.mv-back-btn svg {
  transform: scaleX(-1);
}

html[data-device="mobile"] .mv-app > header h1,
html[data-device="mobile"] .mv-header h1 {
  flex: 1;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
  color: #fff;
}

/* Shared Search Bar */
html[data-device="mobile"] .mv-app .search {
  position: relative;
  margin: 16px 20px 0;
  height: 48px;
  border-radius: 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: var(--mut);
  font-size: 15px;
}

html[data-device="mobile"] .mv-app .search svg {
  width: 19px;
  height: 19px;
  flex: none;
}

html[data-device="mobile"] .mv-app .search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  min-width: 0;
}

html[data-device="mobile"] .mv-app .search input::placeholder {
  color: var(--mut);
}

/* Shared Category Chips */
html[data-device="mobile"] .mv-app .chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 20px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

html[data-device="mobile"] .mv-app .chips::-webkit-scrollbar {
  display: none;
}

html[data-device="mobile"] .mv-app .chip {
  flex: none;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  background: var(--glass);
  border: 1px solid var(--line);
  color: rgba(255, 255, 255, .85);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease;
}

html[data-device="mobile"] .mv-app .chip:active {
  transform: scale(0.96);
}

html[data-device="mobile"] .mv-app .chip em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--mut);
}

html[data-device="mobile"] .mv-app .chip.on {
  background: linear-gradient(180deg, #ff2a36, #c40710);
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(229, 9, 20, .9);
}

html[data-device="mobile"] .mv-app .chip.on em {
  color: rgba(255, 255, 255, .85);
}

/* Shared Floating 5-Tab Bottom Navigation Bar */
html[data-device="mobile"] .mv-app nav.mv-bottom-nav,
html[data-device="mobile"] .mv-app > nav {
  position: fixed;
  z-index: 90;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  width: min(calc(100% - 32px), 398px);
  height: 68px;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  background: rgba(24, 24, 28, .78);
  backdrop-filter: blur(26px) saturate(1.6);
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .85);
}

html[data-device="mobile"] .mv-app .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-family: inherit;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.12s ease;
}

html[data-device="mobile"] .mv-app .tab:active {
  transform: scale(0.94);
}

html[data-device="mobile"] .mv-app .tab svg {
  width: 23px;
  height: 23px;
}

html[data-device="mobile"] .mv-app .tab.on {
  color: #fff;
}

html[data-device="mobile"] .mv-app .pill {
  width: 52px;
  height: 26px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

html[data-device="mobile"] .mv-app .tab.on .pill {
  height: 34px;
  background: linear-gradient(180deg, #ff2a36, #c40710);
  box-shadow: 0 8px 18px -6px rgba(229, 9, 20, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
}

@keyframes mv-spin {
  to { transform: rotate(360deg); }
}

html[data-device="mobile"] .mv-rotating svg {
  animation: mv-spin 0.8s linear infinite;
}

/* Category Reorder Modal — Glassmorphic Mobile Vertical Design */
html[data-device="mobile"] #rOv,
html[data-device="mobile"] #rOv.is-mobile {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  background: rgba(0, 0, 0, 0.82) !important;
  backdrop-filter: blur(24px) saturate(1.8) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.8) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: env(safe-area-inset-top, 16px) 16px calc(env(safe-area-inset-bottom, 16px) + 16px) !important;
  box-sizing: border-box !important;
}

html[data-device="mobile"] #rCard,
html[data-device="mobile"] #rCard.is-mobile {
  width: 100% !important;
  max-width: 410px !important;
  height: 86vh !important;
  max-height: 86vh !important;
  display: grid !important;
  grid-template-columns: 1fr 52px !important;
  grid-template-rows: 46px 1fr 52px !important;
  grid-template-areas:
    "title title"
    "list  side"
    "foot  foot" !important;
  gap: 12px 10px !important;
  padding: 16px !important;
  background: rgba(18, 18, 24, 0.92) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 26px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(229, 9, 20, 0.2) !important;
  box-sizing: border-box !important;
}

html[data-device="mobile"] #rT {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

html[data-device="mobile"] #rL {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}

html[data-device="mobile"] .ro {
  min-height: 44px !important;
  padding: 0 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  font-size: 13.5px !important;
  color: #fff !important;
}

html[data-device="mobile"] .ro.focused {
  background: rgba(229, 9, 20, 0.18) !important;
  border-color: rgba(255, 59, 71, 0.45) !important;
}

html[data-device="mobile"] .ro.sel {
  background: rgba(229, 9, 20, 0.28) !important;
}

html[data-device="mobile"] #rS .rb {
  width: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

html[data-device="mobile"] #rS .rb:active {
  transform: scale(0.92) !important;
  background: rgba(229, 9, 20, 0.25) !important;
  border-color: rgba(255, 59, 71, 0.5) !important;
}

html[data-device="mobile"] #rF {
  display: flex !important;
  gap: 10px !important;
}

html[data-device="mobile"] #rF .pmb {
  flex: 1 !important;
  height: 46px !important;
  border-radius: 23px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

html[data-device="mobile"] #rOk {
  background: linear-gradient(180deg, #ff2a36, #c40710) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px -6px rgba(229, 9, 20, 0.8) !important;
}

html[data-device="mobile"] #rCa {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

