/* =====================================================================
   ksa-home.v3.css — كل تعديلات تصميم الصفحة الرئيسية في ملف واحد صغير.
   مربوط في index.html بعد ملفات الموقع الأساسية، فبيغلب عليها.
   لما تعدّل هنا بعد كده: غيّر الرقم في الاسم (v4, v5...) في الملف و
   index.html مع بعض — كده مستحيل أي كاش (متصفح أو CDN) يقدّم نسخة قديمة.
   ===================================================================== */
/* ===== KSA DALIL — كروت الشركات في كاروسيل الرئيسية =====
   (١) الشارات والتمييز الذهبي — على كل المقاسات.
   (٢) ضغط التخطيط — للموبايل بس، لأن قواعد #featured الأصلية كلها
       جوه @media(max-width:680px) والديسكتوب بيعرض ٣ كروت في صف. */

/* شارات: مميزة (ذهبي) + موثّق (تركوازي) */
.ks-card-flags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.ks-premium-badge.is-gold {
  color: #7a5406;
  background: linear-gradient(135deg, #ffe9a3, #f6cf62);
  border-color: #e9c15a;
}
.ks-premium-badge.is-check {
  color: #0b6b62;
  background: #e6f7f3;
  border-color: #bfe4db;
}

/* الشركة المميزة: حافة ذهبية وتظليل دافئ يميّزها */
#featured .ks-business-card.is-featured {
  border-color: #ecd28a !important;
  background: linear-gradient(150deg, #fffdf4 0%, #fff 42%, #f4fbf8 100%) !important;
  box-shadow: 0 10px 22px rgba(176, 134, 25, 0.13) !important;
}
#featured .ks-business-card.is-featured:before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 6px 6px 0;
  background: linear-gradient(#f3ce67, #e0a92f);
}

@media (max-width: 680px) {
  /* الكارت كان واخد ستايل الكروت الصغيرة (٣ في الصف) وهو معروض بعرض الشاشة:
     هوية متوسّطة عموديًا، خطوط صغيرة جدًا، وخدمات مخفية — فطلع طويل وفاضي
     من تحت. والكروت كانت بتتمطّط لطول أطولها فبيفضل فراغ في القصيّر. */
  #featured .ks-featured-carousel .ks-business-grid {
    align-items: flex-start !important;
  }
  /* نسيب طرف الكارت اللي بعده باين عشان الزائر يعرف إن في شركات تانية */
  #featured .ks-featured-carousel .ks-business-card {
    flex: 0 0 89% !important;
    width: 89% !important;
  }
  #featured .ks-business-card {
    padding: 12px 13px 13px !important;
    border-radius: 18px !important;
  }
  #featured .ks-premium-badge {
    padding: 4px 9px !important;
    font-size: 9px !important;
    border-radius: 999px !important;
  }

  /* صف الهوية أفقي بدل التوسيط العمودي */
  #featured .ks-business-identity {
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) auto !important;
    align-items: center !important;
    text-align: start !important;
    gap: 10px !important;
    margin-top: 9px !important;
  }
  #featured .ks-business-card .ks-business-logo {
    width: 54px !important;
    height: 54px !important;
    border-radius: 16px !important;
    font-size: 22px !important;
  }
  #featured .ks-business-identity h3 {
    font-size: 16px !important;
    margin-top: 2px !important;
  }
  #featured .ks-business-identity p {
    font-size: 10px !important;
  }
  /* "ملف موثّق" جوه الكارت مكرر مع شارة "موثّق" فوق — نسيب الشارة بس */
  #featured .ks-verified {
    display: none !important;
  }
  #featured .ks-rating {
    font-size: 10px !important;
  }

  #featured .ks-business-meta {
    justify-content: space-between !important;
    gap: 8px !important;
    margin-top: 10px !important;
    padding-block: 8px !important;
    font-size: 9.5px !important;
  }
  #featured .ks-business-description {
    margin: 9px 0 0 !important;
    min-height: 0 !important;
    font-size: 10.5px !important;
    line-height: 1.7 !important;
  }

  /* الخدمات كانت مخفية على الموبايل — ترجع تبان كتاجات صغيرة */
  #featured .ks-business-services {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-top: 8px !important;
    overflow: visible !important;
    white-space: normal !important;
  }
  #featured .ks-business-services span {
    padding: 3px 8px !important;
    font-size: 9px !important;
  }

  #featured .ks-business-actions {
    grid-template-columns: 1fr 46px 46px !important;
    gap: 6px !important;
    padding-top: 10px !important;
  }
  #featured .ks-business-actions button {
    display: flex !important;
    min-height: 38px !important;
    font-size: 11px !important;
  }
  #featured .ks-business-actions .is-contact,
  #featured .ks-business-actions .is-whatsapp {
    min-height: 38px !important;
  }
}

/* ===== ضبط الصفحة الرئيسية — موبايل =====
   الأرقام دي مقيسة من الموقع الحقيقي على مقاس 375px. */
@media (max-width: 680px) {
  /* (١) آخر قسم في الصفحة كان مخفي ورا النافبار وشريط التثبيت،
         لأن البودي معندهاش أي مسافة سفلية (نافبار 81px + شريط 41px). */
  .ks-app-shell main {
    padding-bottom: 136px !important;
  }

  /* (٢) كروت الكاروسيل كان طولها بيتراوح من 238 لـ 327 بكسل، فالكارت القصير
         بيسيب فراغ تحته. نثبّت الوصف سطرين والخدمات صف واحد والأزرار في
         القاع — فكل الكروت تطلع بنفس الطول. */
  #featured .ks-featured-carousel .ks-business-grid {
    align-items: stretch !important;
  }
  #featured .ks-featured-carousel .ks-business-card {
    display: flex !important;
    flex-direction: column !important;
  }
  #featured .ks-business-description {
    min-height: 36px !important;
  }
  #featured .ks-business-services {
    flex-wrap: nowrap !important;
    overflow: hidden !important;
    max-height: 23px !important;
  }
  #featured .ks-business-actions {
    margin-top: auto !important;
  }

  /* (٣) نقاط التنقّل تتلف في أكتر من سطر بدل ما تتزنق في سطر واحد */
  .ks-carousel-dots {
    flex-wrap: wrap !important;
    max-width: 100%;
    padding-inline: 14px;
    row-gap: 5px;
  }

  /* (٤) تبويب "المميزة" كان زرار ذهبي بعرض الشاشة كلها (341×49) وشكله
         زي زرار رئيسي — بقى شارة صغيرة. */
  .ks-featured-tabs {
    display: flex !important;
  }
  .ks-featured-tabs button {
    width: auto !important;
    min-height: 0 !important;
    padding: 6px 14px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
  }

  /* (٥) العنوان الرئيسي كان line-height 1.14 — ضيق على الحروف العربية */
  .ks-search-hero-copy h1 {
    line-height: 1.32 !important;
  }

  /* (٦) بانر الباقات: الوصف كان 7px قصاد عنوان 17px */
  .ks-premium-banner p {
    font-size: 10.5px !important;
    line-height: 1.7 !important;
  }
}

/* ===== فوتر الرئيسية: رؤية 2030 + حقوق الملكية ===== */
.ksa-site-footer {
  margin: 16px 13px 0;
  padding: 15px 14px 16px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff, #f6fbfa);
  border: 1px solid #e3eeeb;
  border-radius: 18px;
  box-shadow: 0 6px 16px rgba(7, 63, 65, 0.05);
}
.ksa-vision {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.ksa-vision img {
  display: block;
  height: 46px;
  width: auto;
}
.ksa-vision small {
  color: #6b8183;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.ksa-footer-line {
  height: 1px;
  max-width: 190px;
  margin: 12px auto;
  background: linear-gradient(90deg, transparent, #c5e0da 25%, #c5e0da 75%, transparent);
}
/* الفوتر بقى بيملا المساحة، فالفاصل الفاضي اللي بعده مبقاش له لزوم */
.ksa-site-footer + .ks-mobile-space {
  display: none !important;
}
.ksa-footer-legal {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ksa-footer-legal strong {
  color: #073f41;
  font-family: Cairo, Tajawal, sans-serif;
  font-size: 11.5px;
  font-weight: 900;
}
.ksa-footer-legal span {
  color: #8ea6a4;
  font-size: 9px;
  font-weight: 700;
}
.ksa-footer-dev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 11px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e6eeec;
  color: #7d9694;
  font-size: 8.5px;
  font-weight: 700;
  text-decoration: none;
}
.ksa-footer-dev img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.ksa-footer-dev b {
  color: #3c5c5a;
  font-weight: 900;
}
@media (max-width: 680px) {
  .ksa-site-footer {
    margin: 14px 11px 0;
    padding: 13px 12px 14px;
    border-radius: 16px;
  }
  .ksa-vision img {
    height: 40px;
  }
}

/* صف البيانات في كروت الشركات كان بيتلف سطرين (47px) مع البيانات الحقيقية
   الطويلة زي "يوميًا من ٧ ص حتى ١١ م" — بقى سطر واحد والزيادة بتتقطع بـ"…"،
   والبيانات كاملة موجودة في صفحة الشركة. */
@media (max-width: 680px) {
  #featured .ks-business-meta {
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }
  #featured .ks-business-meta span {
    display: block !important;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #featured .ks-business-meta span svg {
    display: inline-block;
    vertical-align: -2px;
    margin-inline-end: 3px;
  }
}

/* ===== بلوك الاستكشاف: الأقسام + الشركات في لوحة واحدة =====
   بدل قسمين منفصلين، لوحة بترولية واحدة: فوق شريط تابات الأقسام، وتحته
   كروت الشركات. الضغط على قسم بيفلتر الكروت في مكانها من غير ما الصفحة
   تتحرك، والقسم المختار بيتلوّن دهبي. */
#featured {
  position: relative;
  overflow: hidden;
  padding: 16px 0 12px !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 92% 6%, rgba(37, 210, 190, 0.26), transparent 34%),
    radial-gradient(circle at 6% 96%, rgba(233, 185, 73, 0.12), transparent 32%),
    linear-gradient(160deg, #063f41 0%, #075d58 55%, #087b70 100%) !important;
  box-shadow: 0 16px 32px rgba(7, 63, 65, 0.22) !important;
}
#featured .ks-section-heading {
  padding: 0 15px;
  margin-bottom: 11px !important;
}
#featured .ks-section-heading small {
  color: #8fe3d6 !important;
}
#featured .ks-section-heading h2 {
  color: #fff !important;
}
#featured .ks-text-action {
  color: #ffe08a !important;
  background: none !important;
  border: 0 !important;
}

/* شريط تابات الأقسام */
.ksa-cat-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 15px 13px;
  scroll-padding-inline: 15px;
  -webkit-overflow-scrolling: touch;
}
.ksa-cat-chips::-webkit-scrollbar {
  display: none;
}
.ksa-cat-chips button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-block: 4px;
  padding-inline: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
  color: #e8faf6;
  font: inherit;
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.15s;
}
.ksa-cat-chips button:active {
  transform: scale(0.95);
}
.ksa-cat-chips button > span {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
}
.ksa-cat-chips button > span svg {
  width: 14px;
  height: 14px;
}
.ksa-cat-chips b {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.ksa-cat-chips button.is-active {
  background: linear-gradient(135deg, #ffe98f, #f2c24c);
  border-color: #ffe58a;
  color: #3d2f05;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.18);
}
.ksa-cat-chips .ksa-all {
  color: #b07d12;
  font-size: 12px;
  font-weight: 900;
}
.ksa-cat-chips .mint {
  color: #0a958b;
}
.ksa-cat-chips .sky {
  color: #2c87b4;
}
.ksa-cat-chips .aqua {
  color: #278e95;
}
.ksa-cat-chips .rose {
  color: #bd6a82;
}
.ksa-cat-chips .sand {
  color: #b7872e;
}
.ksa-cat-chips .blue {
  color: #247fb5;
}
.ksa-cat-chips .cream {
  color: #8e7c36;
}
.ksa-cat-chips .violet {
  color: #7c65a8;
}
.ksa-cat-chips .gold {
  color: #b07d12;
}
.ksa-cat-chips .teal {
  color: #078f83;
}

/* الكروت على الخلفية الداكنة + النقاط والتلميح */
#featured .ks-carousel-dots button {
  background: rgba(255, 255, 255, 0.3);
}
#featured .ks-carousel-dots button.is-active {
  background: linear-gradient(90deg, #ffe08a, #f2c24c);
}
#featured .ks-carousel-hint {
  color: rgba(232, 250, 246, 0.62) !important;
}
#featured .ks-featured-carousel:after {
  display: none !important;
}
#featured .ks-empty-state {
  margin: 0 13px;
  border-radius: 16px;
}

@media (max-width: 680px) {
  #featured {
    margin-inline: 11px !important;
  }
  /* كروت أصغر: لوجو 44 بدل 54، أزرار 34 بدل 38، والخدمات اتشالت من
     الكارت لأن شريط الأقسام فوق بقى بيعرضها */
  #featured .ks-featured-carousel .ks-business-grid {
    margin: 0 11px !important;
    padding-bottom: 6px !important;
  }
  #featured .ks-business-card {
    padding: 10px 11px 11px !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16) !important;
    border-color: transparent !important;
  }
  #featured .ks-business-top > button {
    width: 28px !important;
    height: 28px !important;
    border-radius: 9px !important;
  }
  #featured .ks-premium-badge {
    padding: 3px 8px !important;
    font-size: 8.5px !important;
  }
  #featured .ks-business-identity {
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
    gap: 8px !important;
    margin-top: 7px !important;
  }
  #featured .ks-business-card .ks-business-logo {
    width: 44px !important;
    height: 44px !important;
    border-radius: 13px !important;
    font-size: 18px !important;
  }
  #featured .ks-business-identity h3 {
    font-size: 14.5px !important;
  }
  #featured .ks-business-identity p {
    font-size: 9.5px !important;
  }
  #featured .ks-rating {
    font-size: 9px !important;
    padding: 4px 6px !important;
  }
  #featured .ks-business-meta {
    margin-top: 8px !important;
    padding-block: 6px !important;
    font-size: 9px !important;
  }
  #featured .ks-business-description {
    margin: 7px 0 0 !important;
    min-height: 33px !important;
    font-size: 10px !important;
    line-height: 1.65 !important;
  }
  #featured .ks-business-services {
    display: none !important;
  }
  #featured .ks-business-actions {
    grid-template-columns: 1fr 40px 40px !important;
    gap: 6px !important;
    padding-top: 9px !important;
  }
  #featured .ks-business-actions button,
  #featured .ks-business-actions .is-contact,
  #featured .ks-business-actions .is-whatsapp {
    min-height: 34px !important;
    border-radius: 10px !important;
  }
  #featured .ks-business-actions button {
    font-size: 10.5px !important;
  }
  #featured .ks-business-actions svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* ===== اسم الشركة كان مقطوع في كل الكروت =====
   الاسم كان متاح له 128px بس (اللوجو + حبّاية التقييم واخدين الباقي)،
   وأسماء زي "شركة الاضواء السعودية لمكافحة الحشرات" محتاجة 314px.
   الحل: حبّاية التقييم طلعت فوق جنب زرار القلب (مساحة فاضية أصلًا)، والاسم
   بقى واخد عرض الصف كله (224px) ومسموح له بسطرين. */
#featured .ks-business-identity h3 {
  white-space: normal !important;
  text-overflow: clip !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4 !important;
  padding-bottom: 1px;
}
@media (max-width: 680px) {
  #featured .ks-business-identity {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 9px !important;
  }
  #featured .ks-business-identity h3 {
    font-size: 14px !important;
    margin-top: 0 !important;
  }
  #featured .ks-business-identity p {
    margin-top: 1px;
  }
  #featured .ks-rating {
    position: absolute !important;
    top: 14px !important;
    inset-inline-end: 45px !important;
    padding: 3px 7px !important;
    font-size: 9px !important;
    min-width: 0 !important;
  }
  /* "تقييم العملاء" — النجمة والرقم كفاية في المساحة دي */
  #featured .ks-rating small {
    display: none !important;
  }
}

/* ---- العضو المميز: إطار ذهبي خفيف على الكارت + شارة «عرض خاص» ---- */
.ks-business-card.is-featured {
  border-color: #e9c15a !important;
  box-shadow:
    0 0 0 1px #f3dc8c,
    0 12px 26px rgba(201, 138, 14, 0.15) !important;
}
.ks-business-card.is-featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #f6cf62, #c98a0e, #f6cf62);
  pointer-events: none;
  z-index: 1;
}
.ks-card-promo {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff1ec;
  border: 1px solid #f3c3b5;
  color: #9b2c24;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== تنسيق الرئيسية على اللاب توب والكمبيوتر (1024px+) — الموبايل زي ما هو ===== */
@media (min-width: 1024px) {
  /* الهيرو: البحث في النص، والعنوان أكبر، من غير فراغ فوق وتحت */
  .ks-hero.ks-hero-v2 {
    min-height: 0 !important;
    padding: 34px 0 30px !important;
    display: flex !important;
    justify-content: center;
  }
  .ks-search-console.ks-search-console-v2 {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
    width: min(1000px, 100%) !important;
    padding: 26px 28px !important;
    gap: 14px !important;
  }
  .ks-search-hero-copy h1 {
    font-size: 30px !important;
    line-height: 1.35 !important;
  }
  .ks-search-hero-copy p {
    font-size: 15.5px !important;
  }
  .ks-search-input {
    min-height: 58px;
  }
  .ks-primary-action {
    min-height: 54px;
  }

  /* قسم الشركات المميزة: مسافة جوه اللوحة، والتصنيفات تنزل سطر بدل ما تتقص */
  .ks-content-section,
  #featured {
    padding: 22px 24px 18px !important;
  }
  .ksa-cat-chips {
    flex-wrap: wrap !important;
    overflow: visible !important;
    row-gap: 8px;
  }
  .ks-business-grid {
    gap: 18px !important;
    align-items: stretch;
  }

  /* الكارت: الاسم ياخد مساحته كاملة والتقييم تحته */
  .ks-business-card.is-grid .ks-business-identity {
    grid-template-columns: 56px 1fr !important;
    row-gap: 6px;
  }
  .ks-business-card.is-grid .ks-business-identity > .ks-rating {
    grid-column: 2;
    justify-self: start;
  }
  .ks-business-card.is-grid .ks-business-identity h3 {
    white-space: normal !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ks-business-card.is-grid .ks-business-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* الأزرار: اتصال + واتساب جنب بعض، والتفاصيل تحتهم بعرض الكارت */
  .ks-business-card.is-grid .ks-business-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-top: auto;
  }
  .ks-business-card.is-grid .ks-business-actions > .is-contact {
    order: 1;
    grid-column: auto !important;
  }
  .ks-business-card.is-grid .ks-business-actions > .is-whatsapp {
    order: 2;
    grid-column: auto !important;
  }
  .ks-business-card.is-grid .ks-business-actions > button {
    order: 3;
    grid-column: 1 / -1 !important;
  }
  .ks-business-card.is-grid .ks-business-actions > * {
    min-height: 46px;
    margin: 0 !important;
    width: 100% !important;
  }
}
