/* نوار تبلیغاتی دیجی‌پی بالای هدر (includes/header.php) — عمداً هاردکد است و از پنل مدیریت نمی‌شود.
   هدر و هیروها همه از --header-top فاصله می‌گیرند؛ پس با بالا‌بردن همین یک متغیر وقتی نوار هست،
   همه‌چیز (هدر، پدینگ هیروها، باکس جستجو) خودکار به‌اندازه‌ی ارتفاع نوار پایین می‌آید. */
body.has-promo-bar {
  --promo-bar-height: 44px;
  --header-top: calc(10px + var(--promo-bar-height));
}

.promo-bar {
  position: absolute;
  z-index: 101;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: var(--promo-bar-height);
  padding: 0 16px;
  overflow: hidden;
  color: #1b2745;
  text-decoration: none;
  background:
    radial-gradient(circle at 10% 140%, rgba(17, 89, 252, .10) 0 20%, transparent 21%),
    radial-gradient(circle at 90% -40%, rgba(249, 68, 31, .09) 0 24%, transparent 25%),
    #fff;
  border-bottom: 1px solid #e3ebfb;
  isolation: isolate;
}

/* برق ملایم که هر چند ثانیه از روی نوار رد می‌شود */
.promo-bar::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 -40%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(17, 89, 252, .10), transparent);
  transform: skewX(-20deg);
  animation: promo-bar-shine 4.5s ease-in-out infinite;
}

@keyframes promo-bar-shine {
  0%, 55% { left: -40%; }
  100% { left: 140%; }
}

.promo-bar-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.promo-bar-text b {
  color: #1159fc;
  padding: 3px 9px;
  background: #e8f0ff;
  border-radius: 999px;
  font-weight: 950;
}

.promo-bar-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  background: #1159fc;
  border-radius: 999px;
  box-shadow: 0 3px 12px rgba(17, 89, 252, .30);
  animation: promo-bar-pulse 2.4s ease-in-out infinite;
}

.promo-bar-cta i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #fff;
  background: #f9441f;
  border-radius: 50%;
}

.promo-bar-cta svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes promo-bar-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.promo-bar:hover .promo-bar-cta {
  background: #0a47d1;
}

@media (max-width: 680px) {
  body.has-promo-bar { --promo-bar-height: 40px; }
  .promo-bar { gap: 10px; padding: 0 10px; }
  .promo-bar-text { font-size: 12.5px; }
  .promo-bar-cta { padding: 6px 12px; font-size: 11.5px; }
}

/* باریک‌تر از ۵۲۰px متن بلند جا نمی‌شود (به لبه‌ها می‌چسبید) — نسخه‌ی کوتاه متن می‌آید */
@media (min-width: 521px) {
  .promo-bar-short { display: none; }
}

@media (max-width: 520px) {
  .promo-bar-long { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .promo-bar::before,
  .promo-bar-cta { animation: none; }
}
