/* ✅ إخفاء نافذة الـ Hover Preview الكبيرة (التي تظهر فوق الصفحة) */
.builder-page div[style*="position: fixed"][style*="pointer-events: none"]{
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* ✅ لو عندك نسخة ثانية فيها class hover-preview */
.builder-page .hover-preview{
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}
/* =========================================
   HOME — Fix Overlap + Spacing (Mobile)
   Targets Home.jsx classes only
========================================= */

@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; }
  body { background: #0A0E14 !important; }

  /* 1) خلي الهيدر صف واحد بدون لف/تزاحم */
  .page .topnav { padding: 10px !important; }
  .page .topnav-inner{
    width: 100% !important;
    padding: 10px 12px !important;
    border-radius: 18px !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .page .brand { padding: 8px 10px !important; }
  .page .brandText{
    font-size: 14px !important;
    max-width: 56vw !important; /* يمنع التزاحم */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* 2) زرّين الهيدر (تسجيل/إنشاء) يصيروا أصغر ومناسبين */
  .page .topnav-inner > :is(a,button):not(.brand),
  .page .topnav-inner .navlink{
    padding: 8px 10px !important;
    min-height: 36px !important;
    font-size: 12px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  /* 3) امنع أي شيء من الهيرو يطلع تحت الهيدر */
  .page .hero-center{
    padding-top: 112px !important; /* أهم سطر لمنع التداخل */
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 16px !important;
  }

  /* 4) الكارد: مساحة داخلية + منع تداخل شارة (3/3) مع البادجات */
  .page .hero-card{
    position: relative !important;
    padding: 14px 12px 12px !important;
    border-radius: 20px !important;
  }

  /* شريط البادجات أعلى الكارد: صف واحد ينكسر لو لازم */
  .page .card-top{
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-bottom: 10px !important;
    padding-left: 64px !important; /* يترك مكان لعداد الشرائح */
  }
  .page .badge, .page .pill{
    font-size: 12px !important;
    padding: 7px 10px !important;
    border-radius: 999px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
  .page .pill{ white-space: normal !important; } /* لو النص طويل ينزل سطر */
  
  /* عداد الشرائح (3/3) يثبت في زاوية وما يركب فوق */
  .page .slide-badge{
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    z-index: 2 !important;
  }

  /* 5) العنوان: حجم وارتفاع سطر يمنع التداخل */
  .page .card-title{
    font-size: 26px !important;
    line-height: 1.2 !important;
    margin: 8px 0 10px !important;
    text-align: center !important;
  }

  /* 6) mini cards: عمود واحد + سطور مضبوطة */
  .page .mini{
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 10px !important;
  }
  .page .miniItem{
    padding: 12px !important;
    border-radius: 16px !important;
    min-height: unset !important;
  }
  .page .miniTitle{
    font-size: 15px !important;
    line-height: 1.25 !important;
  }
  .page .miniDesc{
    font-size: 13px !important;
    line-height: 1.55 !important;
  }

  /* 7) CTA: أزرار تحت بعض + لا تتزاحم */
  .page .cta-row{
    margin-top: 12px !important;
    gap: 10px !important;
  }
  .page .cta{
    width: 100% !important;
    min-width: 0 !important;
    height: 52px !important;
    border-radius: 16px !important;
    font-size: 15px !important;
  }

  /* 8) إجبار عدم وجود overflow يسبب قص/تزاحم */
  .page, .page * { max-width: 100% !important; }
}

@media (max-width: 480px) {
  .page .brandText{ max-width: 52vw !important; }
  .page .hero-center{ padding-top: 118px !important; }
  .page .card-title{ font-size: 24px !important; }
}
/* =========================================
   HOME — Remove Top Auth Box Completely
   (Mobile only, Home.jsx specific)
========================================= */

@media (max-width: 768px) {

  /* 1) حذف شريط تسجيل/إنشاء الحساب بالكامل */
  .page .topnav {
    display: none !important;
  }

  /* 2) بما أن الهيدر انحذف، نرجّع الهيرو فوق بدون فراغ */
  .page .hero {
    margin-top: 0 !important;
  }

  .page .hero-center {
    padding-top: 24px !important; /* بدل 110+ */
  }

  /* 3) تأكيد عدم وجود أي أثر (فراغ/ظل) */
  .page .topnav,
  .page .topnav * {
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
  }

  /* 4) حماية من overflow أو قص */
  html, body, .page {
    overflow-x: hidden !important;
  }
}

@media (max-width: 480px) {
  .page .hero-center {
    padding-top: 20px !important;
  }
}
/* =========================================
   AUTH (Login + Register) — Premium Mobile UI
   Scope: pages with .page AND inputs (email/password)
========================================= */

@media (max-width: 768px) {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    background: #0A0E14 !important; /* يمنع الأبيض على الجوانب */
    direction: rtl;
  }
  *, *::before, *::after { box-sizing: border-box; }

  /* نشتغل فقط على صفحات فيها فورم تسجيل (email/password) */
  @supports selector(:has(*)) {
    .page:has(input[type="password"]) {
      min-height: 100vh !important;
      background: transparent !important;
      overflow-x: hidden !important;
    }

    /* إزالة أي إطار خارجي يسبب “أبيض” */
    .page:has(input[type="password"]),
    .page:has(input[type="password"]) * {
      max-width: 100% !important;
    }

    /* حاوية الصفحة */
    .page:has(input[type="password"]) main,
    .page:has(input[type="password"]) .content,
    .page:has(input[type="password"]) [role="main"] {
      width: 100% !important;
      max-width: 420px !important;
      margin: 0 auto !important;
      padding: 18px 12px 22px !important;
    }

    /* الكارد الرئيسي: التقط أكبر صندوق يحوي الحقول */
    .page:has(input[type="password"]) main > :is(div,section),
    .page:has(input[type="password"]) .content > :is(div,section),
    .page:has(input[type="password"]) [role="main"] > :is(div,section) {
      border-radius: 22px !important;
      padding: 18px 14px !important;
      background: linear-gradient(180deg, rgba(22,26,34,0.90), rgba(22,26,34,0.72)) !important;
      border: 1px solid rgba(255,255,255,0.10) !important;
      box-shadow: 0 18px 60px rgba(0,0,0,0.55) !important;
      -webkit-backdrop-filter: blur(12px);
      backdrop-filter: blur(12px);
      overflow: hidden !important;
    }

    /* العناوين */
    .page:has(input[type="password"]) h1,
    .page:has(input[type="password"]) h2 {
      font-size: 24px !important;
      line-height: 1.25 !important;
      text-align: center !important;
      margin: 6px 0 10px !important;
    }

    .page:has(input[type="password"]) p {
      font-size: 13px !important;
      line-height: 1.65 !important;
      text-align: center !important;
      opacity: 0.85 !important;
      margin: 0 0 14px !important;
    }

    /* Labels */
    .page:has(input[type="password"]) label {
      display: block !important;
      font-size: 13px !important;
      margin: 12px 0 8px !important;
      color: rgba(230,180,80,0.95) !important; /* يتماشى مع تصميمك */
      font-weight: 700 !important;
    }

    /* Inputs: Full width + ثابت */
    .page:has(input[type="password"]) input[type="text"],
    .page:has(input[type="password"]) input[type="email"],
    .page:has(input[type="password"]) input[type="password"] {
      width: 100% !important;
      min-height: 52px !important;
      border-radius: 16px !important;
      padding: 12px 14px !important;
      font-size: 15px !important;
      background: rgba(10,14,20,0.55) !important;
      border: 1px solid rgba(255,255,255,0.10) !important;
      outline: none !important;
    }

    .page:has(input[type="password"]) input::placeholder {
      color: rgba(255,255,255,0.45) !important;
    }

    /* Focus state (احترافي) */
    .page:has(input[type="password"]) input:focus {
      border-color: rgba(230,180,80,0.45) !important;
      box-shadow: 0 0 0 3px rgba(230,180,80,0.12) !important;
    }

    /* Password eye/icon: لا تكسر الحقل */
    .page:has(input[type="password"]) input[type="password"] {
      padding-left: 44px !important;
    }
    .page:has(input[type="password"]) button:has(svg),
    .page:has(input[type="password"]) [class*="eye"],
    .page:has(input[type="password"]) [class*="toggle"] {
      transform: none !important;
    }

    /* Checkbox row (تذكر البريد / الموافقة) */
    .page:has(input[type="password"]) input[type="checkbox"] {
      width: 18px !important;
      height: 18px !important;
    }
    .page:has(input[type="password"]) .checkbox,
    .page:has(input[type="password"]) [class*="check"],
    .page:has(input[type="password"]) [class*="remember"] {
      display: flex !important;
      align-items: center !important;
      gap: 10px !important;
      margin-top: 12px !important;
    }

    /* الروابط الصغيرة (نسيت كلمة المرور / إنشاء حساب) */
    .page:has(input[type="password"]) a {
      font-size: 13px !important;
      text-decoration: none !important;
    }

    /* زر CTA الأساسي */
    .page:has(input[type="password"]) button,
    .page:has(input[type="password"]) .btn,
    .page:has(input[type="password"]) [class*="btn"] {
      width: 100% !important;
      min-height: 54px !important;
      border-radius: 18px !important;
      font-size: 16px !important;
      font-weight: 800 !important;
      margin-top: 14px !important;
    }

    /* زر Google */
    .page:has(input[type="password"]) button:has(svg),
    .page:has(input[type="password"]) a:has(svg) {
      width: 100% !important;
      min-height: 52px !important;
      border-radius: 18px !important;
      margin-top: 10px !important;
    }

    /* فاصل "أو" */
    .page:has(input[type="password"]) hr {
      opacity: 0.25 !important;
      margin: 14px 0 !important;
    }

    /* إزالة أي إطار أبيض خارجي إن وجد */
    .page:has(input[type="password"]) [style*="background:#fff"],
    .page:has(input[type="password"]) [style*="background: #fff"],
    .page:has(input[type="password"]) [style*="background:white"],
    .page:has(input[type="password"]) [style*="background: white"] {
      background: transparent !important;
    }
  }
}

@media (max-width: 480px) {
  @supports selector(:has(*)) {
    .page:has(input[type="password"]) main,
    .page:has(input[type="password"]) .content,
    .page:has(input[type="password"]) [role="main"] {
      padding: 16px 10px 20px !important;
    }
    .page:has(input[type="password"]) h1,
    .page:has(input[type="password"]) h2 {
      font-size: 22px !important;
    }
  }
}
/* =========================
   PERFORMANCE ANALYSIS
   Scope: card that contains .pa-header
   ========================= */

@media (max-width: 768px) {
  /* منع أي سكرول أفقي */
  html, body {
    overflow-x: hidden;
  }

  /* استهداف كارد PerformanceAnalysis فقط (الأب الذي يحتوي .pa-header) */
  .pa-header {
    align-items: flex-start !important;
  }

  .pa-header h3 {
    font-size: 18px !important;
    line-height: 1.25 !important;
  }

  /* الكارد الأب (مبني بـ inline styles) */
  .pa-header,
  .pa-mainGrid,
  .pa-fpsGrid,
  .pa-statsGrid,
  .pa-chartWrap {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Main grid → عمود واحد */
  .pa-mainGrid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Chips → صفين مرنين */
  .pa-chips {
    width: 100%;
    justify-content: flex-start !important;
  }

  .pa-chips > div {
    flex: 1 1 160px !important;
    min-width: 0 !important;
  }

  /* تقليل ارتفاع الشارت للموبايل */
  .pa-chartWrap {
    height: 260px !important;
    padding: 12px !important;
  }

  /* FPS + Stats → عمودين */
  .pa-fpsGrid,
  .pa-statsGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

@media (max-width: 480px) {
  /* كارد PerformanceAnalysis: نخفف padding باستخدام selector ذكي على الأب */
  /* الأب غالباً هو DIV الذي يحتوي .pa-header + .pa-mainGrid */
  .pa-header {
    margin-bottom: 12px !important;
    padding-bottom: 12px !important;
  }

  /* نص العنوان */
  .pa-header h3 {
    font-size: 20px !important;
  }

  /* Chips → عمودي full width */
  .pa-chips {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .pa-chips > div {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* FPS → عمود واحد */
  .pa-fpsGrid {
    grid-template-columns: 1fr !important;
  }

  /* Stats → عمود واحد */
  .pa-statsGrid {
    grid-template-columns: 1fr !important;
  }

  /* تصغير الشارت أكثر */
  .pa-chartWrap {
    height: 220px !important;
    padding: 10px !important;
  }

  /* منع أي overflow داخل عناصر recharts */
  .pa-chartWrap svg,
  .pa-chartWrap .recharts-wrapper,
  .pa-chartWrap .recharts-surface {
    max-width: 100% !important;
    overflow: visible !important;
  }
}
/* =========================
   BUILD SUMMARY (Mobile App UI)
   Scope: .spb-summary-card
   ========================= */

@media (max-width: 768px) {
  /* منع أي سكرول أفقي بسبب عناصر داخلية */
  .spb-summary-card,
  .spb-summary-card * {
    max-width: 100%;
  }
  .spb-summary-card {
    overflow-x: hidden !important;
  }

  /* الكارد الرئيسي: شكل App card */
  .spb-summary-card {
    border-radius: 16px !important;
    padding: 14px !important;
    box-shadow: var(--spb-shadowSm, 0 12px 26px rgba(0,0,0,0.10)) !important;
  }

  /* Header: ترتيب + مسافات */
  .spb-summary-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
  }

  /* عنوان الملخص */
  .spb-summary-header [style*="font-weight: 900"],
  .spb-summary-header [style*="fontWeight: 900"] {
    font-size: 18px !important;
    line-height: 1.25 !important;
  }

  /* صندوق الإجمالي: Full width + مثل شريط */
  .spb-summary-totalBox {
    width: 100% !important;
    min-width: 0 !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  /* قائمة العناصر: مسافات */
  .spb-summary-card > div[style*="flex-direction: column"] {
    gap: 10px !important;
  }

  /* عنصر القطعة: Card row مثل تطبيق */
  .spb-summary-item {
    padding: 12px !important;
    border-radius: 14px !important;
    gap: 10px !important;
  }

  /* إظهار المعلومات بشكل مرتب داخل العنصر */
  .spb-summary-item > div:nth-child(2) {
    min-width: 0 !important;
  }

  /* اسم القطعة: سطرين بدل سطر واحد (حتى ما ينقص) */
  .spb-summary-item > div:nth-child(2) > div:nth-child(2) {
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.25 !important;
  }

  /* meta row: السعر + pill */
  .spb-summary-item span {
    max-width: 100%;
  }

  /* زر الإزالة: أصغر + ثابت */
  .spb-summary-item button {
    padding: 8px 12px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    min-height: 38px !important;
  }

  /* أزرار الإجراءات: CTA full width */
  .spb-summary-action {
    width: 100% !important;
    border-radius: 14px !important;
    padding: 14px 14px !important;
    font-size: 15px !important;
    min-height: 46px !important;
  }

  /* تباعد بين الأزرار */
  .spb-summary-action + .spb-summary-action {
    margin-top: 10px !important;
  }
}

@media (max-width: 480px) {
  /* أصغر شاشات: شدّ المسافات */
  .spb-summary-card {
    padding: 12px !important;
    border-radius: 16px !important;
  }

  /* إجمالي أوضح كـ Sticky-like */
  .spb-summary-totalBox {
    padding: 12px 12px !important;
  }

  /* عنصر القطعة: ترتيب أفضل للمساحة */
  .spb-summary-item {
    padding: 11px !important;
  }

  /* pill والـ price ما يكسروا السطر */
  .spb-summary-item [style*="border-radius: 999"] {
    font-size: 11px !important;
    padding: 5px 9px !important;
  }

  /* زر الإزالة: يظل واضح وقابل للمس */
  .spb-summary-item button {
    min-height: 36px !important;
  }
}
/* =========================
   LAPTOPS PAGE (Mobile App UI)
   Scope: .lp-wrap / .lp-sidebar / .lp-card
   ========================= */

@media (max-width: 768px) {
  /* no horizontal scroll */
  html, body {
    overflow-x: hidden;
  }

  /* الصفحة: تقليل padding العام */
  .lp-wrap {
    gap: 12px !important;
  }

  /* تحويل اللّاي أوت إلى عمود واحد */
  .lp-wrap {
    grid-template-columns: 1fr !important;
  }

  /* Sidebar (الفلاتر) كـ "App Card" أعلى النتائج */
  .lp-sidebar {
    position: relative !important;
    top: auto !important;
    border-radius: 16px !important;
    padding: 12px !important;
  }

  /* اجعل الفلاتر مرتبة ومساحتها أقل */
  .lp-sidebar [style*="padding: 10px 0"] {
    padding: 10px 0 !important;
  }

  /* أزرار الفلاتر (مسح الكل) */
  .lp-sidebar button {
    touch-action: manipulation;
  }

  /* TopBar */
  .lp-wrap main > div:first-child {
    border-radius: 16px !important;
    padding: 12px !important;
  }

  /* select: Full width على الموبايل */
  .lp-wrap select {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* كارد اللابتوب: عمود واحد */
  .lp-card {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 12px !important;
    border-radius: 16px !important;
  }

  /* الصورة: ارتفاع مناسب + radius أكبر */
  .lp-img {
    height: 180px !important;
    border-radius: 16px !important;
  }

  /* العنوان: لا يكون ضخم */
  .lp-card [style*="font-size: 18px"] {
    font-size: 16px !important;
    line-height: 1.35 !important;
  }

  /* spec grid: عمود واحد لتجنب الزحمة */
  .lp-card [style*="grid-template-columns: \"1fr 1fr\""],
  .lp-card [style*="gridTemplateColumns: \"1fr 1fr\""] {
    grid-template-columns: 1fr !important;
  }

  /* price column: يصبح صف أفقي (سعر + أزرار) */
  .lp-priceCol {
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* السعر: مثل badge */
  .lp-priceCol > div:first-child {
    font-size: 18px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    border: 1px solid var(--spb-border, #e5e7eb) !important;
    background: var(--spb-surface-2, #fafafa) !important;
    width: 100% !important;
    text-align: center !important;
  }

  /* actions: صفين */
  .lp-actions {
    display: grid !important;
    grid-template-columns: 1fr 52px 52px !important;
    gap: 10px !important;
    width: 100% !important;
    justify-content: start !important;
    align-items: center !important;
  }

  /* زر التفاصيل: full */
  .lp-actions button:first-child {
    width: 100% !important;
    min-width: 0 !important;
    padding: 12px 12px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
  }

  /* زر اليوتيوب + المفضلة: مربعات ثابتة */
  .lp-actions button:nth-child(2),
  .lp-actions button:nth-child(3) {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 480px) {
  /* الصفحة: شدّ المسافات */
  .lp-sidebar {
    padding: 12px !important;
    border-radius: 16px !important;
  }

  /* الحبوب Pills: Full width */
  .lp-sidebar [style*="display: flex"][style*="flex-wrap: wrap"] button {
    flex: 1 1 auto !important;
  }

  /* الكارد: أقل padding */
  .lp-card {
    padding: 11px !important;
  }

  .lp-img {
    height: 165px !important;
  }

  /* actions: التفاصيل صف كامل ثم تحتها زرين */
  .lp-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  .lp-actions button:first-child {
    grid-column: 1 / -1 !important;
  }

  .lp-actions button:nth-child(2),
  .lp-actions button:nth-child(3) {
    width: 100% !important;
    height: 46px !important;
  }
}
/* =========================
   AUTO BUILD (Mobile)
   ========================= */

@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  /* Page spacing */
  .ab-grid2{
    scroll-margin-top: 12px;
  }
  .ab-grid2{
    gap: 12px !important;
  }

  /* Make grid 1 column + tighter */
  .ab-grid2{
    grid-template-columns: 1fr !important;
  }
  .ab-grid2 > div{
    padding: 14px !important;
    border-radius: 16px !important;
  }

  /* Inputs: app-like + iOS no-zoom */
  .ab-grid2 input,
  .ab-grid2 select{
    font-size: 16px !important;
    border-radius: 14px !important;
  }

  /* Buttons: full width, better touch */
  .ab-btn{
    width: 100% !important;
    min-height: 48px !important;
    border-radius: 16px !important;
    transform: none !important;
  }
  .ab-btn.ab-btn-primary{
    padding: 14px 16px !important;
    font-size: 15px !important;
  }
  .ab-btn.ab-btn-ghost{
    padding: 13px 16px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .ab-grid2 > div{
    padding: 12px !important;
  }
  .ab-btn{
    min-height: 46px !important;
    border-radius: 14px !important;
  }
}
/* =========================
   AUTO BUILD – Hide helper text
   ========================= */

@media (max-width: 768px) {
  /* الوصف تحت عنوان الصفحة */
  div[style*="fontSize: 13.5"],
  div[style*="font-size: 13.5"] {
    display: none !important;
  }

  /* النصوص التوضيحية تحت الحقول (Budget / Use Case) */
  .ab-grid2 div[style*="fontSize: 12"],
  .ab-grid2 div[style*="font-size: 12"],
  .ab-grid2 div[style*="lineHeight: 1.7"],
  .ab-grid2 div[style*="line-height: 1.7"] {
    display: none !important;
  }
}
/* =========================
   AUTO BUILD – Hide footer note
   ========================= */

@media (max-width: 768px) {
  /* النص أسفل الأزرار */
  div[style*="borderTop"][style*="fontSize: 12.5"],
  div[style*="border-top"][style*="font-size: 12.5"] {
    display: none !important;
  }
}
/* =========================
   AUTO BUILD – Polish (Mobile)
   ========================= */

@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  /* container padding أقل */
  body .ab-grid2{
    margin-top: 8px !important;
  }

  /* Header card: ترتيب أنظف */
  .ab-btn.ab-btn-ghost{
    width: 100% !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
  }

  /* Main card look */
  .ab-grid2{
    gap: 12px !important;
  }

  .ab-grid2 > div{
    border-radius: 16px !important;
    padding: 14px !important;
    background: var(--spb-cardSoft, #fafafa) !important;
  }

  /* input/select wrapper: أنعم */
  .ab-grid2 input,
  .ab-grid2 select{
    font-size: 16px !important;
    border-radius: 14px !important;
  }

  /* Actions: CTA + spacing */
  .ab-btn{
    width: 100% !important;
    min-height: 48px !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .ab-btn.ab-btn-primary{
    padding: 14px 16px !important;
  }

  /* card shadow أخف على الموبايل */
  div[style*="boxShadow"][style*="borderRadius: 18"]{
    box-shadow: 0 10px 24px rgba(0,0,0,0.08) !important;
    border-radius: 18px !important;
  }

  /* تقليل الفراغات داخل الصفحة */
  div[style*="maxWidth: 1100"]{
    padding: 0 10px !important;
  }
}

@media (max-width: 480px) {
  /* tighter */
  div[style*="maxWidth: 1100"]{
    padding: 0 8px !important;
  }

  .ab-grid2 > div{
    padding: 12px !important;
  }

  .ab-btn{
    min-height: 46px !important;
    border-radius: 14px !important;
  }

  /* CTA أقل ارتفاع */
  .ab-btn.ab-btn-primary{
    padding: 13px 14px !important;
  }
}
/* =========================
   AUTO BUILD – Budget hint only
   ========================= */

@media (max-width: 768px) {
  /* نخفي كل الشروحات افتراضيًا */
  .ab-grid2 div[style*="fontSize: 12"],
  .ab-grid2 div[style*="font-size: 12"],
  .ab-grid2 div[style*="lineHeight"],
  .ab-grid2 div[style*="line-height"] {
    display: none !important;
  }

  /* نُظهر توضيح الميزانية فقط (أول field) */
  .ab-grid2 > div:first-child div:last-child {
    display: block !important;
    margin-top: 6px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    color: var(--spb-muted, #6b7280) !important;
  }
}
/* =========================
   AUTO BUILD – Budget hint (parentheses only)
   ========================= */

@media (max-width: 768px) {
  /* إخفاء النص الأصلي */
  .ab-grid2 > div:first-child div:last-child {
    font-size: 0 !important;
  }

  /* إظهار ما داخل الأقواس فقط */
  .ab-grid2 > div:first-child div:last-child::after {
    content: "(أقل ميزانية: 2500 د.ل)";
    font-size: 12px;
    font-weight: 800;
    color: var(--spb-muted, #6b7280);
    display: block;
    margin-top: 6px;
  }
}
/* =========================
   NAVBAR – Mobile polish
   ========================= */

@media (max-width: 860px) {
  html, body { overflow-x: hidden; }

  /* navbar spacing */
  header[style*="spb-nav-bg"] nav {
    padding: 10px 12px !important;
    gap: 10px !important;
  }

  /* brand أصغر + يمنع قص */
  header[style*="spb-nav-bg"] nav a[title="Smart PC Builder"] {
    font-size: 15px !important;
    max-width: 55vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* أزرار اليمين (Dark/Light + menu) */
  header[style*="spb-nav-bg"] button {
    padding: 10px 12px !important;
    font-size: 12.5px !important;
    border-radius: 999px !important;
  }

  /* خلي زر القائمة يظهر فعلياً (عندك style inline display:none) */
  .spb-show-mobile {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Drawer: سلاسة أكثر */
@media (max-width: 860px) {
  .spb-drawer {
    width: min(92vw, 340px) !important;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    overflow: hidden;
  }

  .spb-drawer-body {
    padding: 12px 12px 16px !important;
    gap: 10px !important;
  }

  .spb-drawer-section {
    border-radius: 16px !important;
    padding: 12px !important;
  }

  .spb-drawer-link {
    padding: 12px 12px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
  }

  .spb-overlay {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}
/* =========================
   PERFORMANCE VIDEOS – Mobile polish
   ========================= */

@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  /* كارد الفيديوهات */
  [data-pv-grid="1"]{
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* تقليل padding للكارد الرئيسي (الأب الذي يحتوي data-pv-grid) */
  [data-pv-grid="1"]{
    margin-top: 6px;
  }
  [data-pv-grid="1"]{
    max-width: 100%;
  }

  /* الفيديو كارد: radius + shadow أخف */
  [data-pv-card="1"]{
    border-radius: 16px !important;
    box-shadow: var(--spb-shadowXs, 0 6px 18px rgba(0,0,0,0.06)) !important;
    transform: none !important;
  }

  /* الميتا: سلاسة أكثر */
  [data-pv-card="1"] > div:last-child{
    padding: 12px !important;
  }

  /* العنوان: سطرين بدون قص مزعج */
  [data-pv-card="1"] [title]{
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  [data-pv-grid="1"]{
    gap: 10px !important;
  }

  /* خفّف ارتفاع نص العنوان */
  [data-pv-card="1"] div[style*="minHeight: 40"]{
    min-height: 34px !important;
  }
}
/* ===============================
   Laptop Performance Videos
   Hide API note
   =============================== */

/* يخفي السطر النصي أسفل الفيديوهات */
main div[style*="font-weight: 800"][style*="font-size: 12px"] {
  display: none !important;
}
/* ===============================
   Laptop Performance Videos – UI polish
   =============================== */

/* الكارد الرئيسي */
.lp-performance-card {
  border-radius: 18px;
  box-shadow: var(--spb-shadowSm);
  background: var(--spb-card);
}

/* الهيدر */
.lp-performance-header {
  border-bottom: 1px solid var(--spb-border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

/* عنوان الصفحة */
.lp-performance-title {
  font-size: 16px;
  font-weight: 950;
  color: var(--spb-text);
}

/* اسم اللابتوب */
.lp-performance-sub {
  font-size: 13px;
  font-weight: 800;
  color: var(--spb-muted);
}

/* كروت الفيديو */
.lp-video-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--spb-surface-2);
  border: 1px solid var(--spb-border);
  transition: transform .15s ease, box-shadow .15s ease;
}

@media (hover:hover) {
  .lp-video-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--spb-shadowSm);
  }
}

/* عنوان الفيديو */
.lp-video-title {
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.6;
  color: var(--spb-text);
}

/* اسم القناة */
.lp-video-channel {
  font-size: 12px;
  font-weight: 800;
  color: var(--spb-muted);
}

/* زر الرجوع */
.lp-back-btn {
  border-radius: 12px;
  font-weight: 900;
}

/* موبايل */
@media (max-width: 720px) {
  .lp-performance-title {
    font-size: 15px;
  }

  .lp-video-title {
    font-size: 12px;
  }
}
/* ===============================
   LaptopDetails – Mobile Polish
   Works with inline-styles pages
   =============================== */

@media (max-width: 820px){

  /* مساحة الصفحة */
  main.main-content{
    padding: 12px !important;
  }

  /* اجعل كل الكروت أنعم */
  main.main-content [style*="border-radius: 16px"][style*="box-shadow"]{
    border-radius: 18px !important;
  }

  /* Header: خليها Column */
  main.main-content [style*="justify-content: space-between"][style*="align-items: flex-start"],
  main.main-content [style*="align-items: center"][style*="gap: 12px"][style*="padding: 14px"]{
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* زر الرجوع */
  main.main-content button[style*="← رجوع"],
  main.main-content button[style*="رجوع"]{
    width: 100% !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
  }

  /* priceBox: خليه full width */
  main.main-content [style*="margin-inline-start: auto"][style*="text-align: left"]{
    margin-inline-start: 0 !important;
    width: 100% !important;
    text-align: right !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    gap: 10px !important;
  }

  /* Grid الرئيسي: عمود واحد */
  main.main-content .spb-grid{
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  main.main-content .spb-aside{
    order: -1 !important; /* الصورة فوق */
  }

  /* الغِ sticky للموبايل */
  main.main-content [style*="position: sticky"]{
    position: static !important;
    top: auto !important;
  }

  /* الصورة: ارتفاع أقل + contain */
  main.main-content [style*="height: 240px"]{
    height: 200px !important;
    border-radius: 16px !important;
  }

  /* Specs: خليها عمود واحد */
  main.main-content [style*="grid-template-columns: 1fr 1fr"]{
    grid-template-columns: 1fr !important;
  }

  /* specItem: padding أفضل */
  main.main-content [style*="border-radius: 12px"][style*="padding: 10px"]{
    padding: 12px !important;
    border-radius: 14px !important;
  }

  /* زر العودة للقائمة */
  main.main-content button[style*="العودة للقائمة"]{
    padding: 12px 14px !important;
    border-radius: 14px !important;
  }
}
/* =========================
   PC Viewer — Mobile Pro
   ========================= */

.spb-viewer{
  height: min(84vh, 980px) !important;
  min-height: 560px !important;
}

/* Safe areas (iPhone notch/home bar) */
.spb-viewer__brand,
.spb-viewer__controls,
.spb-viewer__dock,
.spb-viewer__panel{
  padding-top: env(safe-area-inset-top) !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
}

/* Top brand text */
.spb-viewer__brand{
  left: 12px !important;
  top: 10px !important;
  font-size: 13px !important;
}

/* Top right controls */
.spb-viewer__controls{
  right: 12px !important;
  top: 10px !important;
  gap: 8px !important;
}

/* buttons smaller on mobile */
@media (max-width: 520px){
  .spb-viewer{
    height: 72vh !important;
    min-height: 520px !important;
    border-radius: 16px !important;
  }

  .spb-viewer__brand{
    font-size: 12.5px !important;
  }

  .spb-viewer__controls > div{
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
  }

  /* Bottom dock -> compact + scroll if needed */
  .spb-viewer__dock{
    bottom: 10px !important;
    padding: 8px !important;
    gap: 8px !important;
    max-width: calc(100% - 16px) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none;
  }
  .spb-viewer__dock::-webkit-scrollbar{ display:none; }

  /* Make pills tighter */
  .spb-viewer__dock > div{
    padding: 7px 9px !important;
    border-radius: 12px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }

  /* Active check mark box smaller */
  .spb-viewer__dock > div:last-child{
    width: 36px !important;
    height: 34px !important;
    border-radius: 12px !important;
  }

  /* Panels (RGB / View) -> Bottom Sheet instead of left box */
  .spb-viewer__panel{
    left: 10px !important;
    right: 10px !important;
    width: auto !important;

    bottom: 62px !important; /* فوق الدوك */
    border-radius: 16px !important;
    padding: 12px !important;
    max-height: 45vh !important;
    overflow: auto !important;
  }
}

/* Ultra small screens */
@media (max-width: 380px){
  .spb-viewer{
    min-height: 500px !important;
  }
  .spb-viewer__dock{
    bottom: 8px !important;
  }
  .spb-viewer__panel{
    bottom: 58px !important;
    max-height: 48vh !important;
  }
}
/* ===== 3D VIEWER – FIX BOTTOM CONTROLS (MOBILE) ===== */
@media (max-width: 768px) {
  /* bar container */
  div[style*="backdrop-filter"] {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  /* buttons */
  div[style*="backdrop-filter"] > div {
    flex-direction: row !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    writing-mode: horizontal-tb !important;
    font-size: 12px !important;
    padding: 10px !important;
  }
}
/* ===============================
   3D Viewer - Fix stuck panels (mobile)
   =============================== */

/* 1) ارفع شريط الأزرار السفلي فوق أي لوحة (RGB / View) */
@media (max-width: 820px) {
  /* شريط الأزرار السفلي (اللي فيه View / RGB / Case) */
  div[style*="backdrop-filter: blur(8px)"][style*="bottom: 16px"]{
    z-index: 9999 !important;
  }

  /* لوحات الإعدادات (RGB Settings / View Options) */
  div[style*="backdrop-filter: blur(10px)"][style*="width: 260px"]{
    z-index: 9998 !important;

    /* 2) خليها ما تغطي الشريط السفلي */
    bottom: 86px !important;

    /* 3) لو طولت بالهاتف، خليها قابلة للتمرير */
    max-height: calc(100vh - 160px) !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;

    /* 4) امنع مشاكل كسر النص الغريب */
    word-break: normal !important;
    overflow-wrap: anywhere !important;
  }
}
/* =========================================================
   SmartRecommendations - Professional Mobile CSS Overrides
   (Works even with inline styles via !important)
   ========================================================= */

/* 1) كروت التوصيات: شكل احترافي + تباعد + لمسة hover */
[data-sr-card="1"]{
  border-radius: 18px !important;
  padding: 16px !important;
  border: 1px solid var(--spb-border, #e5e7eb) !important;
  background: var(--spb-card, #fff) !important;
  box-shadow: var(--spb-shadowSm, 0 12px 28px rgba(0,0,0,0.08)) !important;
}

@media (hover:hover){
  [data-sr-card="1"]:hover{
    transform: translateY(-2px) !important;
    box-shadow: var(--spb-shadowMd, 0 22px 60px rgba(0,0,0,0.14)) !important;
  }
}

/* 2) ترتيب الشريط العلوي داخل الكارت (Pills) */
[data-sr-card="1"] span{
  line-height: 1.2 !important;
}

/* 3) الأزرار داخل الكارت: خليها full-width على الموبايل */
@media (max-width: 720px){
  [data-sr-card="1"] button{
    width: 100% !important;
    justify-content: center !important;
  }
  [data-sr-card="1"] div[style*="display: flex"][style*="gap: 10px"]{
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* 4) تحسين النصوص (منع التقطيع الغريب) */
[data-sr-card="1"],
[data-sr-card="1"] *{
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

/* 5) Modal Overlay: تثبيت وظهور فوق كل شيء */
div[style*="position: fixed"][style*="inset: 0"][style*="zIndex: 2000"]{
  z-index: 99999 !important;
  padding: 14px !important;
}

/* 6) Modal نفسها: عرض ممتاز للموبايل + سكرول */
div[style*="maxHeight: 88vh"][style*="overflow: auto"][style*="direction: rtl"]{
  width: min(980px, 100%) !important;
  max-width: 980px !important;
  max-height: calc(100vh - 120px) !important;
  overflow: auto !important;
  border-radius: 18px !important;
  -webkit-overflow-scrolling: touch !important;
}

/* 7) Grid داخل Modal: عمود واحد على الشاشات الصغيرة */
@media (max-width: 720px){
  div[style*="gridTemplateColumns: repeat(auto-fill, minmax(260px, 1fr))"]{
    grid-template-columns: 1fr !important;
  }
}

/* 8) بطاقات البدائل داخل Modal */
[data-sr-alt="1"]{
  border-radius: 16px !important;
  padding: 14px !important;
  box-shadow: var(--spb-shadowXs, 0 8px 22px rgba(15,23,42,0.06)) !important;
}

@media (hover:hover){
  [data-sr-alt="1"]:hover{
    transform: translateY(-2px) !important;
    box-shadow: var(--spb-shadowSm, 0 12px 28px rgba(0,0,0,0.10)) !important;
  }
}

/* 9) تحسين صف السعر + الفرق (delta pill) على الموبايل */
@media (max-width: 720px){
  [data-sr-alt="1"] div[style*="display: flex"][style*="alignItems: center"]{
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  [data-sr-alt="1"] div[style*="borderRadius: 999px"]{
    margin-right: 0 !important;
  }
}

/* 10) إحصائيات أسفل الصفحة: غالباً inline gridTemplateColumns: repeat(3...)
       نجعلها عمود واحد على الموبايل */
@media (max-width: 720px){
  div[style*="gridTemplateColumns: repeat(3, minmax(0, 1fr))"]{
    grid-template-columns: 1fr !important;
  }
}
/* =========================================================
   AdminPanel - Professional Mobile/Responsive CSS Overrides
   (CSS-only, works with inline styles via attribute selectors)
   ========================================================= */

/* 1) Page padding أقل على الموبايل */
@media (max-width: 768px){
  div[style*="direction: rtl"][style*="minHeight: 100vh"][style*="padding: 26px 18px"]{
    padding: 14px 10px !important;
  }
}

/* 2) كروت الهيدر/الأقسام: أقل padding على الموبايل */
@media (max-width: 768px){
  div[style*="borderRadius: 18"][style*="boxShadow"][style*="padding: 14px"]{
    padding: 12px !important;
    border-radius: 16px !important;
  }
}

/* 3) تحسين أزرار التبويب (Tabs) على الموبايل: full width */
@media (max-width: 600px){
  button[style*="borderRadius: 12"][style*="fontWeight: 900"][style*="padding: 10px 14px"]{
    width: 100% !important;
  }
}

/* 4) Search inputs: عرض كامل + منع تضخم */
@media (max-width: 768px){
  input[style*="borderRadius: 999"][style*="padding: 12px 16px"]{
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* 5) جدول الأدمن: سكرول أفقي أنعم + تثبيت المسافات */
div[style*="overflowX: auto"]{
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable both-edges !important;
}

/* 6) جدول: تصغير Padding داخل th/td على الموبايل */
@media (max-width: 768px){
  table th{
    padding: 12px 10px !important;
    font-size: 13px !important;
  }
  table td{
    padding: 12px 10px !important;
    font-size: 13.5px !important;
  }
}

/* 7) صور الجدول: أصغر على الموبايل */
@media (max-width: 768px){
  table img[style*="width: 64"][style*="height: 64"]{
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
    padding: 5px !important;
  }
}

/* 8) خلية الاسم: منع تمدد زائد + سطرين فقط (اختياري) */
@media (max-width: 768px){
  td[style*="maxWidth: 460"] div{
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
}

/* 9) أزرار (تعديل/حذف) داخل الجدول: تصبح عمودياً على الموبايل */
@media (max-width: 768px){
  td[style*="width: 190"] div[style*="display: flex"][style*="gap: 10px"]{
    flex-direction: column !important;
    align-items: stretch !important;
  }
  td[style*="width: 190"] button{
    width: 100% !important;
    justify-content: center !important;
  }
}

/* 10) Modal Overlay: أعلى z-index (حتى لا ينغطي) */
div[style*="position: fixed"][style*="inset: 0"][style*="zIndex: 1000"]{
  z-index: 99999 !important;
  padding: 12px !important;
}

/* 11) Modal Container: عرض كامل على الموبايل + سكرول */
@media (max-width: 768px){
  div[style*="maxWidth: 820"][style*="maxHeight: 92vh"][style*="overflowY: auto"]{
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 90px) !important;
    border-radius: 16px !important;
    padding: 14px !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* 12) Grid داخل الفورم (1fr 1fr): يتحول لعمود واحد على الموبايل */
@media (max-width: 768px){
  form div[style*="display: grid"][style*="gridTemplateColumns: 1fr 1fr"]{
    grid-template-columns: 1fr !important;
  }
}

/* 13) Inputs داخل المودال: تحسين حجم وتباعد */
@media (max-width: 768px){
  form input{
    font-size: 14px !important;
    padding: 12px !important;
    border-radius: 14px !important;
  }
  form label{
    font-size: 12.5px !important;
  }
}

/* 14) صف أزرار الحفظ/إلغاء داخل المودال: عمودين أو عمود واحد */
@media (max-width: 520px){
  form div[style*="justifyContent: flex-end"][style*="gap: 10px"]{
    flex-direction: column !important;
    align-items: stretch !important;
  }
  form div[style*="justifyContent: flex-end"][style*="gap: 10px"] button{
    width: 100% !important;
  }
}

/* 15) بطاقات الفئات (Category Cards): Touch-friendly */
@media (max-width: 768px){
  button[style*="borderRadius: 16"][style*="padding: 14px 14px"]{
    padding: 12px !important;
    border-radius: 16px !important;
  }
}

/* 16) تحسين عام: منع قص النصوص داخل الصفحة */
div[style*="direction: rtl"]{
  overflow-wrap: anywhere !important;
}


