/* =====================================================
   Future DZ - ثيم التدرج الوردي/البنفسجي + شريط التنقل السفلي
   الخطوة 1
   ===================================================== */

:root {
  /* ألوان الثيم الوردي المتدرج (الافتراضي واختيار "وردي متدرج" من التخصيص) */
  --hitv-pink: #ff4d94;
  --hitv-violet: #9b5cff;
  --hitv-pink-rgb: 255, 77, 148;
  --hitv-violet-rgb: 155, 92, 255;
  --hitv-pink-light: #ff7cb0;
  --hitv-pink-dark: #e23c82;
  --hitv-grad: linear-gradient(135deg, #ff4d94 0%, #9b5cff 100%);
}

/* عند اختيار أي لون آخر من التخصيص (1-5 أو مخصص) يتبع الموقع اللون المختار فعلياً */
[data-bs-theme-color="color-1"], [data-bs-theme-color="color-2"], [data-bs-theme-color="color-3"],
[data-bs-theme-color="color-4"], [data-bs-theme-color="color-5"], [data-bs-theme-color="custom"] {
  --hitv-pink: var(--bs-primary);
  --hitv-violet: var(--bs-secondary, var(--bs-primary));
  --hitv-pink-rgb: var(--bs-primary-rgb);
  --hitv-violet-rgb: var(--bs-secondary-rgb, var(--bs-primary-rgb));
  --hitv-pink-light: var(--bs-primary);
  --hitv-pink-dark: var(--bs-primary-active-bg, var(--bs-primary));
  --hitv-grad: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary) 100%);
}

/* اللون الأساسي للقالب في الوضع الوردي (يتغلب على القيم المحفوظة في إعدادات الألوان) */
:root:not([data-bs-theme-color="color-1"]):not([data-bs-theme-color="color-2"]):not([data-bs-theme-color="color-3"]):not([data-bs-theme-color="color-4"]):not([data-bs-theme-color="color-5"]):not([data-bs-theme-color="custom"]) {
  --bs-primary: #ff4d94 !important;
  --bs-primary-rgb: 255, 77, 148 !important;
  --bs-primary-text-emphasis: #ff8fbd !important;
  --bs-primary-border-subtle: #7a2a52 !important;
  --bs-link-color: #ff6fa8 !important;
  --bs-link-hover-color: #ff9cc5 !important;
}

/* الوضع الداكن (الافتراضي) */
[data-bs-theme="dark"] {
  --bs-body-bg: #12141a !important;
}
:root:not([data-bs-theme-color="color-1"]):not([data-bs-theme-color="color-2"]):not([data-bs-theme-color="color-3"]):not([data-bs-theme-color="color-4"]):not([data-bs-theme-color="color-5"]):not([data-bs-theme-color="custom"])[data-bs-theme="dark"] { --bs-primary-bg-subtle: #3a1426 !important; }
[data-bs-theme="dark"],
[data-bs-theme="dark"] body { background-color: #12141a; }

/* ---------- الأزرار ---------- */
.btn-primary,
.btn-primary:focus {
  --bs-btn-bg: var(--hitv-pink);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--hitv-pink);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--hitv-pink-dark);
  --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-bg: var(--hitv-pink);
  --bs-btn-disabled-border-color: transparent;
  color: #fff !important;
  background-image: var(--hitv-grad) !important;
  border-color: transparent !important;
}
.btn-primary:hover,
.btn-primary:active {
  filter: brightness(1.08);
  color: #fff !important;
}

.btn-outline-primary {
  --bs-btn-color: var(--hitv-pink);
  --bs-btn-border-color: var(--hitv-pink);
  --bs-btn-hover-bg: rgba(var(--hitv-pink-rgb), 0.12);
  --bs-btn-hover-color: var(--hitv-pink-light);
  --bs-btn-hover-border-color: var(--hitv-pink);
  --bs-btn-active-bg: rgba(var(--hitv-pink-rgb), 0.2);
  --bs-btn-active-border-color: var(--hitv-pink);
  --bs-btn-active-color: var(--hitv-pink-light);
}

/* ---------- عناصر تستعمل اللون الأساسي ---------- */
.text-primary { color: var(--hitv-pink) !important; }
.border-primary { border-color: var(--hitv-pink) !important; }
.bg-primary,
.badge.bg-primary { background: var(--hitv-grad) !important; color: #fff !important; }
.progress-bar { background-image: var(--hitv-grad) !important; }
.form-check-input:checked { background-color: var(--hitv-pink); border-color: var(--hitv-pink); }
.form-control:focus,
.form-select:focus { border-color: var(--hitv-pink); box-shadow: 0 0 0 0.2rem rgba(var(--hitv-pink-rgb), 0.2); }

/* =====================================================
   شريط التنقل السفلي (الهاتف والأجهزة اللوحية الصغيرة)
   ===================================================== */
.hitv-bottom-nav { display: none; }

@media (max-width: 991.98px) {
  /* شريط عائم بزوايا مدورة مثل Hi TV */
  .hitv-bottom-nav {
    display: flex;
    position: fixed;
    inset-inline: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    background: rgba(43, 43, 51, 0.97);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 28px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
    padding: 9px 6px;
  }
  .hitv-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    color: #8d8d96;
    font-size: 0.72rem;
    line-height: 1.2;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .hitv-bottom-nav a svg { width: 24px; height: 24px; }
  .hitv-bottom-nav a svg path { fill: currentColor; }
  .hitv-bottom-nav a.active svg path { fill: url(#hitvGrad); }
  .hitv-bottom-nav a.active span {
    background: var(--hitv-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 700;
  }

  /* مساحة أسفل الصفحة حتى لا يغطي الشريط آخر المحتوى */
  body { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}

/* =====================================================
   الخطوة 2: التبويبات العلوية + شرائح الأنواع + شارات البطاقات
   ===================================================== */

/* شارة "جديد" على بطاقة العمل */
.hitv-badge {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 3;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  pointer-events: none;
}
.hitv-badge-new { background: linear-gradient(135deg, #ff8a3d 0%, #ff4d4d 100%); }

/* شرائح الأنواع (تُمرَّر أفقياً) */
.hitv-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 12px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hitv-chips::-webkit-scrollbar { display: none; }
.hitv-chip {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 7px 16px;
  background: transparent;
  color: #8d8d96;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.hitv-chip:hover { color: #c9c9d1; }
.hitv-chip.active {
  background: #2c2c33;
  color: #ff5c9d;
}

/* التبويبات العلوية: الرئيسية | المسلسلات | الأفلام (الهاتف فقط) */
.hitv-tabs { display: none; }
@media (max-width: 991.98px) {
  .hitv-tabs {
    display: flex;
    gap: 26px;
    position: sticky;
    top: 0;
    z-index: 1020;
    overflow-x: auto;
    padding: 4px 18px 0;
    background: rgba(20, 20, 24, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    scrollbar-width: none;
  }
  .hitv-tabs::-webkit-scrollbar { display: none; }
  .hitv-tabs a {
    flex: 0 0 auto;
    position: relative;
    padding: 12px 0 11px;
    color: #8d8d96;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-decoration: none;
  }
  .hitv-tabs a.active span {
    background: var(--hitv-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  .hitv-tabs a.active::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--hitv-grad);
  }
}

/* =====================================================
   الوضع الفاتح (Light) - يُفعَّل بزر التبديل ويُحفظ في المتصفح
   ===================================================== */
[data-bs-theme="light"] {
  --bs-body-bg: #f5f6fa !important;
  --bs-body-color: #1d1f27 !important;
  --bs-heading-color: #12141a !important;
  --bs-emphasis-color: #12141a !important;
  --bs-secondary-color: #6b6f7b !important;
  --bs-border-color: #e3e5ec !important;
  --bs-primary-bg-subtle: #ffe3ee !important;
}
[data-bs-theme="light"],
[data-bs-theme="light"] body { background-color: #f5f6fa; color: #1d1f27; }

/* الهيدر والفوتر: خلفية فاتحة ونصوص داكنة (القالب يستعمل --bs-white للنص) */
[data-bs-theme="light"] header,
[data-bs-theme="light"] footer {
  --bs-white: #12141a;
  color: #12141a;
}
[data-bs-theme="light"] header .header-absolute,
[data-bs-theme="light"] header.header-absolute,
[data-bs-theme="light"] header.sticky,
[data-bs-theme="light"] header {
  background: rgba(255, 255, 255, 0.94) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
[data-bs-theme="light"] footer { background: #ffffff !important; }
[data-bs-theme="light"] header a,
[data-bs-theme="light"] footer a { color: #12141a; }
[data-bs-theme="light"] header a:hover,
[data-bs-theme="light"] footer a:hover { color: var(--hitv-pink); }

/* الشعار الأبيض يصبح أسود في الوضع الفاتح */
[data-bs-theme="light"] header .logo,
[data-bs-theme="light"] footer .logo { filter: brightness(0); }

/* مكونات عامة */
[data-bs-theme="light"] .card,
[data-bs-theme="light"] .modal-content,
[data-bs-theme="light"] .dropdown-menu,
[data-bs-theme="light"] .offcanvas { background-color: #ffffff; color: #1d1f27; border-color: #e3e5ec; }
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select { background-color: #ffffff; color: #1d1f27; border-color: #dcdfe8; }
[data-bs-theme="light"] .text-white:not(.btn):not(.badge):not([class*="bg-"]) { color: #12141a !important; }
/* النص فوق صور البانر والبطاقات يبقى أبيض */
[data-bs-theme="light"] .banner-section .text-white,
[data-bs-theme="light"] .iq-card .text-white,
[data-bs-theme="light"] .block-images .text-white,
[data-bs-theme="light"] .hitv-badge { color: #ffffff !important; }

/* الشريط السفلي والتبويبات والشرائح */
[data-bs-theme="light"] .hitv-bottom-nav { background: rgba(255, 255, 255, 0.98); box-shadow: 0 8px 26px rgba(20, 20, 40, 0.18); }
[data-bs-theme="light"] .hitv-bottom-nav a { color: #7a7e8c; }
[data-bs-theme="light"] .hitv-tabs { background: rgba(255, 255, 255, 0.95); border-bottom-color: rgba(0, 0, 0, 0.06); }
[data-bs-theme="light"] .hitv-tabs a { color: #7a7e8c; }
[data-bs-theme="light"] .hitv-chip { color: #7a7e8c; }
[data-bs-theme="light"] .hitv-chip:hover { color: #3b3e4a; }
[data-bs-theme="light"] .hitv-chip.active { background: #ffe3ee; color: #e0287a; }

/* زر التبديل بين الداكن والفاتح */
.hitv-theme-toggle {
  position: fixed;
  inset-inline-end: 14px;
  bottom: 24px;
  z-index: 1031;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--hitv-grad);
  box-shadow: 0 6px 18px rgba(var(--hitv-violet-rgb), 0.4);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hitv-theme-toggle svg { width: 22px; height: 22px; }
.hitv-theme-toggle:active svg { transform: rotate(25deg) scale(0.9); }
.hitv-theme-toggle svg { transition: transform 0.25s ease; }

/* أيقونات خطية موحّدة (الوضع/اللغة/السهم/الصح) */
svg.hitv-ic {
  fill: none !important;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.hitv-ic path,
svg.hitv-ic circle { fill: none !important; }
@media (max-width: 991.98px) {
  .hitv-theme-toggle { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: 40px; height: 40px; }
}

/* =====================================================
   الخطوة 3: هيدر الهاتف + البانر الرئيسي بأسلوب Hi TV
   ===================================================== */
.hitv-mh { display: none; }

@media (max-width: 991.98px) {
  /* الهيدر الأصلي يُخفى بصرياً على الهاتف (قائمة offcanvas تبقى تعمل) */
  header,
  header.header-absolute,
  header.sticky {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: visible;
    visibility: hidden;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  header .offcanvas.show,
  header .offcanvas.showing { visibility: visible; }

  .hitv-mh {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    position: relative;
    z-index: 1025;
    background: var(--bs-body-bg);
  }
  .hitv-mh-brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; text-decoration: none; }
  .hitv-mh-icon { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
  .hitv-mh-word { height: 24px; width: auto; max-width: 84px; object-fit: contain; }

  .hitv-mh-search {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    height: 38px;
    padding: 0 6px 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
  }
  [dir="rtl"] .hitv-mh-search { padding: 0 14px 0 6px; }
  .hitv-mh-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
  }
  .hitv-mh-search input::placeholder { color: rgba(255, 255, 255, 0.65); }
  .hitv-mh-search button {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hitv-mh-search svg,
  .hitv-mh-ico svg { width: 22px; height: 22px; fill: currentColor; }

  .hitv-mh-ico {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }
  .hitv-dot {
    position: absolute;
    top: 7px;
    inset-inline-end: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--hitv-pink);
    border: 2px solid var(--bs-body-bg);
  }
  @media (max-width: 420px) { .hitv-mh-word { display: none; } }

  /* الصفحة الرئيسية: الهيدر والتبويبات فوق صورة البانر */
  .hitv-mh.hitv-overlay {
    position: absolute;
    top: 0;
    inset-inline: 0;
    background: linear-gradient(to bottom, rgba(18, 20, 26, 0.85), rgba(18, 20, 26, 0));
  }
  .hitv-tabs.hitv-overlay {
    position: absolute;
    top: 58px;
    inset-inline: 0;
    background: transparent;
    border: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .hitv-tabs.hitv-overlay a { color: rgba(255, 255, 255, 0.75); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
  .hitv-tabs.hitv-overlay a.active span { background: none; -webkit-text-fill-color: #fff; color: #fff; }

  /* ----- البانر الرئيسي ----- */
  .slick-banner.main-banner .slick-item {
    height: 82vw !important;
    min-height: 360px;
    max-height: 640px;
    background-size: cover;
    background-position: center top;
  }
  .slick-banner.main-banner .movie-content {
    display: flex;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(18, 20, 26, 0.97) 0%, rgba(18, 20, 26, 0.6) 26%, rgba(18, 20, 26, 0) 58%);
  }
  .slick-banner.main-banner .movie-content .row { align-items: flex-end !important; padding-bottom: 34px; }
  .slick-banner.main-banner .movie-info .movie-tag,
  .slick-banner.main-banner .movie-info .line-count-3,
  .slick-banner.main-banner .movie-info > ul,
  .slick-banner.main-banner .share-button { display: none !important; }
  .slick-banner.main-banner .movie-info h4 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 8px !important;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  }
  .slick-banner.main-banner .movie-info .mt-5 { margin-top: 0.25rem !important; }
  .slick-banner.main-banner .movie-info .btn { padding: 8px 18px; font-size: 0.9rem; border-radius: 999px; }

  /* نقاط التنقل أسفل يمين البانر */
  .slick-banner.main-banner .slick-dots {
    position: absolute;
    bottom: 16px;
    inset-inline-end: 16px;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    list-style: none;
  }
  .slick-banner.main-banner .slick-dots li { margin: 0; line-height: 0; }
  .slick-banner.main-banner .slick-dots li button {
    width: 6px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    font-size: 0;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.25s ease, background 0.25s ease;
  }
  .slick-banner.main-banner .slick-dots li.slick-active button { width: 22px; background: #fff; }
  .slick-banner.main-banner .slick-arrow { display: none !important; }
}

/* الوضع الفاتح (الهاتف) */
@media (max-width: 991.98px) {
  [data-bs-theme="light"] .hitv-mh:not(.hitv-overlay) { background: #ffffff; }
  [data-bs-theme="light"] .hitv-mh:not(.hitv-overlay) .hitv-mh-search { background: #eef0f6; }
  [data-bs-theme="light"] .hitv-mh:not(.hitv-overlay) .hitv-mh-search input,
  [data-bs-theme="light"] .hitv-mh:not(.hitv-overlay) .hitv-mh-search button,
  [data-bs-theme="light"] .hitv-mh:not(.hitv-overlay) .hitv-mh-ico { color: #12141a; }
  [data-bs-theme="light"] .hitv-mh:not(.hitv-overlay) .hitv-mh-search input::placeholder { color: #8b8f9c; }
  [data-bs-theme="light"] .hitv-mh:not(.hitv-overlay) .hitv-mh-word { filter: brightness(0); }
  [data-bs-theme="light"] .hitv-tabs.hitv-overlay a { color: rgba(255, 255, 255, 0.8); }
}

/* =====================================================
   القائمة الجانبية (الهاتف): تفتح تحت الهيدر، والهيدر يبقى ظاهراً
   (شعار + بحث + زر القائمة |||) والضغط على ||| يغلقها.
   + زر الوضع وزر اللغة داخلها
   ===================================================== */
.hitv-menu-tools { display: none; }

@media (max-width: 991.98px) {
  :root { --hitv-mh-h: 58px; } /* يُحدَّث بدقة من JS */

  /* الزر العائم يختفي على الهاتف (الزر صار داخل القائمة) */
  .hitv-theme-toggle { display: none !important; }

  /* منع الهيدر المخفي من التقاط القائمة (backdrop-filter/transform يجعلان fixed نسبياً له) */
  header,
  [data-bs-theme="light"] header {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transform: none !important;
  }
  /* أثناء فتح القائمة: الهيدر الأصلي (حاوية القائمة) تحت الهيدر المرئي */
  body.hitv-menu-open header { z-index: 2000 !important; }

  /* الهيدر المرئي يبقى فوق القائمة ويُثبَّت أعلى الشاشة */
  body.hitv-menu-open .hitv-mh {
    z-index: 2100;
    background: var(--bs-body-bg);
    box-shadow: 0 1px 0 rgba(128, 128, 140, 0.22);
  }
  body.hitv-menu-open .hitv-mh:not(.hitv-overlay) { position: sticky; top: 0; }
  body.hitv-menu-open .hitv-mh.hitv-overlay { position: fixed; top: 0; inset-inline: 0; }

  /* ألوان الهيدر المفتوحة فوق القائمة (تتبع الوضع حتى في الرئيسية الشفافة) */
  body.hitv-menu-open .hitv-mh .hitv-mh-search { background: rgba(255, 255, 255, 0.1); }
  [data-bs-theme="light"] body.hitv-menu-open .hitv-mh { background: #ffffff; }
  [data-bs-theme="light"] body.hitv-menu-open .hitv-mh .hitv-mh-search { background: #eef0f6; }
  [data-bs-theme="light"] body.hitv-menu-open .hitv-mh .hitv-mh-search input,
  [data-bs-theme="light"] body.hitv-menu-open .hitv-mh .hitv-mh-search button,
  [data-bs-theme="light"] body.hitv-menu-open .hitv-mh .hitv-mh-ico { color: #12141a; }
  [data-bs-theme="light"] body.hitv-menu-open .hitv-mh .hitv-mh-search input::placeholder { color: #8b8f9c; }
  [data-bs-theme="light"] body.hitv-menu-open .hitv-mh .hitv-mh-word { filter: brightness(0); }

  /* زر ||| يظهر "نشطاً" عند فتح القائمة */
  .hitv-mh-menu { border-radius: 10px; transition: background 0.2s ease, color 0.2s ease; }
  body.hitv-menu-open .hitv-mh-menu { background: var(--hitv-grad); color: #fff !important; }
  .hitv-mh-menu svg { transition: transform 0.25s ease; }
  body.hitv-menu-open .hitv-mh-menu svg { transform: scale(0.9); }

  /* لوحة تبدأ تحت الهيدر وتملأ ما تبقى من الشاشة (بخلفية معتمة) */
  #navbar_main.offcanvas {
    --hitv-off: 100%;                 /* العربية: من اليمين */
    position: fixed !important;
    top: var(--hitv-mh-h) !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border: 0 !important;
    z-index: 2000 !important;
    background-color: var(--bs-body-bg) !important;
    transform: translate3d(var(--hitv-off), 0, 0) !important;
    transition: transform 0.28s ease !important;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overscroll-behavior: contain;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  html[dir="ltr"] #navbar_main.offcanvas { --hitv-off: -100%; }
  html[dir="rtl"] #navbar_main.offcanvas { --hitv-off: 100%; }

  #navbar_main.offcanvas.showing,
  #navbar_main.offcanvas.show:not(.hiding) {
    transform: translate3d(0, 0, 0) !important;
  }

  /* الشعار وزر الإغلاق داخل القائمة صارا في الهيدر المرئي */
  #navbar_main .offcanvas-header { display: none !important; }

  /* الخلفية المعتمة غير لازمة (القائمة تغطي كل شيء) وسبب للوميض */
  .offcanvas-backdrop { display: none !important; }

  /* محتوى القائمة: تمرير سلس بلا اهتزاز عند اللمس */
  #navbar_main .offcanvas-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  #navbar_main a,
  #navbar_main button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: none !important;
    animation: none !important;
  }
  #navbar_main a:active,
  #navbar_main button:active { transform: none !important; }

  /* زر إغلاق احتياطي (يُضاف من JS إذا لم يوجد زر إغلاق في القائمة) */
  .hitv-menu-close {
    position: absolute;
    top: 10px;
    inset-inline-end: 14px;
    z-index: 3;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 140, 0.2);
    color: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  .hitv-menu-close svg { width: 20px; height: 20px; }

  /* ---------- أدوات القائمة: الوضع + اللغة ---------- */
  .hitv-menu-tools {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 16px 14px;
  }
  .hitv-menu-theme-btn,
  .hitv-menu-lang-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 0;
    border-radius: 16px;
    background: rgba(128, 128, 140, 0.14);
    color: inherit;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    list-style: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .hitv-menu-lang-btn::-webkit-details-marker { display: none; }

  /* دائرة الأيقونة */
  .hitv-tm-ico {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hitv-grad);
    color: #fff;
  }
  .hitv-tm-ico svg { width: 20px; height: 20px; }

  /* نص مزدوج: عنوان + قيمة حالية */
  .hitv-tm-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
  .hitv-tm-txt b { font-size: 0.95rem; font-weight: 700; }
  .hitv-tm-txt small { font-size: 0.78rem; opacity: 0.65; }

  /* مفتاح التبديل (يعرض أيقونة الوضع الحالي داخل المقبض) */
  .hitv-tm-switch {
    flex: 0 0 auto;
    position: relative;
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: rgba(128, 128, 140, 0.32);
    box-shadow: inset 0 0 0 1px rgba(128, 128, 140, 0.25);
  }
  .hitv-tm-knob {
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hitv-grad);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--hitv-violet-rgb), 0.45);
    transition: inset-inline-start 0.25s ease !important;
  }
  .hitv-tm-knob svg { width: 14px; height: 14px; }
  /* الداكن: المقبض في الطرف الآخر */
  .hitv-menu-theme-btn[aria-checked="true"] .hitv-tm-knob { inset-inline-start: calc(100% - 27px); }
  .hitv-menu-theme-btn[aria-checked="true"] .hitv-tm-switch { background: rgba(var(--hitv-violet-rgb), 0.3); }

  /* قائمة اللغات المنسدلة */
  .hitv-menu-lang { width: 100%; }
  .hitv-chev { width: 20px; height: 20px; opacity: 0.7; transition: transform 0.2s ease !important; }
  .hitv-menu-lang[open] .hitv-chev { transform: rotate(180deg); }
  .hitv-menu-lang-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border-radius: 16px;
    background: rgba(128, 128, 140, 0.1);
  }
  .hitv-menu-lang-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    font-size: 0.92rem;
  }
  .hitv-menu-lang-list a img { width: 22px; height: 16px; object-fit: contain; flex: 0 0 auto; }
  .hitv-menu-lang-list a span { flex: 1 1 auto; }
  .hitv-menu-lang-list a.active { background: rgba(var(--hitv-pink-rgb), 0.14); font-weight: 700; }
  .hitv-check { width: 18px; height: 18px; color: var(--hitv-pink); flex: 0 0 auto; }
}
