/*
 * FiboSearch PRO × Khabco
 */
:root {
  --fs-primary:      #0f4f59;
  --fs-primary-soft: #eaf6f8;
  --fs-accent:       #96d62b;
  --fs-accent-dark:  #7aba1e;
  --fs-text:         #1a2e32;
  --fs-muted:        #6b8a90;
  --fs-border:       #e8eef0;
  --fs-white:        #ffffff;
  --fs-bg-soft:      #f5f9fa;
  --fs-font:         'iransansxv','iransansx',Tahoma,sans-serif;
  --fs-radius:       16px;
  --fs-shadow:       0 12px 40px rgba(15,79,89,.15);
}

/* ══ dropdown ══ */
.dgwt-wcas-suggestions-wrapp {
  background: var(--fs-white) !important;
  border: none !important;
  border-radius: var(--fs-radius) !important;
  box-shadow: var(--fs-shadow) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: 600px !important;
  padding: 0 0 4px !important;
  margin-top: 8px !important;
  scrollbar-width: thin !important;
  scrollbar-color: var(--fs-border) transparent !important;
  direction: rtl !important;
}
.dgwt-wcas-suggestions-wrapp::-webkit-scrollbar { width: 4px; }
.dgwt-wcas-suggestions-wrapp::-webkit-scrollbar-thumb { background: var(--fs-border); border-radius: 4px; }

/* ══ اسکرول داخلی ══ */
.kh-section-scroll {
  max-height: 212px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--fs-border) transparent;
}
.kh-section-scroll::-webkit-scrollbar { width: 3px; }
.kh-section-scroll::-webkit-scrollbar-thumb { background: var(--fs-border); border-radius: 3px; }

/* ══ عناوین بخش‌ها ══ */
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-headline,
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-headline-v2 {
  background: var(--fs-bg-soft) !important;
  border-bottom: 1px solid var(--fs-border) !important;
  border-top: 1px solid var(--fs-border) !important;
  padding: 7px 16px !important;
  cursor: default !important;
  min-height: 0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 3 !important;
  display: flex !important;
}
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-headline:first-child { border-top: none !important; }
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-headline .dgwt-wcas-st,
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-headline-v2 .dgwt-wcas-st {
  font-size: 12px !important; font-weight: 700 !important;
  color: var(--fs-primary) !important; font-family: var(--fs-font) !important;
  text-transform: none !important; width: auto !important;
  border: none !important; background: none !important; padding: 0 !important;
}

/* ══ هر ردیف ══ */
.dgwt-wcas-suggestion {
  font-family: var(--fs-font) !important; direction: rtl !important;
  padding: 9px 14px !important; border-bottom: 1px solid var(--fs-border) !important;
  transition: background .15s !important; display: flex !important; align-items: center !important;
}
.dgwt-wcas-suggestion:last-child { border-bottom: none !important; }
.dgwt-wcas-suggestion:hover,
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-selected { background: var(--fs-primary-soft) !important; }
.dgwt-wcas-suggestion strong { color: var(--fs-primary) !important; font-weight: 700 !important; }

/* ══ حذف breadcrumb (متن "in ...") ══ */
.dgwt-wcas-st-breadcrumbs,
.dgwt-wcas-st--direct-headline { display: none !important; }

/* ══ تصویر محصول ══ */
.dgwt-wcas-si {
  width: 50px !important; height: 50px !important; flex-shrink: 0 !important;
  border-radius: 8px !important; overflow: hidden !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
}
.dgwt-wcas-si img {
  border: 1px solid var(--fs-border) !important; border-radius: 8px !important;
  background: var(--fs-white) !important; padding: 3px !important;
  max-width: 100% !important; max-height: 50px !important;
  object-fit: contain !important; display: block !important;
}
/* تصویر مقاله */
.dgwt-wcas-suggestion[class*="dgwt-wcas-suggestion-pt"] .dgwt-wcas-si {
  width: 56px !important; height: 42px !important; border-radius: 6px !important;
}
.dgwt-wcas-suggestion[class*="dgwt-wcas-suggestion-pt"] .dgwt-wcas-si img {
  border: none !important; border-radius: 6px !important; padding: 0 !important;
  object-fit: cover !important; width: 100% !important; height: 100% !important; max-height: none !important;
}

/* ══ content wrapp ══ */
.dgwt-wcas-content-wrapp {
  display: flex !important; width: 100% !important; align-items: center !important;
  justify-content: space-between !important; padding-right: 10px !important;
  padding-left: 0 !important; gap: 8px !important; min-width: 0 !important;
}
.dgwt-wcas-st {
  flex: 1 !important; min-width: 0 !important;
  direction: rtl !important; text-align: right !important;
}
.dgwt-wcas-st-title {
  font-size: 13.5px !important; color: var(--fs-text) !important;
  font-family: var(--fs-font) !important; line-height: 1.4 !important;
  display: block !important; white-space: nowrap !important;
  overflow: hidden !important; text-overflow: ellipsis !important;
}

/* ══ قیمت ══ */
.dgwt-wcas-sp {
  font-family: var(--fs-font) !important; font-size: 13px !important;
  color: var(--fs-primary) !important; font-weight: 700 !important;
  white-space: nowrap !important; direction: rtl !important; flex-shrink: 0 !important;
}
.dgwt-wcas-sp * { font-family: var(--fs-font) !important; }
.dgwt-wcas-sp .woocommerce-Price-amount { color: var(--fs-primary) !important; font-weight: 700 !important; }
.dgwt-wcas-sp del, .dgwt-wcas-sp del .woocommerce-Price-amount {
  color: var(--fs-muted) !important; font-weight: 400 !important;
  font-size: 11px !important; opacity: .7 !important;
}
.dgwt-wcas-meta {
  display: flex !important; flex-direction: column !important;
  align-items: flex-end !important; flex-shrink: 0 !important;
}

/* ══ CHIP WRAPPER — این مهم‌ترین بخشه ══ */
/* این یک div معمولی هست، نه suggestion */
div.kh-chips-wrap {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 8px 14px 10px !important;
  direction: rtl !important;
  border-bottom: 1px solid var(--fs-border) !important;
  background: var(--fs-white) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  /* مطمئن شو flex از parent override نمیشه */
  align-items: flex-start !important;
}

/* ══ CHIP — هر دکمه ══ */
div.kh-chips-wrap a.kh-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 4px !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  background: var(--fs-primary-soft) !important;
  color: var(--fs-primary) !important;
  border: 1px solid rgba(15,79,89,.2) !important;
  border-radius: 50px !important;
  padding: 5px 13px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  font-family: var(--fs-font) !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: background .15s, color .15s !important;
  /* reset هر چیزی که ممکنه از parent بیاد */
  line-height: 1.4 !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
div.kh-chips-wrap a.kh-chip:hover {
  background: var(--fs-primary) !important;
  color: var(--fs-white) !important;
  border-color: var(--fs-primary) !important;
  text-decoration: none !important;
}

/* popular chips هم همین استایل */
.kh-popular-chips a.kh-chip {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  width: auto !important;
}

/* taxonomy items پس از تبدیل به chip مخفی */
.kh-tax-hidden { display: none !important; }

/* ══ دکمه مشاهده بیشتر ══ */
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more {
  background: var(--fs-white) !important; border-top: 1px solid var(--fs-border) !important;
  border-bottom: none !important; justify-content: center !important; padding: 12px 16px !important;
}
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more:hover { background: var(--fs-primary-soft) !important; }
.dgwt-wcas-st-more {
  display: inline-flex !important; align-items: center !important; gap: 6px !important;
  background: var(--fs-accent) !important; color: var(--fs-white) !important;
  font-family: var(--fs-font) !important; font-size: 13px !important; font-weight: 700 !important;
  padding: 9px 22px !important; border-radius: 50px !important; transition: background .15s !important;
}
.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more:hover .dgwt-wcas-st-more { background: var(--fs-accent-dark) !important; }
.dgwt-wcas-st-more-total { font-weight: 400 !important; opacity: .85 !important; font-size: 12px !important; }

/* ══ جستجوهای محبوب ══ */
.kh-popular-wrap {
  padding: 10px 14px 14px !important; border-top: 1px solid var(--fs-border) !important;
  direction: rtl !important; background: var(--fs-white) !important;
}
.kh-popular-title {
  font-size: 11px !important; font-weight: 700 !important; color: var(--fs-primary) !important;
  font-family: var(--fs-font) !important; margin-bottom: 8px !important;
  text-align: right !important; display: block !important;
}
.kh-popular-chips {
  display: flex !important; flex-wrap: wrap !important; gap: 6px !important;
  justify-content: flex-end !important; direction: rtl !important;
}

/* ══ RTL ══ */
.dgwt-wcas-suggestion, .dgwt-wcas-sf-wrapp, .dgwt-wcas-suggestions-wrapp {
  direction: rtl !important; text-align: right !important;
}
.dgwt-wcas-suggestion::after { display: none !important; }
.rtl .dgwt-wcas-content-wrapp { padding-right: 10px !important; padding-left: 0 !important; }

