/*
Theme Name: BBMALYA Stream Theme
Theme URI: https://bbmalya.stream
Author: BBMALYA Stream Enterprises
Author URI: https://bbmalya.stream
Description: Netflix-exact streaming theme with root overlap fix, responsive fluid scaling, and cache-busted assets
Version: 3.6.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bbmalya-stream
Tags: streaming, movies, netflix, responsive, fluid, 4k, ultrawide
*/

/* ==============================
   CSS VARIABLES & RESET
   ============================== */
:root {
  /* Netflix Color Palette */
  --bb-bg: #141414;
  --bb-bg-dark: #0a0a0a;
  --bb-surface: #181818;
  --bb-surface-hover: #2a2a2a;
  --bb-red: #e50914;
  --bb-red-hover: #f40612;
  --bb-text: #e5e5e5;
  --bb-text-muted: #808080;
  --bb-border: #333;
  --bb-success: #46d369;
  --bb-radius: 4px;
  --bb-radius-lg: 6px;
  --bb-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --bb-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);

  /* Netflix Animation Timing */
  --netflix-ease: cubic-bezier(0.5, 0, 0.1, 1);
  --bb-transition: 0.2s ease;
  --bb-transition-medium: 0.3s ease;
  --card-transition: 0.45s cubic-bezier(0.5, 0, 0.1, 1);
  --card-hover-delay: 500ms;
  --card-scale: 1.3;
  --navbar-transition: 0.3s ease;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bb-bg);
  color: var(--bb-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==============================
   LAYOUT
   ============================== */
.bb-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4%;
}

/* ==============================
   HEADER
   ============================== */
.bb-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  transition: background 0.3s ease;
}

.bb-header.is-scrolled {
  background: var(--bb-bg-dark);
  box-shadow: var(--bb-shadow);
}

.bb-bar {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 24px;
}

/* Logo */
.bb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.bb-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--bb-red);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  color: white;
}

.bb-logo-text {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.1em;
  color: white;
}

.bb-logo-img {
  height: 36px;
  width: auto;
}

/* Navigation */
.bb-nav {
  flex: 1;
}

.bb-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.bb-menu li {
  position: relative;
  display: flex;
  /* Ensure li behaves as a flex container for centering if needed */
  align-items: center;
  height: 100%;
  /* Fill header height */
}

.bb-menu li a {
  color: var(--bb-text);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--bb-transition);
}

.bb-menu li a:hover,
.bb-menu li.current-menu-item a,
.bb-menu li.current a {
  color: white;
}

/* ==============================
   SUBMENU DROPDOWN (Hotfix 0.8.2)
   ============================== */

/* Parent indicator caret */
.bb-menu>li.menu-item-has-children>a::after {
  content: '\25BE';
  display: inline-block;
  margin-left: 5px;
  font-size: 10px;
  opacity: 0.7;
  transition: transform var(--bb-transition);
}

.bb-menu>li.menu-item-has-children:hover>a::after,
.bb-menu>li.menu-item-has-children:focus-within>a::after {
  transform: rotate(180deg);
}

/* Desktop submenu dropdown */
.bb-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 200px;
  background: var(--bb-bg-dark);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-lg);
  padding: 8px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  box-shadow: var(--bb-shadow-lg);
  z-index: 1100;
}

/* Show on hover / focus-within / JS-driven */
.bb-menu>li.menu-item-has-children:hover>.sub-menu,
.bb-menu>li.menu-item-has-children:focus-within>.sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Submenu items */
.bb-menu .sub-menu li {
  display: block;
  height: auto;
}

.bb-menu .sub-menu li a {
  display: block;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--bb-text);
  white-space: nowrap;
  transition: background var(--bb-transition), color var(--bb-transition);
  border-radius: 0;
}

.bb-menu .sub-menu li a:hover {
  background: var(--bb-surface-hover);
  color: white;
}

.bb-menu .sub-menu li.current-menu-item a {
  color: white;
  background: var(--bb-surface);
}

/* Hide desktop submenu on mobile (drawer handles it) */
@media (max-width: 900px) {
  .bb-menu .sub-menu {
    display: none;
  }
}

/* --- Mobile Drawer Submenu --- */
.bb-drawer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bb-drawer-menu li {
  position: relative;
}

.bb-drawer-menu li a {
  display: block;
  padding: 14px 16px;
  border-radius: var(--bb-radius-lg);
  font-size: 15px;
  font-weight: 500;
  color: var(--bb-text);
  transition: background var(--bb-transition);
}

.bb-drawer-menu li a:hover {
  background: var(--bb-surface-hover);
}

.bb-drawer-menu li.current-menu-item>a {
  background: var(--bb-surface);
  color: white;
}

/* Drawer submenu toggle button */
.bb-drawer-submenu-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius);
  color: var(--bb-text);
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--bb-transition), background var(--bb-transition);
}

.bb-drawer-submenu-toggle:hover {
  background: var(--bb-surface-hover);
}

li.is-expanded>.bb-drawer-submenu-toggle {
  transform: rotate(90deg);
}

/* Nested submenu in drawer — collapsed by default */
.bb-drawer-menu .sub-menu {
  list-style: none;
  padding: 0 0 0 16px;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.bb-drawer-menu li.is-expanded>.sub-menu {
  max-height: 600px;
}

.bb-drawer-menu .sub-menu li a {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--bb-text-muted);
}

.bb-drawer-menu .sub-menu li a:hover {
  color: white;
  background: var(--bb-surface-hover);
}

/* Right Side */
.bb-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bb-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: white;
  border-radius: 50%;
  transition: background var(--bb-transition);
}

.bb-icon-btn:hover {
  background: var(--bb-surface-hover);
}

/* Search */
.bb-search {
  display: flex;
  align-items: center;
  position: relative;
}

.bb-search-input {
  width: 0;
  padding: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  transition: all 0.3s ease;
  opacity: 0;
}

.bb-search.is-open .bb-search-input {
  width: 200px;
  padding: 10px 12px;
  background: var(--bb-bg-dark);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius);
  opacity: 1;
  margin-right: 8px;
}

.bb-search-input:focus {
  outline: none;
  border-color: white;
}

/* Profile Dropdown */
.bb-profile {
  position: relative;
}

.bb-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: white;
  padding: 4px;
}

.bb-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--bb-red), #ff6b6b);
  border-radius: var(--bb-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.bb-caret {
  font-size: 10px;
  opacity: 0.7;
  transition: transform var(--bb-transition);
}

.bb-profile:hover .bb-caret {
  transform: rotate(180deg);
}

.bb-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: var(--bb-bg-dark);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  box-shadow: var(--bb-shadow-lg);
}

.bb-profile:hover .bb-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.bb-dropdown a,
.bb-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  color: var(--bb-text);
  font-size: 13px;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition: background var(--bb-transition);
}

.bb-dropdown a:hover,
.bb-dropdown button:hover {
  background: var(--bb-surface-hover);
  color: white;
}

.bb-dropdown hr {
  border: none;
  height: 1px;
  background: var(--bb-border);
  margin: 8px 0;
}

/* Hamburger */
.bb-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 8px;
}

.bb-hamburger span {
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all var(--bb-transition);
}

@media (max-width: 900px) {
  .bb-nav {
    display: none;
  }

  .bb-hamburger {
    display: flex;
  }
}

/* ==============================
   HERO BILLBOARD
   ============================== */
.bb-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 80px;
}

.bb-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.bb-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bb-hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(20, 20, 20, 0.9) 0%, rgba(20, 20, 20, 0.5) 40%, transparent 60%),
    linear-gradient(to top, var(--bb-bg) 0%, rgba(20, 20, 20, 0.4) 30%, transparent 60%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, transparent 20%);
}

.bb-hero-content {
  max-width: 550px;
  animation: fadeUp 0.8s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bb-badge {
  display: inline-block;
  background: var(--bb-red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.bb-hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.bb-hero-desc {
  font-size: clamp(14px, 1.1vw, 18px);
  color: var(--bb-text);
  margin: 0 0 20px;
  line-height: 1.6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.bb-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--bb-text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.bb-match {
  color: var(--bb-success);
  font-weight: 700;
}

.bb-rating {
  border: 1px solid var(--bb-text-muted);
  padding: 2px 6px;
  font-size: 12px;
}

.bb-quality {
  background: var(--bb-surface);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.bb-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--bb-transition);
}

.bb-btn-play {
  background: white;
  color: black;
}

.bb-btn-play:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: scale(1.02);
}

.bb-btn-info {
  background: rgba(109, 109, 110, 0.7);
  color: white;
}

.bb-btn-info:hover {
  background: rgba(109, 109, 110, 0.5);
}



/* --- Hero: responsive polish (mobile/tablet/4K) --- */
@media (max-width: 1024px) {
  .bb-hero {
    padding-top: calc(var(--header-height) + 20px);
    min-height: 78vh;
  }

  .bb-hero-content {
    max-width: 720px;
  }
}

@media (max-width: 768px) {
  .bb-hero {
    min-height: 70vh;
    padding-top: calc(var(--header-height) + 14px);
  }

  .bb-hero-content {
    padding: 0 16px;
  }

  .bb-hero h1 {
    font-size: clamp(28px, 7vw, 42px);
    line-height: 1.12;
  }

  .bb-hero p {
    font-size: 15px;
    line-height: 1.6;
  }

  .bb-hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .bb-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 1536px) {
  .bb-hero h1 {
    font-size: 64px;
  }

  .bb-hero-content {
    max-width: 980px;
  }
}

/* ==============================
   CONTENT ROWS
   ============================== */
.bb-main {
  position: relative;
  z-index: 10;
  padding-bottom: 60px;
}

/* Home keeps Netflix overlap over hero; inner pages must not shift upward */
.home .bb-main {
  margin-top: -80px;
}

body:not(.home) .bb-main {
  margin-top: 0 !important;
}

.bb-row {
  margin-bottom: 40px;
}

.bb-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bb-row-header h2 {
  font-size: clamp(18px, 1.4vw, 24px);
  font-weight: 700;
  margin: 0;
}

.bb-see-all {
  background: transparent;
  border: none;
  color: var(--bb-text-muted);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--bb-transition);
}

.bb-row:hover .bb-see-all {
  opacity: 1;
}

.bb-see-all:hover {
  color: white;
}

/* Carousel */
.bb-carousel {
  position: relative;
}

.bb-carousel-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 0;
}

.bb-carousel-track::-webkit-scrollbar {
  display: none;
}

.bb-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 100%;
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(4px);
  border: none;
  color: white;
  font-size: 36px;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--bb-transition);
}

.bb-carousel:hover .bb-carousel-btn {
  opacity: 1;
}

.bb-prev {
  left: 0;
  border-radius: 0 4px 4px 0;
}

.bb-next {
  right: 0;
  border-radius: 4px 0 0 4px;
}

.bb-carousel-btn:hover {
  background: rgba(20, 20, 20, 0.9);
}

/* Cards - Netflix Exact Specifications */
.bb-card {
  flex: 0 0 auto;
  width: clamp(160px, 14vw, 240px);
  aspect-ratio: 16/9;
  border-radius: var(--bb-radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  /* Netflix card transition: 450ms with custom bezier */
  transition: transform var(--card-transition),
    box-shadow var(--bb-transition-medium),
    z-index 0s;
  transform-origin: center center;
}

/* Edge handling - left edge cards */
.bb-card:first-child {
  transform-origin: left center;
}

/* Edge handling - right edge cards */
.bb-card:last-child {
  transform-origin: right center;
}

.bb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--card-transition);
}

.bb-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  opacity: 1;
  transition: opacity var(--bb-transition-medium);
}

/* Netflix hover: 1.3x scale after implicit delay via CSS */
.bb-card:hover {
  transform: scale(var(--card-scale));
  z-index: 20;
  box-shadow: var(--bb-shadow-lg);
}

.bb-card:hover img {
  transform: scale(1.02);
}


.bb-card-title {
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Progress Card */
.bb-card-progress .bb-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.bb-card-progress .bb-progress-fill {
  height: 100%;
  background: var(--bb-red);
  width: var(--progress, 0%);
}

/* Rank Card */
.bb-card-rank::before {
  content: attr(data-rank);
  position: absolute;
  left: -20px;
  bottom: -10px;
  font-size: 100px;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 3px rgba(255, 255, 255, 0.3);
  z-index: 1;
}

/* Tall Card (Originals) */
.bb-originals .bb-card-tall {
  width: clamp(100px, 10vw, 160px);
  aspect-ratio: 2/3;
}

/* New Badge */
.bb-new-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--bb-red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 3px;
  z-index: 5;
}

/* ==============================
   FOOTER
   ============================== */
.bb-footer {
  padding: 60px 0;
  color: var(--bb-text-muted);
}

.bb-footer-social {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.bb-footer-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  transition: color var(--bb-transition);
}

.bb-footer-social a:hover {
  color: var(--bb-text-muted);
}

/* ==============================
   NETFLIX PRECISION: MEGA MENU & DROPDOWNS
   ============================== */
/* Standard Dropdown (Profile) */
.bb-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: var(--bb-bg-dark);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius);
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.5, 0, 0.1, 1);
  box-shadow: var(--bb-shadow-lg);
  z-index: 1100;
}

.bb-profile:hover .bb-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mega Menu (Live TV / Genres) - Scoped to Live TV Parent */
.bb-mega-menu-parent .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  /* "Live TV" needs to align left, but "Genres" on TV page might need right align */
  min-width: 480px;
  /* 3 columns x ~160px */
  background: rgba(0, 0, 0, 0.95);
  /* Slightly transparent specific to Netflix Reference */
  border-top: 2px solid white;
  /* The "Active" indicator border */
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* 3 column layout */
  gap: 12px 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s cubic-bezier(0.5, 0, 0.1, 1), visibility 0.2s;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  z-index: 1050;
  transform-origin: top left;
}

/* Standard Submenu for non-mega items (Movies, TV Shows if any) */
.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--bb-bg-dark);
  border: 1px solid var(--bb-border);
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
  box-shadow: var(--bb-shadow-lg);
  z-index: 1050;
}

/* Hover State for BOTH types */
.menu-item-has-children:hover>.sub-menu,
.bb-mega-menu-parent:hover>.sub-menu {
  opacity: 1;
  visibility: visible;
}

/* Mega Menu Items Styling */
.bb-mega-menu-parent .sub-menu li {
  display: block;
  width: 100%;
}

.bb-mega-menu-parent .sub-menu a {
  display: block;
  color: var(--bb-text-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  padding: 4px 0;
  transition: color 0.1s ease;
}

.bb-mega-menu-parent .sub-menu a:hover {
  color: white;
  text-decoration: underline;
}

/* "All Channels" special styling */
.bb-mega-menu-parent .sub-menu li:last-child {
  grid-column: 1 / -1;
  border-top: 1px solid var(--bb-border);
  margin-top: 12px;
  padding-top: 12px;
}

.bb-mega-menu-parent .sub-menu li:last-child a {
  font-weight: 700;
  text-align: center;
}

/* Standard Submenu Items Styling */
.sub-menu li {
  display: block;
}

.sub-menu a {
  display: block;
  padding: 8px 16px;
  color: var(--bb-text);
  font-size: 13px;
}

.sub-menu a:hover {
  background: var(--bb-surface-hover);
  color: white;
}


/* ==============================
   NETFLIX PRECISION: CARD "BOBBLE" INTERACTION
   ============================== */
/* Base card override for JS interactions */
.bb-card {
  /* Ensure z-index layering works */
  isolation: isolate;
}

/* The Expansion State (Applied by JS or Hover) */
.bb-card.is-hovered {
  z-index: 999 !important;
  transform: scale(var(--card-scale));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  transition-delay: 0s !important;
  /* Immediate expansion once delay passes */
}

/* Video Preview Container (Hidden by default) */
.bb-card-video-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  background: black;
}

.bb-card.is-hovered .bb-card-video-preview {
  opacity: 1;
}

.bb-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 24px;
}

.bb-footer-links a {
  font-size: 13px;
  transition: color var(--bb-transition);
}

.bb-footer-links a:hover {
  color: white;
}

.bb-copyright {
  margin-top: 24px;
  font-size: 12px;
}

.bb-powered {
  margin-top: 8px;
  font-size: 12px;
  color: #8c8c8c;
}

.bb-powered strong {
  color: var(--bb-red);
  font-weight: 600;
}

/* ==============================
   MOBILE DRAWER
   ============================== */
.bb-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: all var(--bb-transition);
}

.bb-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.bb-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--bb-bg-dark);
  border-left: 1px solid var(--bb-border);
  z-index: 1600;
  transform: translateX(100%);
  /* Keep closed drawer out of the a11y/interaction tree and avoid duplicate visible auth CTAs. */
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.bb-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.3s ease, visibility 0s;
}

.bb-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  font-weight: 700;
  font-size: 18px;
}

.bb-drawer-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
}

.bb-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.bb-drawer-nav a {
  padding: 14px 16px;
  border-radius: var(--bb-radius-lg);
  font-size: 15px;
  font-weight: 500;
  transition: background var(--bb-transition);
}

.bb-drawer-nav a:hover {
  background: var(--bb-surface-hover);
}

.bb-drawer-nav a.current {
  background: var(--bb-surface);
  color: white;
}

.bb-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--bb-border);
}

.bb-btn-outline {
  background: transparent;
  border: 1px solid var(--bb-border);
  color: white;
  text-align: center;
}

.bb-btn-ghost {
  background: transparent;
  border: none;
  color: var(--bb-text-muted);
  text-align: center;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
  .bb-hero {
    min-height: 70vh;
    padding-bottom: 60px;
  }

  .bb-hero-content {
    max-width: 100%;
  }

  .home .bb-main {
    margin-top: -40px;
  }

  body:not(.home) .bb-main {
    margin-top: 0 !important;
  }

  .bb-card {
    width: clamp(140px, 40vw, 180px);
  }

  .bb-originals .bb-card-tall {
    width: clamp(90px, 28vw, 120px);
  }
}

@media (max-width: 480px) {
  .bb-hero-title {
    font-size: 1.8rem;
  }

  .bb-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==============================
   NETFLIX FLUID VIDEO PLAYER
   Scales to ANY resolution
   ============================== */
.bb-player-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bb-player-modal.is-open {
  display: flex;
  opacity: 1;
}

.bb-player-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bb-player-container video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
}

/* Fullscreen mode - fill entire screen */
.bb-player-modal:-webkit-full-screen .bb-player-container video,
.bb-player-modal:fullscreen .bb-player-container video {
  object-fit: cover;
  aspect-ratio: auto;
}

.bb-player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 40px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  transition: opacity 0.3s ease;
}

.bb-player-controls.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.bb-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
}

.bb-player-back {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.bb-player-back:hover {
  opacity: 0.7;
}

.bb-player-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
}

/* ==============================
   FLUID CARD GRID SYSTEM
   Auto-adjusts to ANY viewport
   ============================== */

/* Enhanced fluid cards - uses viewport-relative sizing */
.bb-card {
  flex: 0 0 auto;
  /* Fluid width: min 140px, preferred 16vw, max 280px */
  width: clamp(140px, 16vw, 280px);
  aspect-ratio: 16 / 9;
}

/* Tall cards (Originals) - fluid sizing */
.bb-originals .bb-card-tall {
  width: clamp(100px, 12vw, 180px);
  aspect-ratio: 2 / 3;
}

/* Carousel gap scales with viewport */
.bb-carousel-track {
  gap: clamp(6px, 0.5vw, 12px);
}

/* ==============================
   HIGH RESOLUTION BREAKPOINTS
   1440p, 2K, 4K Support
   ============================== */

/* 1440p / QHD screens */
@media (min-width: 1440px) {
  .bb-container {
    max-width: 1600px;
  }

  .bb-card {
    width: clamp(180px, 15vw, 300px);
  }

  .bb-originals .bb-card-tall {
    width: clamp(120px, 11vw, 200px);
  }

  .bb-hero-title {
    font-size: clamp(3rem, 4.5vw, 4.5rem);
  }

  .bb-hero-desc {
    font-size: clamp(16px, 1.2vw, 20px);
  }

  .bb-row-header h2 {
    font-size: clamp(20px, 1.6vw, 28px);
  }
}

/* 2K / WQHD screens (2560px) */
@media (min-width: 2560px) {
  .bb-container {
    max-width: 2200px;
    padding: 0 3%;
  }

  .bb-card {
    width: clamp(220px, 14vw, 380px);
  }

  .bb-originals .bb-card-tall {
    width: clamp(150px, 10vw, 260px);
  }

  .bb-hero {
    min-height: 80vh;
  }

  .bb-hero-title {
    font-size: clamp(3.5rem, 4vw, 5.5rem);
  }

  .bb-hero-desc {
    font-size: clamp(18px, 1.1vw, 24px);
    max-width: 700px;
  }

  .bb-hero-content {
    max-width: 800px;
  }

  .bb-btn {
    padding: 16px 36px;
    font-size: 18px;
  }

  .bb-row-header h2 {
    font-size: clamp(24px, 1.5vw, 32px);
  }

  .bb-card-title {
    font-size: 16px;
  }

  .bb-carousel-btn {
    width: 70px;
    font-size: 48px;
  }
}

/* 4K / UHD screens (3840px) */
@media (min-width: 3840px) {
  .bb-container {
    max-width: 3200px;
    padding: 0 2.5%;
  }

  .bb-card {
    width: clamp(280px, 12vw, 450px);
  }

  .bb-originals .bb-card-tall {
    width: clamp(180px, 8vw, 320px);
  }

  .bb-hero-title {
    font-size: clamp(4rem, 3.5vw, 7rem);
  }

  .bb-hero-desc {
    font-size: clamp(20px, 0.9vw, 28px);
    max-width: 900px;
  }

  .bb-hero-content {
    max-width: 1000px;
  }

  .bb-btn {
    padding: 20px 48px;
    font-size: 22px;
    border-radius: 6px;
  }

  .bb-row {
    margin-bottom: 60px;
  }

  .bb-row-header h2 {
    font-size: clamp(28px, 1.2vw, 40px);
  }

  .bb-card-title {
    font-size: 20px;
  }

  .bb-carousel-btn {
    width: 90px;
    font-size: 60px;
  }

  .bb-bar {
    height: 90px;
  }

  .bb-logo-text {
    font-size: 24px;
  }

  .bb-menu li a {
    font-size: 18px;
  }
}

/* ==============================
   ULTRA-WIDE MONITOR SUPPORT
   21:9 and 32:9 Aspect Ratios
   ============================== */
@media (min-aspect-ratio: 21/9) {
  .bb-hero {
    min-height: 90vh;
  }

  .bb-hero-content {
    max-width: 40%;
  }

  .bb-container {
    padding: 0 6%;
  }
}

/* Super ultra-wide (32:9) */
@media (min-aspect-ratio: 32/9) {
  .bb-hero-content {
    max-width: 30%;
  }

  .bb-container {
    padding: 0 10%;
  }
}

/* =========================================================
   DESKTOP HEADER / ARCHIVE OVERLAP FIX (movies + tv-shows)
   ========================================================= */
:root {
  --bb-header-height: 68px;
}



@media (min-width: 3840px) {
  :root {
    --bb-header-height: 90px;
  }
}

/* WP admin bar safety in dashboard/customizer */
.admin-bar .bb-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .bb-header {
    top: 46px;
  }
}

/* Desktop only: ensure archive/page headings clear fixed header */
@media (min-width: 1025px) {

  body.archive .bb-main,
  body.post-type-archive .bb-main,
  body.page .bb-main {
    padding-top: max(100px, calc(var(--bb-header-height) + 28px)) !important;
  }

  body.archive .bb-main>.bb-container>h1,
  body.post-type-archive .bb-main>.bb-container>h1,
  body.page .bb-main>.bb-container>h1 {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}

/* Better desktop menu breathing room before mobile drawer kicks in */
@media (max-width: 1280px) and (min-width: 901px) {
  .bb-bar {
    gap: 16px;
  }

  .bb-menu {
    gap: 14px;
  }

  .bb-menu li a {
    font-size: 13px;
  }

  .bb-right {
    gap: 12px;
  }
}


/* ==========================================================
   BBMALYA v2.4.2 - ROOT-CAUSE FIX (desktop overlap + fluid)
   ========================================================== */

/* 1) Global fluid container (Netflix-like full-width behavior) */
.bb-container {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 72px);
}

/* 2) Stable header height variables */
:root {
  --bb-header-height: clamp(68px, 5.2vw, 84px);
  --bb-adminbar-height: 0px;
}

body.admin-bar {
  --bb-adminbar-height: 32px;
}

@media (max-width: 782px) {
  body.admin-bar {
    --bb-adminbar-height: 46px;
  }
}

/* 3) Fixed header + admin bar support */
.bb-header {
  position: fixed;
  top: var(--bb-adminbar-height);
  left: 0;
  right: 0;
}

.bb-bar {
  min-height: var(--bb-header-height);
  height: auto;
  gap: clamp(12px, 2vw, 24px);
}

/* Menu spacing that scales with viewport */
.bb-menu {
  gap: clamp(10px, 1.4vw, 22px);
}

.bb-menu li a {
  font-size: clamp(14px, 0.95vw, 22px);
  white-space: nowrap;
}

/* 4) ROOT CAUSE FIX:
   Old rule forced non-home .bb-main padding-top:20px !important on desktop.
   That pushed archive titles under fixed header.
*/
body:not(.home):not(.front-page) .bb-main {
  margin-top: 0 !important;
  padding-top: calc(var(--bb-header-height) + var(--bb-adminbar-height) + clamp(18px, 2vw, 36px)) !important;
}

/* 5) Archive/page headings - never collide with nav */
body.archive .bb-archive-page h1,
body.blog .bb-archive-page h1,
body.search .bb-archive-page h1,
body.page .bb-archive-page h1 {
  margin: 0 0 clamp(18px, 2vw, 28px) !important;
  padding: 0 !important;
  line-height: 1.08;
  font-size: clamp(36px, 4.2vw, 72px);
  letter-spacing: -0.02em;
}

/* 6) Home keeps billboard overlap effect only on home */
body.home .bb-main,
body.front-page .bb-main {
  margin-top: clamp(-88px, -6vw, -56px);
  padding-top: 0;
}

/* 7) True fluid card scaling across resolutions */
.bb-card {
  width: clamp(150px, 11.5vw, 320px);
}

.bb-originals .bb-card-tall {
  width: clamp(96px, 8vw, 190px);
}

/* 8) Wider desktop and 4K spacing */
@media (min-width: 1440px) {
  .bb-row {
    margin-bottom: 48px;
  }

  .bb-row-header h2 {
    font-size: clamp(22px, 1.45vw, 36px);
  }

  .bb-carousel-track {
    gap: 10px;
  }
}

@media (min-width: 2560px) {
  .bb-container {
    padding-inline: clamp(28px, 4.4vw, 120px);
  }

  .bb-hero-title {
    font-size: clamp(64px, 4.2vw, 104px);
  }

  .bb-card {
    width: clamp(220px, 11vw, 420px);
  }

  .bb-originals .bb-card-tall {
    width: clamp(140px, 8vw, 250px);
  }
}

/* 9) Tablet/mobile: no overlap, compact header */
@media (max-width: 900px) {
  :root {
    --bb-header-height: 64px;
  }

  body:not(.home):not(.front-page) .bb-main {
    padding-top: calc(var(--bb-header-height) + var(--bb-adminbar-height) + 10px) !important;
  }

  .bb-menu li a {
    font-size: 14px;
  }
}


/* =============================================
   PRECISION PACK v2.5 (Netflix fluid desktop)
   ============================================= */

:root {
  --bb-header-height: 84px;
  /* JS overwrites with exact runtime value */
  --bb-container-pad-x: clamp(20px, 4vw, 64px);
  --bb-title-size: clamp(42px, 3.6vw, 64px);
}

html,
body {
  min-height: 100%;
}

/* Keep footer pinned lower on short-content pages */
main.bb-main {
  min-height: calc(100vh - var(--bb-header-height) - 220px);
}

/* Exact non-home offset based on live header height */
body:not(.home):not(.front-page) .bb-main {
  margin-top: 0 !important;
  padding-top: calc(var(--bb-header-height) + clamp(18px, 2vh, 30px)) !important;
}

/* Container rhythm similar to Netflix */
.bb-container {
  max-width: 1920px;
  padding-left: var(--bb-container-pad-x);
  padding-right: var(--bb-container-pad-x);
}

/* Desktop nav spacing scales with viewport */
@media (min-width: 1025px) {
  .bb-bar {
    height: clamp(64px, 3.8vw, 74px);
    gap: clamp(14px, 1.4vw, 28px);
  }

  .bb-logo-img {
    height: clamp(34px, 2.1vw, 42px);
  }

  .bb-menu {
    gap: clamp(14px, 1.2vw, 24px);
  }

  .bb-menu li a {
    font-size: clamp(14px, 0.86vw, 16px);
  }

  .bb-right {
    gap: clamp(10px, 1vw, 18px);
  }

  .bb-icon-btn {
    width: clamp(34px, 2.2vw, 40px);
    height: clamp(34px, 2.2vw, 40px);
  }

  .bb-page-title,
  .bb-main h1 {
    font-size: var(--bb-title-size);
    line-height: 1.08;
    letter-spacing: -0.02em;
  }
}

/* Archive/index typography cleanup */
.bb-page-header {
  margin-bottom: clamp(28px, 3vw, 44px);
}

.bb-page-title {
  margin: 0;
  font-weight: 800;
}

.bb-empty-text {
  color: var(--bb-text-muted);
  font-size: clamp(24px, 2vw, 32px);
}

.bb-post-card {
  margin-bottom: 30px;
  padding: clamp(22px, 2vw, 32px);
  background: var(--bb-surface);
  border-radius: var(--bb-radius-lg);
}

.bb-page-header--split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(28px, 3vw, 44px);
}

.bb-page-title--section {
  font-size: clamp(36px, 3vw, 48px);
  font-weight: 800;
}

.bb-genre-select {
  background: var(--bb-surface);
  border: 1px solid var(--bb-border);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--bb-radius);
  font-size: 14px;
  cursor: pointer;
}

/* Card rhythm across 1080p to 4K */
.bb-carousel-track {
  gap: clamp(6px, 0.5vw, 12px);
}

.bb-card {
  width: clamp(170px, 13.2vw, 280px);
}

@media (min-width: 1600px) {
  .bb-card {
    width: clamp(190px, 12.5vw, 300px);
  }
}

@media (min-width: 2400px) {
  .bb-card {
    width: clamp(210px, 10.4vw, 340px);
  }

  .bb-row {
    margin-bottom: clamp(42px, 3.2vh, 56px);
  }
}

/* Prevent accidental header/text collisions on all archive-like pages */
body:not(.home):not(.front-page) .bb-main .bb-page-header,
body:not(.home):not(.front-page) .bb-main>h1,
body:not(.home):not(.front-page) .bb-main>.page-header {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Tablet/mobile stay untouched */
@media (max-width: 1024px) {
  body:not(.home):not(.front-page) .bb-main {
    padding-top: calc(var(--bb-header-height) + 10px) !important;
  }

  .bb-page-header--split {
    flex-wrap: wrap;
  }
}


/* Index/archive component precision helpers */
.bb-grid--index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(14px, 1.3vw, 24px);
}

.bb-card--index {
  aspect-ratio: 16/9;
}

.bb-card-overlay--always {
  opacity: 1;
}

.bb-pagination-wrap {
  margin-top: clamp(28px, 3vh, 44px);
}


/* =========================================================
   v3.1.0 PROCEED PATCH
   Root-cause fix: archive pages were falling back to index.php,
   which caused empty/unstyled /movies archive states.
   This patch standardizes archive layout + responsive behavior.
   ========================================================= */

/* Header mode classes injected by JS */
.bb-header.bb-header--compact .bb-menu,
.bb-header.bb-fit-compact .bb-menu {
  gap: 14px;
}

.bb-header.bb-header--compact .bb-menu>li>a,
.bb-header.bb-fit-compact .bb-menu>li>a {
  font-size: 14px;
}

.bb-header.bb-header--compact .bb-right,
.bb-header.bb-fit-compact .bb-right {
  gap: 10px;
}

.bb-header.bb-header--ultra .bb-logo-text,
.bb-header.bb-fit-ultra .bb-logo-text {
  display: none;
}

.bb-header.bb-header--ultra .bb-menu,
.bb-header.bb-fit-ultra .bb-menu {
  gap: 10px;
}

.bb-header.bb-header--ultra .bb-menu>li>a,
.bb-header.bb-fit-ultra .bb-menu>li>a {
  font-size: 13px;
}

.bb-header.bb-header--ultra .bb-right,
.bb-header.bb-fit-ultra .bb-right {
  gap: 8px;
}

.bb-header.bb-header--ultra .bb-signin,
.bb-header.bb-fit-ultra .bb-signin {
  padding: 8px 14px;
}

/* Archive top row (title left / controls right) */
.bb-archive-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0 22px;
}

.bb-archive-title {
  margin: 0;
  font-size: clamp(44px, 5vw, 72px);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
}

.bb-archive-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bb-genre-select {
  min-width: 184px;
  height: 48px;
  border: 1px solid #2d2d2d;
  border-radius: 8px;
  background: #151515;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  padding: 0 42px 0 16px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #9ca3af 50%),
    linear-gradient(135deg, #9ca3af 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.bb-genre-select:focus {
  outline: none;
  border-color: #6b7280;
}

/* Archive content spacing */
.bb-main--archive {
  padding-bottom: 70px;
}

.bb-main--archive .bb-row {
  margin-bottom: 46px;
}

.bb-main--archive .bb-row:first-of-type {
  margin-top: 10px;
}

/* Cards grid for "All Movies/Shows" */
.bb-grid--archive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.bb-grid--archive .bb-card {
  width: 100%;
}

/* Empty archive state */
.bb-empty-state {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.03);
}

.bb-empty-state h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.06;
}

.bb-empty-state p {
  margin: 0;
  color: #9ca3af;
  font-size: 18px;
}

.bb-card.is-placeholder {
  filter: saturate(0.7) brightness(0.9);
}

.bb-card.is-placeholder .bb-card-title {
  font-weight: 600;
}

/* Archive pagination */
.bb-pagination {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bb-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 700;
  color: #e5e5e5;
  background: #1c1c1c;
  border: 1px solid #2f2f2f;
}

.bb-pagination .page-numbers.current {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
}

.bb-pagination .page-numbers:hover {
  background: #2a2a2a;
  color: #fff;
}

/* Keep non-home pages below header using dynamic runtime var */
body:not(.home):not(.page-template-page-login):not(.page-template-page-register) main,
body:not(.home):not(.page-template-page-login):not(.page-template-page-register) #content,
body:not(.home):not(.page-template-page-login):not(.page-template-page-register) .site-content {
  padding-top: var(--bb-header-height, 84px);
}

@media (max-width: 1100px) {
  .bb-grid--archive {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .bb-archive-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .bb-archive-controls {
    margin-left: 0;
  }

  .bb-archive-title {
    font-size: clamp(36px, 9vw, 56px);
  }

  .bb-genre-select {
    min-width: 170px;
    height: 44px;
    font-size: 16px;
  }

  .bb-grid--archive {
    gap: 12px;
  }
}

@media (min-width: 2000px) {
  .bb-grid--archive {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
  }

  .bb-archive-title {
    font-size: clamp(56px, 4.2vw, 88px);
  }
}


/* Precision carousel controls for sparse rows */
.bb-carousel-btn[disabled],
.bb-carousel-btn[aria-disabled="true"] {
  opacity: 0.28;
  pointer-events: none;
}

.bb-card-placeholder {
  cursor: default;
}

.bb-card-placeholder .bb-card-overlay {
  opacity: 0.72;
}


/* === BBMALYA 3.2.1 HOTFIX PACK === */
/* Root-cause fixes: header overlap, admin bar offset, smart row actions */

/* 1) WordPress admin bar + fixed header alignment */
.admin-bar .bb-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .bb-header {
    top: 46px;
  }
}

/* 2) Desktop-only overlap fix for internal pages
   Root cause: .bb-main has negative margin intended for home hero
*/
@media (min-width: 1025px) {
  body:not(.home) .bb-main {
    margin-top: 0 !important;
    padding-top: calc(var(--header-height, 68px) + 24px) !important;
  }

  /* Keep page headers clear below fixed nav */
  body:not(.home) .bb-page-hero,
  body:not(.home) .bb-page-header,
  body:not(.home) .page-header {
    margin-top: 0 !important;
  }
}

/* 3) Menu spacing + no text collision on desktop */
@media (min-width: 1025px) {
  .bb-bar {
    gap: clamp(16px, 1.6vw, 28px);
  }

  .bb-nav {
    min-width: 0;
  }

  .bb-menu {
    gap: clamp(12px, 1.2vw, 20px);
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .bb-menu li a {
    font-size: clamp(13px, 0.85vw, 15px);
    white-space: nowrap;
  }
}

/* 4) Explore all should be visible (not hover-only) */
.bb-see-all {
  opacity: 0.9 !important;
}

.bb-row:hover .bb-see-all,
.bb-see-all:hover {
  opacity: 1 !important;
}

/* 5) Carousels with 0/1 items: arrows hidden by JS class */
.bb-carousel.bb-no-overflow .bb-carousel-btn {
  display: none !important;
}

/* 6) Utility form pages (forgot/help) visual polish */
.bb-util-wrap {
  width: min(640px, 92%);
  margin: 0 auto;
  padding: calc(var(--header-height, 68px) + 36px) 0 60px;
}

.bb-util-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.bb-util-card h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
}

.bb-util-card p {
  color: rgba(229, 229, 229, .82);
  margin-bottom: 14px;
}

.bb-util-field {
  margin-bottom: 14px;
}

.bb-util-field label {
  display: block;
  margin-bottom: 6px;
  color: #fff;
}

.bb-util-field input,
.bb-util-field textarea {
  width: 100%;
  background: #0f0f0f;
  border: 1px solid #333;
  color: #fff;
  border-radius: 8px;
  padding: 11px 12px;
}

.bb-util-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.bb-util-note {
  font-size: 13px;
  color: rgba(229, 229, 229, .68);
}

.bb-alert {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.bb-alert--ok {
  background: rgba(70, 211, 105, .12);
  border: 1px solid rgba(70, 211, 105, .45);
  color: #b7f6c7;
}

.bb-alert--err {
  background: rgba(229, 9, 20, .14);
  border: 1px solid rgba(229, 9, 20, .45);
  color: #ffd2d4;
}


/* 7) Header CTA + user dropdown normalization */
.bb-header-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bb-btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1;
  border-radius: 8px;
}

.bb-btn-primary {
  background: var(--bb-red);
  color: #fff;
  border: 1px solid transparent;
}

.bb-btn-primary:hover {
  background: var(--bb-red-hover);
}

.bb-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
}

.bb-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.bb-help-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
}

.bb-user-menu {
  position: relative;
}

.bb-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  border-radius: 10px;
  padding: 6px 10px;
}

.bb-avatar {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--bb-red), #ff4b56);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.bb-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 8px;
  display: none;
  z-index: 2000;
}

.bb-user-menu:hover .bb-user-dropdown,
.bb-user-menu:focus-within .bb-user-dropdown {
  display: block;
}

.bb-user-dropdown a,
.bb-user-dropdown button {
  width: 100%;
  display: block;
  text-align: left;
  color: #e5e5e5;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.bb-user-dropdown a:hover,
.bb-user-dropdown button:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.bb-user-dropdown hr {
  border: 0;
  border-top: 1px solid #2b2b2b;
  margin: 8px 0;
}

@media (max-width: 980px) {
  .bb-header-cta.bb-guest-actions {
    display: none;
  }
}

/* ==========================================================================
   v3.2.3 ADMINBAR + ROUTE OVERLAP FIX (final authority)
   Purpose: prevent title/content overlap under fixed header on all routes,
   especially logged-in/admin-bar states and pricing/help/auth pages.
   ========================================================================== */
:root {
  --bb-adminbar-height: 0px;
}

/* WordPress admin bar height (desktop/mobile) */
body.admin-bar {
  --bb-adminbar-height: 32px;
}

@media (max-width: 782px) {
  body.admin-bar {
    --bb-adminbar-height: 46px;
  }
}

/* Keep fixed site header below WP admin bar */
.admin-bar .bb-header {
  top: var(--bb-adminbar-height) !important;
}

/* Universal non-home route offset:
   Uses JS-computed --bb-header-offset when available, with CSS fallback. */
body:not(.home):not(.front-page) .bb-main,
body.archive .bb-main,
body.search .bb-main,
body.error404 .bb-main {
  padding-top: max(calc(var(--bb-header-offset, 108px) + 8px),
      calc(var(--bb-header-height, 68px) + var(--bb-adminbar-height, 0px) + 24px)) !important;
  margin-top: 0 !important;
}

/* Auth pages need slightly tighter top alignment */
.page-template-page-login .bb-main,
.page-template-page-register .bb-main,
.page-template-page-forgot-password .bb-main {
  padding-top: max(calc(var(--bb-header-offset, 108px) - 12px),
      calc(var(--bb-header-height, 68px) + var(--bb-adminbar-height, 0px) + 10px)) !important;
}

/* Ensure first heading blocks do not push into fixed header region */
body.page .entry-header,
body.archive .page-header,
body.search .page-header {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.page .entry-title:first-child,
body.archive h1.page-title:first-child,
body.search h1.page-title:first-child,
.bb-main .entry-content>h1:first-child,
.bb-main .entry-content>h2:first-child {
  margin-top: 0 !important;
}

/* Better in-page anchor positioning below fixed header */
.bb-main [id] {
  scroll-margin-top: calc(var(--bb-header-offset, 108px) + 12px);
}


/* ============================================================
   PRECISION PATCH: Universal fixed-header clearance (admin bar + all templates)
   Root cause: some templates/pages don't use .bb-main so padding-top didn't apply,
   causing page titles/content to slide under the fixed header (and WP admin bar).
   This block standardizes header top offset and content clearance.
   ============================================================ */
:root {
  --bb-adminbar-height: 0px;
}

body.admin-bar {
  --bb-adminbar-height: 32px;
}

@media (max-width: 782px) {
  body.admin-bar {
    --bb-adminbar-height: 46px;
  }
}

/* Ensure header sits below admin bar (logged-in) */
.bb-header {
  top: var(--bb-adminbar-height) !important;
}

/* Ensure all non-home content clears the fixed header */
body:not(.home):not(.front-page) .bb-main,
body:not(.home):not(.front-page) #primary,
body:not(.home):not(.front-page) .site-main,
body:not(.home):not(.front-page) .site-content {
  padding-top: max(100px, calc(var(--bb-header-height) + var(--bb-adminbar-height) + 28px)) !important;
}

/* ======================================================
   v3.5.1 Nav Intent Hardening (desktop + touch + drawer)
   ====================================================== */
.bb-nav .bb-menu > .menu-item-has-children {
  position: relative;
}

.bb-nav .bb-menu > .menu-item-has-children > .sub-menu {
  display: block;               /* keep in flow for transition */
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  padding: 10px 0;
  margin: 0;
  background: rgba(15, 15, 15, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  z-index: 9999;
}

.bb-nav .bb-menu > .menu-item-has-children:hover > .sub-menu,
.bb-nav .bb-menu > .menu-item-has-children.is-open > .sub-menu,
.bb-nav .bb-menu > .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.bb-nav .bb-menu > .menu-item-has-children > .sub-menu > li > a {
  display: block;
  padding: 10px 14px;
  color: #f3f4f6;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
}

.bb-nav .bb-menu > .menu-item-has-children > .sub-menu > li > a:hover,
.bb-nav .bb-menu > .menu-item-has-children > .sub-menu > li > a:focus-visible {
  background: rgba(229, 9, 20, 0.22);
  color: #fff;
}

/* remove desktop click-trap look for true hub parent links */
.bb-nav .bb-menu > .menu-item-has-children > a {
  cursor: pointer;
}

/* Drawer submenu behavior */
.bb-drawer-menu .menu-item-has-children > .sub-menu {
  display: none;
  margin-top: 8px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.bb-drawer-menu .menu-item-has-children.is-open > .sub-menu {
  display: block;
}
.bb-drawer-menu .menu-item-has-children > a[aria-expanded="true"] {
  color: #fff;
}

/* Prevent header/admin-bar overlap edge cases */
body.admin-bar .bb-site-header {
  top: var(--wp-admin--admin-bar--height, 32px);
}
@media (max-width: 782px) {
  body.admin-bar .bb-site-header {
    top: 46px;
  }
}


/* ===== Live TV Watch: YouTube-style layout ===== */
.bbm-watch-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:20px;
  align-items:start;
}

.bbm-watch-main{
  min-width:0;
}

.bbm-player-shell{
  width:100%;
  max-width:920px;              /* smaller than full-width */
  margin:0 auto;
  border-radius:14px;
  overflow:hidden;
  background:#000;
  border:1px solid rgba(255,255,255,.10);
}

.bbm-player-shell:not(.bbm-player-is-fullscreen) iframe,
.bbm-player-shell:not(.bbm-player-is-fullscreen) video{
  width:100%;
  aspect-ratio:16/9;
  height:auto;
  max-height:62vh;
  display:block;
}

/* In fullscreen, remove theme height caps so player CSS can size to viewport. */
.bbm-player-shell.bbm-player-is-fullscreen iframe,
.bbm-player-shell.bbm-player-is-fullscreen video{
  max-height:none !important;
  height:100% !important;
}

.bbm-watch-title{
  margin:12px 0 4px;
  font-size:24px;
  line-height:1.2;
}
.bbm-watch-meta{
  margin:0;
  color:#a1a1aa;
  font-size:13px;
}

.bbm-watch-side{
  position:sticky;
  top:calc(var(--bb-header-height,72px) + var(--bbm-adminbar-h,0px) + 10px);
  max-height:calc(100vh - 120px);
  overflow:auto;
  padding-right:2px;
}

.bbm-watch-side-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.bbm-watch-side-head h2{
  margin:0;
  font-size:16px;
}
.bbm-watch-side-head a{
  font-size:12px;
  color:#cbd5e1;
  text-decoration:none;
}

.bbm-watch-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.bbm-watch-item{
  display:grid;
  grid-template-columns:140px minmax(0,1fr);
  gap:10px;
  text-decoration:none;
  color:#fff;
  border:1px solid rgba(255,255,255,.10);
  border-radius:10px;
  overflow:hidden;
  background:#121212;
}
.bbm-watch-item-thumb{
  display:block;
  background:#1b1b1b;
}
.bbm-watch-item-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  aspect-ratio:16/9;
}
.bbm-watch-item-body{
  min-width:0;
  padding:8px 10px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.bbm-watch-item-title{
  font-size:13px;
  font-weight:700;
  line-height:1.3;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.bbm-watch-item-meta{
  margin-top:4px;
  font-size:12px;
  color:#a1a1aa;
}

/* Tablet/mobile */
@media (max-width: 1100px){
  .bbm-watch-layout{
    grid-template-columns:1fr;
  }
  .bbm-watch-side{
    position:static;
    max-height:none;
    overflow:visible;
  }
  .bbm-watch-item{
    grid-template-columns:120px minmax(0,1fr);
  }
}
@media (max-width: 640px){
  .bbm-player-shell{ max-width:100%; border-radius:10px; }
  .bbm-watch-title{ font-size:20px; }
}


/* ===== BBM Live TV Watch Professional Responsive Layout ===== */
.bbm-watch-page {
  padding-top: calc(var(--bb-header-height, 72px) + var(--bbm-adminbar-h, 0px) + 12px);
}

.bbm-watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 28vw, 380px);
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
}

.bbm-watch-main,
.bbm-watch-side {
  min-width: 0;
}

.bbm-player-shell {
  width: min(100%, 960px);
}

.bbm-player-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.bbm-player-viewport iframe,
.bbm-player-viewport video {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.bbm-watch-side {
  position: sticky;
  top: calc(var(--bb-header-height, 72px) + var(--bbm-adminbar-h, 0px) + 12px);
  max-height: calc(100dvh - (var(--bb-header-height, 72px) + var(--bbm-adminbar-h, 0px) + 24px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}

.bbm-rel-list {
  display: grid;
  gap: 8px;
}

.bbm-rel-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  padding: 6px;
}

.bbm-rel-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.bbm-rel-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #101010;
}

.bbm-rel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Keep 2-col on normal laptops */
@media (max-width: 1279px) {
  .bbm-watch-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

/* Mobile/tablet: stack */
@media (max-width: 1023px) {
  .bbm-watch-layout {
    grid-template-columns: 1fr;
  }

  .bbm-watch-side {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }

  .bbm-rel-item {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

/* Admin bar height hint (prevents overlap when sticky) */
body.admin-bar { --bbm-adminbar-h: 32px; }
@media (max-width: 782px){
  body.admin-bar { --bbm-adminbar-h: 46px; }
}

/* WATCH_LAYOUT_V3: Pro YouTube-like watch page refinements (no nested scroll, no overlap) */
.bbm-watch-page {
  /* Always clear fixed header + admin bar, even on reduced-height viewports. */
  padding-top: calc(var(--bb-header-height, 72px) + var(--bb-adminbar-height, 0px) + 16px);
}

.bbm-watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 380px);
  gap: 24px;
  align-items: start;
}

.bbm-watch-main,
.bbm-watch-side {
  min-width: 0;
}

.bbm-player-shell {
  width: 100%;
  max-width: min(980px, 100%);
  margin: 0;
}

.bbm-player-viewport {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.bbm-player-viewport iframe,
.bbm-player-viewport video {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* Remove nested scrollbars: sidebar should follow normal page scroll */
.bbm-watch-side,
.bbm-rel-list {
  position: static !important;
  top: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.bbm-watch-side {
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.bbm-watch-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.bbm-watch-side-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.bbm-watch-side-head a {
  font-size: 12px;
  color: rgba(203, 213, 225, 0.92);
  text-decoration: none;
}

.bbm-rel-list {
  display: grid;
  gap: 10px;
}

.bbm-rel-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  padding: 8px;
}

.bbm-rel-item:hover,
.bbm-rel-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.bbm-rel-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #101010;
}

.bbm-rel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bbm-rel-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.bbm-rel-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.bbm-rel-sub {
  font-size: 12px;
  color: rgba(161, 161, 170, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1023px) {
  .bbm-watch-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .bbm-watch-side {
    margin-top: 4px;
  }

  .bbm-rel-item {
    grid-template-columns: 140px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .bbm-rel-item {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

/* =========================================================
   BBMALYA HEADER BEHAVIOR V5 (ALL PAGES, INCLUDING HOME)
   - Transparent at top on every page
   - On scroll: tiny/narrow subtle line near logo (no wide rectangle)
   - On watch while video plays: hide accent/tint

   Note: Keep header positioning fixed (theme relies on fixed header offsets).
   ========================================================= */

:root{
  --bbm-logo-line-width: clamp(86px, 9.2vw, 138px);
  --bbm-logo-line-left: clamp(14px, 2vw, 30px);
}

/* 1) Base header state (ALL pages): transparent */
:is(.bb-header, .bbm-header, .site-header, .bbm-site-header){
  position: fixed !important;
  top: var(--bb-adminbar-height, 0px) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Kill wrapper-level shadow/strip sources */
:is(.bb-header-wrap, .bbm-header-wrap, .bb-nav-wrap, .bbm-nav-wrap){
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
}

/* remove legacy pseudo overlays that create rectangle bars */
:is(.bb-header, .bbm-header, .site-header, .bbm-site-header)::before{
  content: none !important;
  display: none !important;
}

/* top (not scrolled): absolutely no underline */
:is(.bb-header, .bbm-header, .site-header, .bbm-site-header):not(.is-scrolled)::after{
  content: none !important;
  display: none !important;
}

/* 2) Scrolled state: very subtle tint + tiny narrow line near logo */
:is(.bb-header, .bbm-header, .site-header, .bbm-site-header).is-scrolled{
  background: rgba(8, 12, 22, 0.16) !important; /* subtle, not blocky */
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(3px) saturate(104%) !important;
  backdrop-filter: blur(3px) saturate(104%) !important;
}

:is(.bb-header, .bbm-header, .site-header, .bbm-site-header).is-scrolled::after{
  content: "";
  position: absolute;
  left: var(--bbm-logo-line-left);
  bottom: 0;
  width: var(--bbm-logo-line-width);
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.40) 0%,
    rgba(255,255,255,0.18) 58%,
    rgba(255,255,255,0.00) 100%
  );
  pointer-events: none;
}

/* 3) Watch page playback mode: hide tint/line fully */
body.bb-watch-playing :is(.bb-header, .bbm-header, .site-header, .bbm-site-header),
body.bb-watch-playing :is(.bb-header-wrap, .bbm-header-wrap, .bb-nav-wrap, .bbm-nav-wrap){
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.bb-watch-playing :is(.bb-header, .bbm-header, .site-header, .bbm-site-header)::after{
  content: none !important;
  display: none !important;
}

/* 4) Force-disable helper shadow classes */
:is(.bbm-header-shadow, .header-shadow, .nav-shadow){
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* BBMALYA_HEADER_NETFLIX_SCROLL v1 */
body:not(.bb-watch-playing) :is(#bbHeader.bb-header, .bb-header, .bbm-header, .site-header, .bbm-site-header) {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transition: background-color .28s ease, box-shadow .28s ease !important;
}

body:not(.bb-watch-playing) :is(#bbHeader.bb-header, .bb-header, .bbm-header, .site-header, .bbm-site-header):not(.is-scrolled)::before,
body:not(.bb-watch-playing) :is(#bbHeader.bb-header, .bb-header, .bbm-header, .site-header, .bbm-site-header):not(.is-scrolled)::after,
body:not(.bb-watch-playing) :is(#bbHeader.bb-header, .bb-header, .bbm-header, .site-header, .bbm-site-header).is-scrolled::before,
body:not(.bb-watch-playing) :is(#bbHeader.bb-header, .bb-header, .bbm-header, .site-header, .bbm-site-header).is-scrolled::after {
  content: none !important;
  display: none !important;
}

body:not(.bb-watch-playing) :is(#bbHeader.bb-header, .bb-header, .bbm-header, .site-header, .bbm-site-header).is-scrolled {
  background: rgba(10, 10, 12, 0.96) !important;
  background-image: none !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ===== Live TV filter contrast fix (dropdown/options) ===== */
.bbm-ltve-filters select,
.bbm-ltve-filters input[type="search"],
.bbm-ltve-filters input[type="text"]{
  color-scheme: dark;
  background-color: #0b1220 !important;
  color: #eef3ff !important;
  border: 1px solid rgba(255,255,255,.16) !important;
}

.bbm-ltve-filters select:focus,
.bbm-ltve-filters input[type="search"]:focus,
.bbm-ltve-filters input[type="text"]:focus{
  outline: none;
  border-color: rgba(255,255,255,.35) !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,.10);
}

.bbm-ltve-filters select option,
.bbm-ltve-filters select optgroup{
  background-color: #0b1220 !important;
  color: #eef3ff !important;
}

.bbm-ltve-filters input::placeholder{
  color: #9aa7c7 !important;
  opacity: 1;
}

@media (max-width: 820px){
  .bbm-ltve-filters select,
  .bbm-ltve-filters input[type="search"]{
    min-height: 44px;
    font-size: 16px; /* avoid iOS zoom */
  }
}

/* =========================================================
   LIVE TV COMPREHENSIVE V1 (Theme presentation only)
   ========================================================= */

/* ===== Live TV: Country Badge ===== */
.bb-card{
  position: relative;
}

.bbm-badge-country{
  position: absolute;
  top: 36px;
  right: 10px;
  left: auto;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  color: #f8fafc;
  background: rgba(2,6,23,.82);
  border: 1px solid rgba(148,163,184,.55);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  pointer-events: none;
}

.bbm-ltve-hero{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: stretch;
  margin: 14px 0 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: radial-gradient(1200px 420px at 20% 0%, rgba(255,0,64,.14), rgba(0,0,0,0) 55%),
              rgba(255,255,255,.02);
  overflow: hidden;
}

.bbm-ltve-hero-media{
  border-radius: 14px;
  overflow: hidden;
  background: #0b0b0b;
  border: 1px solid rgba(255,255,255,.10);
  aspect-ratio: 16 / 9;
}
.bbm-ltve-hero-media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.bbm-ltve-hero-body{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap: 10px;
}

.bbm-ltve-hero-kicker{
  display:flex;
  gap:10px;
  align-items:center;
  color:#cbd5e1;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.bbm-live-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,0,64,.18);
  border: 1px solid rgba(255,0,64,.35);
  color: #fff;
  font-weight: 800;
}
.bbm-ltve-hero-title{
  margin:0;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.12;
}
.bbm-ltve-hero-meta{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  color:#a1a1aa;
  font-size: 13px;
}
.bbm-ltve-hero-meta span{
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
}
.bbm-ltve-hero-actions{
  margin-top: 4px;
}
.bbm-ltve-hero-watch{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  color:#000;
  font-weight: 800;
  text-decoration:none;
}
.bbm-ltve-hero-watch:hover{
  filter: brightness(.96);
}

/* Sticky discovery filters */
.bbm-ltve-filters{
  position: sticky;
  top: calc(var(--bb-adminbar-height, 0px) + var(--bb-header-height, 72px) + 10px);
  z-index: 20;
  display:flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 18px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(8, 12, 22, 0.35);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
  backdrop-filter: blur(8px) saturate(110%);
}
.bbm-ltve-filters-left,
.bbm-ltve-filters-right{
  display:flex;
  align-items:flex-end;
  gap: 10px;
  min-width: 0;
}
.bbm-ltve-filter,
.bbm-ltve-search,
.bbm-ltve-tier{
  display:flex;
  flex-direction:column;
  gap: 6px;
  min-width: 0;
}
.bbm-ltve-filter span,
.bbm-ltve-search span,
.bbm-ltve-tier span{
  color:#a1a1aa;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.bbm-ltve-filter select,
.bbm-ltve-search input{
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  color:#fff;
  padding: 0 10px;
  outline: none;
}
.bbm-ltve-search input{
  width: min(320px, 40vw);
}
.bbm-ltve-tier strong{
  height: 36px;
  display:flex;
  align-items:center;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  color:#e5e7eb;
  font-size: 13px;
}
.bbm-ltve-apply{
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.92);
  color:#000;
  font-weight: 800;
}
.bbm-ltve-clear{
  height: 36px;
  display:inline-flex;
  align-items:center;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  color:#e5e7eb;
  text-decoration:none;
  background: rgba(0,0,0,.20);
}

.bbm-ltve-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-left: 8px;
  min-width: 24px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  color:#e5e7eb;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
}

.bbm-ltve-trust{
  margin: 18px 0 30px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}
.bbm-ltve-trust-inner{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.bbm-ltve-trust-item strong{
  display:block;
  font-size: 13px;
  margin-bottom: 3px;
}
.bbm-ltve-trust-item span{
  display:block;
  color:#a1a1aa;
  font-size: 13px;
}
.bbm-ltve-trust a{
  color:#e5e7eb;
}
.bbm-ltve-faq{
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 10px;
}
.bbm-ltve-faq summary{
  cursor: pointer;
  color:#e5e7eb;
  font-weight: 700;
}
.bbm-ltve-faq-body{
  color:#a1a1aa;
  font-size: 13px;
  margin-top: 8px;
}

@media (max-width: 980px){
  .bbm-ltve-hero{
    grid-template-columns: 1fr;
  }
  .bbm-ltve-filters{
    flex-direction: column;
    align-items: stretch;
  }
  .bbm-ltve-filters-left,
  .bbm-ltve-filters-right{
    flex-wrap: wrap;
    align-items: flex-end;
  }
  .bbm-ltve-search input{
    width: 100%;
  }
  .bbm-ltve-trust-inner{
    grid-template-columns: 1fr;
  }
}

/* Lightweight skeleton backdrop for Live TV thumbnails (no JS required) */
.bbm-ltve-main .bb-card{
  background: rgba(255,255,255,.03);
}
.bbm-ltve-main .bb-card img{
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.10), rgba(255,255,255,.04));
}

/* BBMALYA_PRO_DARK_BG v1 */
/* Premium near-black base + subtle gradients + lifted surfaces (CSS-only) */
:root{
  --bb-bg-0:#0B0D10;            /* base near-black */
  --bb-bg-1:#0F131A;            /* slightly lifted */
  --bb-surface:rgba(255,255,255,.035);
  --bb-surface-2:rgba(255,255,255,.055);
  --bb-border:rgba(255,255,255,.08);
  --bb-border-2:rgba(255,255,255,.12);
  --bb-text:rgba(243,244,246,.94);
  --bb-muted:rgba(243,244,246,.68);
}

html, body{
  background:
    radial-gradient(1200px 700px at 18% 0%, rgba(229,9,20,.08), rgba(0,0,0,0) 60%),
    radial-gradient(900px 600px at 85% 15%, rgba(255,255,255,.05), rgba(0,0,0,0) 65%),
    linear-gradient(180deg, var(--bb-bg-1) 0%, var(--bb-bg-0) 55%, #07080B 100%);
  color: var(--bb-text);
}

/* Ensure wrappers don?t paint a flat black box on top */
#page, .site, main{
  background: transparent;
}

/* Lift common UI surfaces slightly (safe selectors) */
.bbm-filter, .bbm-filters, .bbm-filterbar, .bbm-filter-bar, .bbm-controls, .bbm-toolbar{
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border: 1px solid var(--bb-border);
  border-radius: 14px;
}

/* Lift rails/rows containers if present */
.bbm-rail, .bbm-row, .bbm-section, .bbm-hub{
  background: transparent;
}

/* Cards: subtle edge + surface (your cards already use .bb-card) */
.bb-card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
}
.bb-card:hover{
  border-color: rgba(255,255,255,.14);
}

/* Text helpers if theme uses muted classes */
.muted, .text-muted{
  color: var(--bb-muted);
}




/* BBMALYA_COMPACT_TILES v1 */
body.bbm-compact-tiles .bb-card{
  aspect-ratio: auto !important;
  height: 54px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: none;
}
body.bbm-compact-tiles .bb-card img{
  display:none !important;
}
body.bbm-compact-tiles .bbm-compact-name{
  color: rgba(243,244,246,.94);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .02em;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.bbm-compact-tiles .bbm-compact-meta{
  margin-left: auto;
  font-weight: 700;
  font-size: 12px;
  color: rgba(148,163,184,.95);
}

/* Make row containers wrap into grid-like layout while searching */
body.bbm-compact-tiles .bbm-row,
body.bbm-compact-tiles .bbm-rail,
body.bbm-compact-tiles .bbm-row-inner,
body.bbm-compact-tiles .bbm-rail-inner{
  display:flex !important;
  flex-wrap: wrap !important;
  gap: 10px;
  overflow: visible !important;
}

/* If your row wrapper uses horizontal scrolling container class, keep it non-scroll in compact mode */
body.bbm-compact-tiles .bbm-row *{
  scroll-snap-type: none !important;
}


/* BBMALYA_CHANNEL_COUNT_PILL v1 */
.bbm-count-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-left: 10px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(243,244,246,.80);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}
.bbm-count-pill b{ color: rgba(243,244,246,.95); }


/* BBMALYA_BADGE_VISIBILITY v1 ? hide health+live, keep country */
body.page-id-683 .bbm-health-badge,
body.page-id-683 .bbm-health-pill,
body.page-id-683 .bbm-health,
body.page-id-683 .bbm-badge-health{
  display:none !important;
}

/* Hide LIVE badge on cards */
body.page-id-683 .bb-card .bb-new-badge,
body.page-id-683 .bb-card .bbm-badge-live,
body.page-id-683 .bb-card .bb-badge-live,
body.page-id-683 .bb-card .bbm-live-badge,
body.page-id-683 .bb-card .bbm-live{
  display:none !important;
}

/* Ensure country badge stays visible and positioned */
body.page-id-683 .bbm-badge-country{
  display:inline-flex !important;
  opacity:1 !important;
}


/* BBMALYA_COUNTRY_BADGE_POSITION v1 ? move to top-left (old OK spot) */
body.page-id-683 .bb-card{
  position: relative; /* ensure absolute badge anchors to card */
}
body.page-id-683 .bb-card .bbm-badge-country{
  position: absolute !important;
  top: 6px !important;
  left: 8px !important;
  right: auto !important;
  z-index: 6 !important;
}

/* BBMALYA_HEADER_LOGO_BOOST v1 */
header .bb-logo,
header .bb-logo:link,
header .bb-logo:visited{
  color:#E50914 !important;
  opacity:1 !important;
  filter:none !important;
  font-weight:900 !important;
  letter-spacing: .04em !important;
  text-transform:uppercase;
  line-height:1 !important;

  /* Bigger but safe ? will not explode layout */
  font-size: clamp(32px, 3.0vw, 56px) !important;

  /* Premium contrast like Netflix */
  text-shadow:
    0 2px 10px rgba(229,9,20,.22),
    0 1px 0 rgba(0,0,0,.35);
}

/* If logo is an <img>, boost it too */
header .bb-logo img,
header .bb-logo-img{
  height: clamp(34px, 3.0vw, 58px) !important;
  width:auto !important;
  opacity:1 !important;
  filter:none !important;
}

/* Keep nav from shifting / wrapping */
header .navbar,
header .site-header,
header .bb-header{
  min-height: 86px;
  align-items:center;
}

/* Mobile: reduce slightly so it doesn't collide with menu */
@media (max-width: 640px){
  header .bb-logo{ font-size: 28px !important; letter-spacing:.05em !important; }
  header .bb-logo img,
  header .bb-logo-img{ height: 32px !important; }
}


/* BBMALYA_GLOBAL_BG_VIGNETTE v1 */
:root{
  --bbm-bg-base:#090706;
  --bbm-brand-red:#E50914;
}

/* Global foundation (all pages) */
html, body{
  background-color: var(--bbm-bg-base) !important;
}
body{
  background-image:
    radial-gradient(1200px circle at 25% 12%,
      rgba(229,9,20,.16) 0%,
      rgba(69,14,16,.32) 35%,
      rgba(0,0,0,.92) 75%),
    linear-gradient(180deg,
      rgba(69,14,16,.35) 0%,
      rgba(0,0,0,.96) 65%,
      #090706 100%) !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
}

/* Live TV hub/page */
body.page-id-683{
  background-image:
    radial-gradient(1200px circle at 25% 12%,
      rgba(229,9,20,.14) 0%,
      rgba(69,14,16,.26) 35%,
      rgba(0,0,0,.93) 75%),
    linear-gradient(180deg,
      rgba(69,14,16,.26) 0%,
      rgba(0,0,0,.97) 65%,
      #090706 100%) !important;
}

/* Watch page (same page-id, detect by watch shell in DOM) ? reduce glow for video focus */
body.page-id-683:has(.bbm-watch-page){
  background-image:
    radial-gradient(1200px circle at 25% 10%,
      rgba(229,9,20,.08) 0%,
      rgba(69,14,16,.18) 35%,
      rgba(0,0,0,.94) 75%),
    linear-gradient(180deg,
      rgba(69,14,16,.18) 0%,
      rgba(0,0,0,.97) 65%,
      #090706 100%) !important;
}

/* WP login ? slightly stronger Netflix vibe */
body.login{
  background-image:
    radial-gradient(1200px circle at 25% 12%,
      rgba(229,9,20,.22) 0%,
      rgba(69,14,16,.38) 35%,
      rgba(0,0,0,.92) 75%),
    linear-gradient(180deg,
      rgba(69,14,16,.42) 0%,
      rgba(0,0,0,.96) 65%,
      #090706 100%) !important;
}


/* BBMALYA_GLOBAL_BG_GRAIN v1 */
:root{
  --bbm-grain-layer:url(data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.26'/%3E%3C/svg%3E);
}

body{
  background-image:
    var(--bbm-grain-layer),
    radial-gradient(1200px circle at 25% 12%, rgba(229,9,20,.16) 0%, rgba(69,14,16,.32) 35%, rgba(0,0,0,.92) 75%),
    linear-gradient(180deg, rgba(69,14,16,.35) 0%, rgba(0,0,0,.96) 65%, #090706 100%) !important;
  background-size: 180px 180px, auto, auto !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  background-blend-mode: soft-light, normal, normal !important;
}

body.page-id-683{
  background-image:
    var(--bbm-grain-layer),
    radial-gradient(1200px circle at 25% 12%, rgba(229,9,20,.14) 0%, rgba(69,14,16,.26) 35%, rgba(0,0,0,.93) 75%),
    linear-gradient(180deg, rgba(69,14,16,.26) 0%, rgba(0,0,0,.97) 65%, #090706 100%) !important;
  background-size: 180px 180px, auto, auto !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  background-blend-mode: soft-light, normal, normal !important;
}

body.page-id-683:has(.bbm-watch-page){
  background-image:
    var(--bbm-grain-layer),
    radial-gradient(1200px circle at 25% 10%, rgba(229,9,20,.08) 0%, rgba(69,14,16,.18) 35%, rgba(0,0,0,.94) 75%),
    linear-gradient(180deg, rgba(69,14,16,.18) 0%, rgba(0,0,0,.97) 65%, #090706 100%) !important;
  background-size: 180px 180px, auto, auto !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  background-blend-mode: soft-light, normal, normal !important;
}

body.login{
  background-image:
    var(--bbm-grain-layer),
    radial-gradient(1200px circle at 25% 12%, rgba(229,9,20,.22) 0%, rgba(69,14,16,.38) 35%, rgba(0,0,0,.92) 75%),
    linear-gradient(180deg, rgba(69,14,16,.42) 0%, rgba(0,0,0,.96) 65%, #090706 100%) !important;
  background-size: 180px 180px, auto, auto !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  background-blend-mode: soft-light, normal, normal !important;
}

/* BBMALYA_BG_LOCK v1 */
/* Scoped lock for Movies/TV pages to keep cinema background visible */
body.page-id-412,
body.page-id-420{
  background-image:
    var(--bbm-grain-layer),
    radial-gradient(1200px circle at 25% 12%, rgba(229,9,20,.16) 0%, rgba(69,14,16,.32) 35%, rgba(0,0,0,.92) 75%),
    linear-gradient(180deg, rgba(69,14,16,.35) 0%, rgba(0,0,0,.96) 65%, #090706 100%) !important;
  background-size: 180px 180px, auto, auto !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  background-blend-mode: soft-light, normal, normal !important;
}

body.page-id-412 #page,
body.page-id-412 .site,
body.page-id-412 main,
body.page-id-412 #content,
body.page-id-412 .site-content,
body.page-id-412 #primary,
body.page-id-412 .site-main,
body.page-id-420 #page,
body.page-id-420 .site,
body.page-id-420 main,
body.page-id-420 #content,
body.page-id-420 .site-content,
body.page-id-420 #primary,
body.page-id-420 .site-main{
  background: transparent !important;
}



/* BBMALYA_BG_SYSTEM_V2 v1
   Append-only “final winner” background system (no edits to older BBMALYA_* blocks).
   Architecture:
   - One global base mood everywhere (cinema black + subtle #E50914 glow + grain)
   - Small scoped modifiers only where needed
   - Wrapper transparency guard to prevent “flattening” the body background
*/

:root{
  --bbm-bg-base:#090706;
  --bbm-brand-red:#E50914;

  /* Default global intensities (subtle) */
  --bbm-glow-a:.16;    /* red glow strength (0..1) */
  --bbm-mid-a:.32;     /* burgundy mid tone */
  --bbm-top-a:.35;     /* top linear burgundy */
}

/* Page modifiers (tiny variations, same system) */
body.page-id-683{           /* Live TV hub */
  --bbm-glow-a:.14;
  --bbm-mid-a:.26;
  --bbm-top-a:.26;
}

/* Watch page (reduce glow so video is focus)
   Uses your proven hook: watch pages contain .bbm-watch-page */
body.page-id-683:has(.bbm-watch-page){
  --bbm-glow-a:.08;
  --bbm-mid-a:.18;
  --bbm-top-a:.18;
}

body.login{                 /* WP login stronger vibe */
  --bbm-glow-a:.22;
  --bbm-mid-a:.38;
  --bbm-top-a:.42;
}

/* Wrapper transparency guard (prevents body background being covered).
   Keep this limited to top-level layout wrappers only. */
#page, #content, #primary, #main,
.site, .site-content, .site-main,
main, .bb-main, .bb-wrapper{
  background: transparent !important;
  background-color: transparent !important;
}

/* Global foundation — always visible */
html, body{
  background-color: var(--bbm-bg-base) !important;
}

body{
  /* Keep grain layer if defined by earlier grain block (no regression).
     If --bbm-grain-layer is not defined, CSS just ignores it. */
  background-image:
    var(--bbm-grain-layer),
    radial-gradient(1200px circle at 25% 12%,
      rgba(229,9,20,var(--bbm-glow-a)) 0%,
      rgba(69,14,16,var(--bbm-mid-a)) 35%,
      rgba(0,0,0,.92) 75%),
    linear-gradient(180deg,
      rgba(69,14,16,var(--bbm-top-a)) 0%,
      rgba(0,0,0,.96) 65%,
      var(--bbm-bg-base) 100%) !important;

  /* Blend grain subtly; gradients stay normal */
  background-blend-mode: soft-light, normal, normal !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  background-size: auto, cover, cover !important;
  background-position: 0 0, center top, center top !important;
  background-attachment: scroll !important;
}


/* BBMALYA_BG_SYSTEM_V2_FIXED_OVERLAY */
/* Purpose: Netflix-like burgundy vignette that cannot be masked by wrappers.
   Implementation: body background becomes transparent, vignette+grain rendered on fixed pseudo-elements. */

:root{
  --bbm-bg-base:#090706;
  --bbm-brand-red:#E50914;

  /* Default (global) glow tuning */
  --bbm-glow-a1:.22;   /* red core */
  --bbm-glow-a2:.42;   /* burgundy mid */
  --bbm-glow-a3:.40;   /* top wash */
  --bbm-grain-opacity:.10;
}

/* Ensure base is never "white flash" */
html{
  background-color: var(--bbm-bg-base) !important;
}

/* Make body itself transparent so wrappers can't "compete" with it */
body{
  background: transparent !important;
  background-color: transparent !important;
  position: relative;
  min-height: 100vh;
  z-index: 0;
}

/* Vignette layer (Netflix-like) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-color: var(--bbm-bg-base);
  background-image:
    radial-gradient(1400px circle at 24% 10%,
      rgba(229,9,20,var(--bbm-glow-a1)) 0%,
      rgba(69,14,16,var(--bbm-glow-a2)) 38%,
      rgba(0,0,0,.94) 78%),
    linear-gradient(180deg,
      rgba(69,14,16,var(--bbm-glow-a3)) 0%,
      rgba(0,0,0,.98) 62%,
      var(--bbm-bg-base) 100%);
  background-repeat: no-repeat;
}

/* Grain layer (uses your existing variable if present) */
body::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: var(--bbm-grain-layer, none);
  opacity: var(--bbm-grain-opacity);
  mix-blend-mode: soft-light;
}

/* CRITICAL: wrappers must be transparent so they do not flatten the vignette */
#page, #content, #primary, main,
.site, .site-content, .site-main,
.bb-main, .bb-wrap{
  background: transparent !important;
  background-color: transparent !important;
}

/* Page-specific tuning (small modifiers only) */
body.login{
  --bbm-glow-a1:.30;
  --bbm-glow-a2:.52;
  --bbm-glow-a3:.50;
  --bbm-grain-opacity:.12;
}

body.page-id-683{ /* Live TV hub */
  --bbm-glow-a1:.24;
  --bbm-glow-a2:.46;
  --bbm-glow-a3:.44;
}

/* Watch page reduce glow (keeps focus on video) */
body.page-id-683:has(.bbm-watch-page){
  --bbm-glow-a1:.12;
  --bbm-glow-a2:.22;
  --bbm-glow-a3:.20;
  --bbm-grain-opacity:.08;
}


/* BBMALYA_HERO_BG_NEUTRALIZE v1 */
/* Keep global vignette as the single visible backdrop on home hero */
body.home .bb-hero .bb-hero-bg{
  display:none !important;
}


/* BBMALYA_SINGLE_CONTENT_HERO_BG_NEUTRALIZE v1 */
/* Keep global background visible on single BBM content pages */
body.single-bbm_content .bb-hero .bb-hero-bg{
  display:none !important;
}


/* BBMALYA_BBM_CONTENT_PLAYER v1 */
body.single-bbm_content .bbm-vod-player-section{
  padding: 20px 0 10px;
}
body.single-bbm_content #bbm-vod-video{
  display: block;
  width: min(100%, 1120px);
  max-width: 100%;
  background: #000;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
}
body.single-bbm_content .bbm-vod-missing{
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(127,29,29,.28);
  border: 1px solid rgba(248,113,113,.55);
  color: rgba(254,226,226,.95);
  font-weight: 700;
}
