/* =========================================================================
   دراپ‌داون سفارشی گرویتی‌فرم - جایگزین ظاهر بومی select (نسخه ۲، تقویت‌شده)
   این فایل باید همراه gf-custom-select.js استفاده بشه
   نکته: چون قالب/المنتور روی دیوها ریست‌های سنگین می‌زنن، خاصیت‌های حیاتی
   (position/display/width/box-sizing) با !important قفل شدن.
   ========================================================================= */

.gf-custom-select{
  position: relative !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* select اصلی مخفی می‌شه ولی همچنان برای ثبت مقدار فرم و اسکریپت‌های شما فعاله */
.gf-custom-select select.gf-native-select-hidden{
  display: none !important;
}

.gf-custom-select-trigger{
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 48px !important;
  cursor: pointer !important;
  user-select: none !important;
  border: 1.5px solid var(--gf-ctrl-border-color, #d9dce1) !important;
  border-radius: var(--gf-radius, 10px) !important;
  padding: 0 16px 0 40px !important;
  margin: 0 !important;
  background: var(--gf-color-in-ctrl, #fff) !important;
  color: var(--gf-color-in-ctrl-contrast, #1f2430) !important;
  box-shadow: 0 2px 6px rgba(20, 25, 35, 0.05) !important;
  position: relative !important;
  font-size: 0.98em !important;
  line-height: 1.4 !important;
  transition: border-color .15s ease, box-shadow .15s ease !important;
}

/* کانتینر متن: عرضش محدود به فضای باقی‌مونده‌ی باکسه و سرریز رو مخفی می‌کنه */
.gf-select-text-wrap{
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  position: relative !important;
}

.gf-select-text:empty::before{
  content: attr(data-placeholder);
  color: #9aa1ab;
}

.gf-select-text{
  display: inline-block !important;
  white-space: nowrap !important;
  will-change: transform;
}

/* فقط وقتی متن از عرض باکس بلندتر باشه، این کلاس با جاوااسکریپت اضافه می‌شه */
.gf-select-text.has-marquee{
  animation: gf-marquee 7s ease-in-out infinite;
}

@keyframes gf-marquee{
  0%, 12%   { transform: translateX(0); }
  45%, 55%  { transform: translateX(var(--gf-marquee-shift, 0)); }
  88%, 100% { transform: translateX(0); }
}

.gf-custom-select-trigger::after{
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  width: 12px !important;
  height: 8px !important;
  transform: translateY(-50%) !important;
  background-image: var(--gf-icon-ctrl-select) !important;
  background-repeat: no-repeat !important;
  background-size: 12px !important;
  transition: transform .2s ease !important;
}

.gf-custom-select.is-open .gf-custom-select-trigger::after{
  transform: translateY(-50%) rotate(180deg) !important;
}

.gf-custom-select-trigger:hover{
  border-color: #b9bfc8 !important;
}

.gf-custom-select.is-open .gf-custom-select-trigger{
  border-color: var(--gf-color-primary, #ff6b00) !important;
  box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.14) !important;
}

/* پیش‌فرض: پنل کاملاً پنهان و خارج از جریان عادی صفحه (شناور) */
.gf-custom-select-panel{
  display: none !important;
  position: absolute !important;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  left: 0 !important;
  width: auto !important;
  margin: 0 !important;
  background: #fff !important;
  border: 1.5px solid var(--gf-ctrl-border-color, #d9dce1) !important;
  border-radius: var(--gf-radius, 10px) !important;
  box-shadow: 0 12px 32px rgba(20, 25, 35, 0.15) !important;
  max-height: 260px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 9999 !important;
  padding: 6px !important;
  box-sizing: border-box !important;
  list-style: none !important;
}

/* فقط وقتی کلاس is-open داره باز و قابل‌دید بشه */
.gf-custom-select.is-open .gf-custom-select-panel{
  display: block !important;
  animation: gf-panel-in .12s ease;
}

@keyframes gf-panel-in{
  from{ opacity: 0; transform: translateY(-4px); }
  to{ opacity: 1; transform: translateY(0); }
}

.gf-custom-select-option{
  display: block !important;
  padding: 10px 14px !important;
  margin: 0 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-size: 0.95em !important;
  color: var(--gf-color-in-ctrl-contrast, #1f2430) !important;
  background: transparent !important;
  transition: background .1s ease !important;
  list-style: none !important;
}

.gf-custom-select-option:hover{
  background: rgba(255, 107, 0, 0.08) !important;
}

.gf-custom-select-option.is-selected{
  background: var(--gf-color-primary, #ff6b00) !important;
  color: #fff !important;
  font-weight: 600 !important;
}

.gf-custom-select-panel::-webkit-scrollbar{
  width: 6px;
}
.gf-custom-select-panel::-webkit-scrollbar-thumb{
  background: #d9dce1;
  border-radius: 6px;
}