/* ==========================================================
   تنين العرب — CSS الكامل (v4)
   يستبدل كل ما في خانة CSS. امسح القديم كاملاً والصق هذا.
   ========================================================== */

:root {
  --tn-red: #ed1c24;
  --tn-ink: #0d0f12;
  --tn-muted: #7c8590;
  --tn-hairline: #ececef;
  --tn-wash: #f6f7f8;
}


/* ==========================================================
   1) الشريط العلوي الأسود (يُحقن بالـJS)
   ========================================================== */

.tn-topbar {
  background: var(--tn-ink);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: .2px;
  padding: 9px 0;
}

.tn-topbar__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.tn-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: .88;
}

.tn-topbar__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--tn-red);
  flex: none;
}

@media (max-width: 600px) {
  .tn-topbar__inner { gap: 18px; font-size: 11.5px; }
  .tn-topbar__item:nth-child(n+3) { display: none; }
}


/* ==========================================================
   2) الهيدر
   ========================================================== */

.s-header,
header.store-header,
#mainnav {
  background: rgba(255, 255, 255, .92) !important;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--tn-hairline) !important;
  box-shadow: none !important;
  transition: box-shadow .3s ease, background .3s ease;
}

body.tn-scrolled .s-header,
body.tn-scrolled header.store-header,
body.tn-scrolled #mainnav {
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: 0 1px 0 var(--tn-hairline), 0 12px 32px -12px rgba(13, 15, 18, .16) !important;
}


/* ==========================================================
   3) الشعار
   ========================================================== */

.s-header img[src*="logos"],
.store-logo img,
.header-logo img,
a[href="/"] > img {
  height: 66px !important;
  width: auto !important;
  max-width: 220px !important;
  object-fit: contain !important;
  transition: opacity .25s ease;
}

.s-header img[src*="logos"]:hover,
.store-logo img:hover { opacity: .82; }

@media (max-width: 767px) {
  .s-header img[src*="logos"],
  .store-logo img,
  .header-logo img { height: 46px !important; max-width: 158px !important; }
}


/* ==========================================================
   4) روابط القائمة
   ========================================================== */

.main-menu a,
.s-header nav a {
  position: relative;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: .1px;
  color: var(--tn-ink) !important;
  padding: 12px 4px !important;
  margin-inline: 14px !important;
  transition: color .22s ease;
}

.main-menu a::after,
.s-header nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 2px;
  height: 1.5px;
  background: var(--tn-red);
  transform: scaleX(0);
  transform-origin: inline-end;
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}

.main-menu a:hover::after,
.s-header nav a:hover::after {
  transform: scaleX(1);
  transform-origin: inline-start;
}


/* ==========================================================
   5) شريط البحث — محدود العرض، بلا حد أسود
   ========================================================== */

.s-header .s-search,
.s-header salla-search,
salla-search {
  display: block;
  max-width: 560px;
  margin: 0 auto;
  padding-block: 10px;
}

.s-search-input,
salla-search input,
.s-header input[type="search"],
input[placeholder*="البحث"] {
  height: 46px !important;
  padding-inline-start: 22px !important;
  padding-inline-end: 48px !important;
  background: #f4f5f7 !important;
  border: 1.5px solid transparent !important;
  border-radius: 999px !important;
  font-size: 14.5px !important;
  font-weight: 500 !important;
  color: var(--tn-ink) !important;
  box-shadow: none !important;
  transition: border-color .24s ease, background .24s ease, box-shadow .24s ease;
}

.s-search-input::placeholder,
salla-search input::placeholder,
input[placeholder*="البحث"]::placeholder {
  color: #9aa2ac !important;
  font-weight: 500;
}

.s-search-input:hover,
salla-search input:hover,
input[placeholder*="البحث"]:hover {
  background: #eef0f3 !important;
}

.s-search-input:focus,
salla-search input:focus,
.s-header input[type="search"]:focus,
input[placeholder*="البحث"]:focus {
  background: #fff !important;
  border-color: var(--tn-ink) !important;
  box-shadow: 0 8px 26px -14px rgba(13, 15, 18, .38) !important;
  outline: none !important;
}

.s-search-icon,
salla-search button,
salla-search svg,
.s-header .search-icon {
  color: #9aa2ac !important;
  transition: color .22s ease;
}

salla-search:focus-within svg,
salla-search:focus-within button {
  color: var(--tn-red) !important;
}

@media (max-width: 767px) {
  .s-header .s-search,
  .s-header salla-search,
  salla-search {
    max-width: 100%;
    padding-inline: 14px;
  }
  .s-search-input,
  salla-search input,
  input[placeholder*="البحث"] {
    height: 42px !important;
    font-size: 14px !important;
  }
}


/* ==========================================================
   6) أيقونات السلة والحساب
   ========================================================== */

.s-header a[href*="cart"],
.s-header a[href*="profile"],
.s-header a[href*="wishlist"],
.header-btn {
  width: 42px !important;
  height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: 1px solid var(--tn-hairline) !important;
  color: var(--tn-ink) !important;
  transition: border-color .22s ease, background .22s ease, color .22s ease;
}

.s-header a[href*="cart"]:hover,
.s-header a[href*="profile"]:hover,
.s-header a[href*="wishlist"]:hover,
.header-btn:hover {
  background: var(--tn-ink) !important;
  border-color: var(--tn-ink) !important;
  color: #fff !important;
}

.s-cart-summary-count,
.cart-count,
.s-header .badge {
  background: var(--tn-red) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 10.5px !important;
  min-width: 18px !important;
  height: 18px !important;
  line-height: 18px !important;
  border-radius: 999px !important;
  border: 2px solid #fff !important;
}


/* ==========================================================
   7) إزالة المسافة بين الهيدر والغلاف
   ========================================================== */

.s-header + div:empty,
header + div:empty,
header + section:empty,
#mainnav + div:empty,
.s-header ~ div:empty {
  display: none !important;
}

.s-header + section,
header.store-header + section,
#mainnav + section,
main > section:first-child,
main > div:first-child,
.s-block--fixed-banner,
.s-block--slider-banner {
  margin-top: 0 !important;
}

main, .main-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}


/* ==========================================================
   8) إلغاء أي أثر من زر البحث المنسدل (v3 الملغى)
   ========================================================== */

.tn-searchToggle,
.tn-searchPanel {
  display: none !important;
}


/* ==========================================================
   9) وصول
   ========================================================== */

.s-header a:focus-visible,
.s-header button:focus-visible {
  outline: 2px solid var(--tn-ink) !important;
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .s-header *,
  .main-menu a::after,
  .s-search-input,
  salla-search input { transition: none !important; }
}

/* ==========================================================
   تنين العرب — إصلاحات (v5)
   يُضاف في نهاية ملف CSS الحالي (لا تحذف ما قبله)
   ========================================================== */


/* ==========================================================
   [1] نص شريط البحث — محاذاة صحيحة
   ========================================================== */

/* الحاوية: نجعلها مرجعاً للأيقونة */
.s-header .s-search,
.s-header salla-search,
salla-search {
  position: relative !important;
  max-width: 560px !important;
  margin: 0 auto !important;
  padding-block: 8px !important;
}

/* الحقل: النص يبدأ من اليمين مباشرة */
.s-search-input,
salla-search input,
.s-header input[type="search"],
input[placeholder*="البحث"] {
  width: 100% !important;
  height: 46px !important;
  line-height: 46px !important;

  /* المفتاح: مسافة كبيرة يميناً للنص، صغيرة يساراً */
  padding: 0 !important;
  padding-inline-start: 20px !important;
  padding-inline-end: 46px !important;

  text-align: start !important;
  direction: rtl !important;

  background: #f4f5f7 !important;
  border: 1.5px solid transparent !important;
  border-radius: 999px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #0d0f12 !important;
  box-shadow: none !important;
  transition: border-color .24s ease, background .24s ease, box-shadow .24s ease;
}

.s-search-input::placeholder,
salla-search input::placeholder,
input[placeholder*="البحث"]::placeholder {
  color: #9aa2ac !important;
  font-weight: 500 !important;
  text-align: start !important;
  opacity: 1 !important;
}

.s-search-input:hover,
salla-search input:hover,
input[placeholder*="البحث"]:hover {
  background: #eef0f3 !important;
}

.s-search-input:focus,
salla-search input:focus,
.s-header input[type="search"]:focus,
input[placeholder*="البحث"]:focus {
  background: #fff !important;
  border-color: #0d0f12 !important;
  box-shadow: 0 8px 26px -14px rgba(13, 15, 18, .38) !important;
  outline: none !important;
}

/* الأيقونة: تُثبَّت على اليسار ولا تزاحم النص */
.s-header salla-search button,
.s-header salla-search .s-search-icon,
.s-header .s-search button,
.s-header .search-icon {
  position: absolute !important;
  inset-inline-start: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  width: 22px !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #9aa2ac !important;
  z-index: 2;
  transition: color .22s ease;
}

salla-search:focus-within button,
salla-search:focus-within .s-search-icon,
.s-header .s-search:focus-within button {
  color: #ed1c24 !important;
}


/* ==========================================================
   [2] المسافة بين الهيدر والغلاف — استهداف بالارتفاع
   ========================================================== */

/* الشريط الرمادي: نصفّره سواء كان فارغاً أم لا */
.s-header + div,
header.store-header + div,
#mainnav + div {
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
}

/* الحالة الفارغة صراحةً */
.s-header + div:empty,
header + div:empty,
header + section:empty,
#mainnav + div:empty,
.s-header ~ div:empty {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

/* أقسام سلة الفارغة تحت الهيدر */
.s-block:empty,
section:empty,
div[class*="s-block"]:empty {
  display: none !important;
}

/* أول قسم في المحتوى */
main > *:first-child,
.main-content > *:first-child,
#app > main > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* البانر الرئيسي */
.s-block--fixed-banner,
.s-block--slider-banner,
.s-block--photos-slider {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

main,
.main-content,
#app > main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}


@media (max-width: 767px) {
  .s-header .s-search,
  .s-header salla-search,
  salla-search {
    max-width: 100% !important;
    padding-inline: 14px !important;
  }
  .s-search-input,
  salla-search input,
  input[placeholder*="البحث"] {
    height: 42px !important;
    line-height: 42px !important;
    font-size: 14px !important;
  }
  .s-header salla-search button,
  .s-header .search-icon {
    inset-inline-start: 26px !important;
  }
}

/* ==========================================================
   تنين العرب — إصلاح دقيق (v6)
   مبني على الفحص الفعلي لبنية الثيم
   ⚠️ احذف قسم v5 بالكامل من ملفك قبل إضافة هذا
   ========================================================== */


/* ==========================================================
   [1] شريط البحث — الأسماء الحقيقية
   salla-search > .s-search-modal > .s-search-container
                > .s-search-input-wrapper > input.s-search-input
   ========================================================== */

salla-search {
  display: block !important;
  max-width: 560px !important;
  margin: 0 auto !important;
  padding-block: 8px !important;
}

.s-search-modal,
.s-search-container.s-search-inline {
  width: 100% !important;
  max-width: 100% !important;
}

/* الحاوية المباشرة للحقل = مرجع تموضع الأيقونة */
.s-search-input-wrapper {
  position: relative !important;
  display: block !important;
  width: 100% !important;
}

/* الحقل */
.s-search-input {
  width: 100% !important;
  height: 46px !important;
  padding-inline-start: 20px !important;
  padding-inline-end: 48px !important;
  background: #f4f5f7 !important;
  border: 1.5px solid transparent !important;
  border-radius: 999px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #0d0f12 !important;
  text-align: start !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color .24s ease, background .24s ease, box-shadow .24s ease;
}

.s-search-input::placeholder {
  color: #9aa2ac !important;
  font-weight: 500 !important;
  opacity: 1 !important;
}

.s-search-input:hover {
  background: #eef0f3 !important;
}

.s-search-input:focus {
  background: #fff !important;
  border-color: #0d0f12 !important;
  box-shadow: 0 8px 26px -14px rgba(13, 15, 18, .38) !important;
}

/* كل ما ليس الحقل داخل الغلاف = الأيقونة/الزر → يُثبَّت يساراً */
.s-search-input-wrapper > *:not(.s-search-input) {
  position: absolute !important;
  inset-inline-start: 16px !important;
  inset-inline-end: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #9aa2ac !important;
  pointer-events: none;
  z-index: 2;
  transition: color .22s ease;
}

.s-search-input-wrapper > *:not(.s-search-input) svg {
  width: 18px !important;
  height: 18px !important;
}

.s-search-input-wrapper:focus-within > *:not(.s-search-input) {
  color: #ed1c24 !important;
}


/* ==========================================================
   [2] المسافة — داخل MAIN وليس بعد الهيدر
   ========================================================== */

header.store-header + main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* أول عنصر داخل main */
main > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* أقسام الثيم الفارغة في أعلى الصفحة */
main > div:empty,
main > section:empty,
main > .s-block:empty,
main > *:first-child:empty {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* أول قسمين داخل main: صفّر الحشو العلوي */
main > section:first-of-type,
main > div:first-of-type,
main > section:nth-child(1),
main > section:nth-child(2) {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* البانر الرئيسي */
.s-block--fixed-banner,
.s-block--slider-banner,
.s-block--photos-slider,
main > .s-block:first-of-type {
  margin-top: 0 !important;
  padding-top: 0 !important;
}


@media (max-width: 767px) {
  salla-search {
    max-width: 100% !important;
    padding-inline: 14px !important;
  }
  .s-search-input {
    height: 42px !important;
    font-size: 14px !important;
  }
}




<!--
  ARAB DRAGON — Homepage Search Bar Fix
  =====================================
  WHERE TO PASTE THIS:
  Salla Dashboard → Online Store → Design → Customize (theme: رائد)
  → Advanced / Custom Code (أكواد مخصصة) → CSS tab and JS tab.
  Your theme already has "custom_css_enabled" and "custom_js_enabled" ON,
  so this box exists — split the two sections below into their tabs.

  WHAT THIS DOES:
  - Restyles the search bar to match your dark/red brand identity.
  - Makes the "brand" (الماركة) dropdown actually work: clicking the
    button now sends the visitor to that brand's real category page.
  - "الموديل" (Model) and "السنة" (Year) are left visually styled but
    NOT wired to real filtering — there's no structured model/year data
    on your products yet, so they can't filter anything honestly.
    Either remove those two fields for now, or plan a follow-up project
    to tag products with structured vehicle fitment data.
-->


/* ====== CSS: paste into Custom CSS ====== */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: 14px;
  padding: 16px 20px;
  font-family: inherit; /* inherits the theme's Arabic font automatically */
  direction: rtl;
}

.search-bar .search-field {
  flex: 1 1 180px;
  min-width: 150px;
}

.search-bar .search-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: #171717
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ed1c24'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E")
    left 12px center / 16px no-repeat;
  color: #f5f5f5;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 12px 40px 12px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search-bar .search-select:hover {
  border-color: #ed1c24;
}

.search-bar .search-select:focus {
  outline: none;
  border-color: #ed1c24;
  box-shadow: 0 0 0 3px rgba(237, 28, 36, .25);
}

.search-bar .search-btn {
  flex: 1 1 160px;
  background: linear-gradient(135deg, #ed1c24, #b3141a);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s ease, transform .1s ease;
}

.search-bar .search-btn:hover { opacity: .9; }
.search-bar .search-btn:active { transform: scale(0.98); }

@media (max-width: 640px) {
  .search-bar { flex-direction: column; align-items: stretch; }
}



/* Search bar: sit on the hero image */
.s-block--bundle-hero-dragons + :not(section.s-block),
.s-block--bundle-hero-dragons > :not(salla-custom-component) {
  position: relative !important;
  z-index: 20 !important;
  margin-top: -110px !important;
  margin-bottom: 40px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* White card: even, compact padding */
.s-block--bundle-hero-dragons + :not(section.s-block) > *,
.s-block--bundle-hero-dragons > :not(salla-custom-component) > * {
  padding: 16px 20px !important;
  margin: 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  border-radius: 16px !important;
}

/* Mobile */
@media (max-width: 768px) {
  .s-block--bundle-hero-dragons + :not(section.s-block),
  .s-block--bundle-hero-dragons > :not(salla-custom-component) {
    margin-top: -40px !important;
  }
  .s-block--bundle-hero-dragons + :not(section.s-block) > *,
  .s-block--bundle-hero-dragons > :not(salla-custom-component) > * {
    padding: 14px !important;
  }
}