/* ==========================================================================
   RayaWP — Header v2 (glass · مدرن · با انیمیشن کوچک‌شدن عرض هنگام اسکرول)
   • دسکتاپ (>900px): هدر عریض در بالای صفحه → پیل جمع‌وجور هنگام اسکرول
   • موبایل (≤900px): نوار بالای کم‌ارتفاع (لوگو + پشتیبانی) با همان رفتار؛ دوک پایین همان قبلی
   عرض/ارتفاع با مقدار عددی انیمیت می‌شود (نه calc با max-width) تا پرش نداشته باشد.
   ========================================================================== */

.rwp-plugioxs-wrapper { --header-h: 78px; }

/* خود هدر فقط یک لایه‌ی نگه‌دارنده است؛ کلیک‌ها از دو طرف پیل به صفحه می‌رسند */
.rwp-plugioxs-wrapper .raya-root .raya-main-header {
  position: fixed; top: 14px; left: 0; right: 0; z-index: 9000;
  height: auto; display: flex; align-items: flex-start; justify-content: center;
  background: transparent; pointer-events: none;
  transition: top .5s cubic-bezier(.22, 1, .36, 1);
}
.rwp-plugioxs-wrapper .raya-root .raya-main-header.raya-floating { top: 10px; }

.rwp-plugioxs-wrapper .raya-root .raya-main-header .raya-header-container {
  pointer-events: auto; position: relative;
  width: min(1180px, calc(100% - 48px)); max-width: none; height: 64px;
  padding: 0 12px 0 14px; gap: 12px; justify-content: space-between;
  /* حالت اولیه: بدون بک‌گراند و سایه؛ فقط یک بردر خیلی محو */
  border-radius: 22px; border: 1px solid rgba(15, 23, 42, .045);
  background: rgba(255, 255, 255, 0);
  -webkit-backdrop-filter: blur(0) saturate(100%); backdrop-filter: blur(0) saturate(100%);
  box-shadow: 0 0 0 rgba(15, 23, 42, 0);
  transition: width .55s cubic-bezier(.22, 1, .36, 1), height .45s cubic-bezier(.22, 1, .36, 1),
              border-radius .45s cubic-bezier(.22, 1, .36, 1), background .4s, box-shadow .45s, border-color .4s,
              -webkit-backdrop-filter .4s, backdrop-filter .4s;
}
.rwp-plugioxs-wrapper .raya-root .raya-main-header.raya-floating .raya-header-container {
  width: min(880px, calc(100% - 32px)); max-width: none; height: 56px; border-radius: 28px;
  border-color: rgba(249, 115, 22, .16); background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 14px 38px rgba(15, 23, 42, .12), 0 2px 8px rgba(15, 23, 42, .05);
}

/* ---------- لوگو ---------- */
.rwp-plugioxs-wrapper .raya-root .raya-header-logo { gap: 10px; min-width: 0; }
.rwp-plugioxs-wrapper .raya-root .raya-logo-ring {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  transition: width .45s cubic-bezier(.22, 1, .36, 1), height .45s cubic-bezier(.22, 1, .36, 1), border-radius .45s, border-color .25s, box-shadow .25s;
}
.rwp-plugioxs-wrapper .raya-root .raya-main-header.raya-floating .raya-logo-ring { width: 34px; height: 34px; border-radius: 11px; }
.rwp-plugioxs-wrapper .raya-root .raya-logo-text { font-size: 18px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; direction: ltr; }
.rwp-plugioxs-wrapper .raya-root .raya-logo-badge {
  display: inline-block; max-width: 170px; overflow: hidden; white-space: nowrap;
  padding: 3px 10px; font-size: 10.5px; line-height: 1.5;
  transition: max-width .5s cubic-bezier(.22, 1, .36, 1), opacity .3s, padding .5s, margin .5s;
}
/* هنگام اسکرول، برچسب جمع می‌شود تا پیل جمع‌وجورتر شود */
.rwp-plugioxs-wrapper .raya-root .raya-main-header.raya-floating .raya-logo-badge {
  max-width: 0; opacity: 0; padding-inline: 0; margin-inline-start: -10px;
}

/* ---------- ناوبری ---------- */
.rwp-plugioxs-wrapper .raya-root .raya-header-nav { flex: 1; justify-content: center; gap: 2px; padding: 0 8px; min-width: 0; }
.rwp-plugioxs-wrapper .raya-root .raya-nav-link {
  position: relative; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; font-weight: 650; color: #475569;
  transition: background .2s, color .2s;
}
.rwp-plugioxs-wrapper .raya-root .raya-nav-link svg { color: #94a3b8; transition: color .2s; flex: none; }
.rwp-plugioxs-wrapper .raya-root .raya-nav-link:hover,
.rwp-plugioxs-wrapper .raya-root .raya-nav-link:focus-visible { background: rgba(249, 115, 22, .08); color: #c2410c; outline: none; }
.rwp-plugioxs-wrapper .raya-root .raya-nav-link:hover svg,
.rwp-plugioxs-wrapper .raya-root .raya-nav-link:focus-visible svg { color: #f97316; }
.rwp-plugioxs-wrapper .raya-root .raya-nav-link.raya-nav-support:hover { background: rgba(239, 68, 68, .07); color: #dc2626; }
.rwp-plugioxs-wrapper .raya-root .raya-nav-link.raya-nav-support:hover svg { color: #ef4444; }
.rwp-plugioxs-wrapper .raya-root .raya-nav-dropdown-toggle:hover,
.rwp-plugioxs-wrapper .raya-root .raya-nav-dropdown:focus-within .raya-nav-dropdown-toggle { background: rgba(249, 115, 22, .08) !important; color: #c2410c !important; }

/* منوی «لینک‌های مفید»: پل نامرئی بین دکمه و منو + باز شدن با فوکوس کیبورد */
.rwp-plugioxs-wrapper .raya-root .raya-dropdown-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 18px; }
.rwp-plugioxs-wrapper .raya-root .raya-nav-dropdown:focus-within .raya-dropdown-menu { opacity: 1 !important; visibility: visible !important; transform: translateY(0) scale(1) !important; }
.rwp-plugioxs-wrapper .raya-root .raya-nav-dropdown:focus-within .raya-dropdown-arrow { transform: rotate(180deg) !important; }

/* ---------- اکشن‌ها ---------- */
.rwp-plugioxs-wrapper .raya-root .raya-header-actions { gap: 8px; }
.rwp-plugioxs-wrapper .raya-root .raya-hdr-cta {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 15px;
  background: linear-gradient(135deg, #fb923c, #f97316 55%, #ea580c); color: #fff; text-decoration: none;
  font-size: 13.5px; font-weight: 750; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(249, 115, 22, .28), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s, height .45s cubic-bezier(.22, 1, .36, 1), border-radius .45s;
}
.rwp-plugioxs-wrapper .raya-root .raya-hdr-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(249, 115, 22, .36), inset 0 1px 0 rgba(255, 255, 255, .3); color: #fff; }
.rwp-plugioxs-wrapper .raya-root .raya-hdr-cta:focus-visible { outline: 3px solid rgba(249, 115, 22, .35); outline-offset: 3px; }
.rwp-plugioxs-wrapper .raya-root .raya-main-header.raya-floating .raya-hdr-cta { height: 38px; border-radius: 999px; }
.rwp-plugioxs-wrapper .raya-root .raya-hdr-iconbtn {
  display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid rgba(249, 115, 22, .16); border-radius: 14px; background: rgba(249, 115, 22, .08); color: #ea580c;
  cursor: pointer; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent;
  transition: background .2s, transform .2s;
}
.rwp-plugioxs-wrapper .raya-root .raya-hdr-iconbtn:active { transform: scale(.94); background: rgba(249, 115, 22, .16); }

/* نقطه‌ی لنگر: زیر هدر شناور گم نشود */
.rwp-plugioxs-wrapper #raya-searchbox,
.rwp-plugioxs-wrapper #raya-faq-section,
.rwp-plugioxs-wrapper #raya-support-section,
.rwp-plugioxs-wrapper #raya-core-section { scroll-margin-top: 96px; }

/* ---------- لپ‌تاپ کوچک / تبلت افقی: جا برای همه‌ی آیتم‌ها ---------- */
@media (min-width: 901px) and (max-width: 1120px) {
  .rwp-plugioxs-wrapper .raya-root .raya-logo-badge { display: none; }
  .rwp-plugioxs-wrapper .raya-root .raya-nav-link { padding: 9px 10px; font-size: 13px; }
  .rwp-plugioxs-wrapper .raya-root .raya-nav-link svg { display: none; }
  .rwp-plugioxs-wrapper .raya-root .raya-hdr-cta { padding: 0; width: 42px; justify-content: center; }
  .rwp-plugioxs-wrapper .raya-root .raya-hdr-cta span { display: none; }
  .rwp-plugioxs-wrapper .raya-root .raya-main-header.raya-floating .raya-hdr-cta { width: 38px; }
}

/* ---------- موبایل: نوار بالای کم‌ارتفاع ---------- */
@media (max-width: 900px) {
  .rwp-plugioxs-wrapper { --header-h: 68px; }
  .rwp-plugioxs-wrapper .raya-root .raya-main-header { display: flex !important; top: max(10px, env(safe-area-inset-top)); }
  .rwp-plugioxs-wrapper .raya-root .raya-main-header.raya-floating { top: max(8px, env(safe-area-inset-top)); }
  .rwp-plugioxs-wrapper .raya-root .raya-main-header .raya-header-container {
    width: calc(100% - 20px); height: 56px; padding: 0 8px 0 10px; border-radius: 20px;
  }
  .rwp-plugioxs-wrapper .raya-root .raya-main-header.raya-floating .raya-header-container {
    width: calc(100% - 40px); height: 50px; border-radius: 25px;
  }
  .rwp-plugioxs-wrapper .raya-root .raya-header-nav,
  .rwp-plugioxs-wrapper .raya-root .raya-menu-toggle,
  .rwp-plugioxs-wrapper .raya-root .raya-hdr-cta { display: none !important; }
  .rwp-plugioxs-wrapper .raya-root .raya-hdr-iconbtn { display: inline-flex; }
  .rwp-plugioxs-wrapper .raya-root .raya-logo-ring { width: 36px; height: 36px; border-radius: 12px; }
  .rwp-plugioxs-wrapper .raya-root .raya-main-header.raya-floating .raya-logo-ring { width: 32px; height: 32px; border-radius: 10px; }
  .rwp-plugioxs-wrapper .raya-root .raya-logo-text { font-size: 16.5px; }
}
@media (max-width: 400px) {
  .rwp-plugioxs-wrapper .raya-root .raya-logo-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rwp-plugioxs-wrapper .raya-root .raya-main-header,
  .rwp-plugioxs-wrapper .raya-root .raya-main-header .raya-header-container,
  .rwp-plugioxs-wrapper .raya-root .raya-logo-ring,
  .rwp-plugioxs-wrapper .raya-root .raya-logo-badge,
  .rwp-plugioxs-wrapper .raya-root .raya-hdr-cta { transition: none !important; }
}
