:root{--sfx-purple:#4b3fb0;--sfx-purple2:#6a5ae0;--sfx-ink:#2a2a3a;--sfx-line:#eceef5;}
.sfx-header{position:sticky;top:0;z-index:1000;background:linear-gradient(90deg,#4b3fb0,#5b4fce);box-shadow:0 2px 14px rgba(40,30,90,.18)}
.sfx-header *{box-sizing:border-box}
.sfx-header-inner{max-width:1200px;margin:0 auto;height:64px;display:flex;align-items:center;gap:14px;padding:0 16px}
.sfx-logo{display:flex;align-items:center;flex:none}
.sfx-logo img,.sfx-logo .custom-logo{height:40px;width:auto;max-width:160px;object-fit:contain;filter:brightness(0) invert(1)}
.sfx-logo-text{color:#fff;font-weight:800;font-size:18px}

/* desktop nav */
.sfx-desktop-nav{flex:1;display:flex;justify-content:center}
.sfx-desktop-nav .sfx-menu{list-style:none;margin:0;padding:0;display:flex;align-items:center;gap:4px}
.sfx-desktop-nav .sfx-menu li{position:relative}
.sfx-desktop-nav .sfx-menu a{display:block;color:#fff;text-decoration:none;font-size:15px;font-weight:600;padding:10px 14px;border-radius:9px;transition:.15s;white-space:nowrap}
/* «ابزار» تنها آیتمی است که href ندارد (فقط مگا را باز می‌کند). بوت‌استرپ
   قاعده‌ی a:not([href]):not([class]){color:inherit} دارد و با همان ویژگی‌مندیِ
   قاعده‌ی بالا گره می‌خورد، پس رنگ از body ارث می‌رسد: #212529، یعنی مشکی روی
   هدرِ بنفش. رنگ اینجا صریح و با ویژگی‌مندیِ بالاتر نوشته می‌شود. */
.sfx-desktop-nav .sfx-menu a:not([href]),
.sfx-desktop-nav .sfx-menu a:hover,
.sfx-desktop-nav .sfx-menu a:focus,
.sfx-desktop-nav .sfx-menu a:not([href]):hover{color:#fff}
.sfx-desktop-nav .sfx-menu > li > a:hover{background:rgba(255,255,255,.14)}
.sfx-desktop-nav .menu-item-has-children > a::after,.sfx-desktop-nav .sfx-has-mega > a::after{content:"";display:inline-block;width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-inline-start:7px;vertical-align:middle;opacity:.8}

/* ===== mega menu (brands + ads + tools) ===== */
.sfx-desktop-nav .sfx-has-mega{position:relative}
.sfx-mega{position:absolute;top:calc(100% + 8px);left:50%;right:auto;inset-inline-start:auto;background:#fff;border:1px solid var(--sfx-line);border-radius:16px;box-shadow:0 18px 50px rgba(40,30,90,.20);padding:14px;z-index:60;opacity:0;visibility:hidden;transform:translate(-50%,10px);transition:opacity .18s ease,transform .22s ease,visibility .18s}
.sfx-desktop-nav .sfx-has-mega:hover > .sfx-mega{opacity:1;visibility:visible;transform:translate(-50%,0);transition:opacity .34s ease,transform .46s cubic-bezier(.16,.86,.3,1),visibility .34s}
.sfx-mega-brands{width:750px;max-width:calc(100vw - 32px)}
.sfx-mm-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.sfx-mm-card{display:flex;flex-direction:column;align-items:center;text-align:center;gap:7px;padding:16px 10px 14px;border-radius:14px;text-decoration:none;border:1px solid #eef0f6;transition:.16s;position:relative;min-width:0;background:#fff}
.sfx-mm-card:hover{background:#f6f5ff;border-color:#d9def0;transform:translateY(-2px);box-shadow:0 8px 20px rgba(75,63,176,.1)}
.sfx-mm-logo{width:100%;height:38px;border-radius:0;background:transparent;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:0}
.sfx-mm-logo img{max-width:100%;max-height:38px;width:auto;height:auto;object-fit:contain}
.sfx-mm-rate{display:inline-flex;align-items:center;gap:5px;font-size:13px;font-weight:800;color:var(--sfx-ink);line-height:1;margin-top:2px}
.sfx-mm-rate .st{color:#f2b01e;font-size:13px}
.sfx-mm-rate .v{font-size:1em;font-weight:800}
.sfx-mm-rate .cnt{font-size:10.5px;font-weight:600;color:#9a97ad}
.sfx-mm-norate{font-size:11px;color:#a5a1b5;font-weight:600}
.sfx-mm-name{font-size:12.5px;font-weight:700;color:var(--sfx-ink);line-height:1.6;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:1px}
.sfx-mm-divider{height:1px;background:#eceef5;margin:14px 2px 10px}
.sfx-mm-adslabel{font-size:12px;font-weight:800;color:#a97b00;margin:0 2px 10px;display:flex;align-items:center;gap:6px;justify-content:flex-end}
.sfx-mm-adslabel::before{content:"";width:8px;height:8px;border-radius:50%;background:#f5b301}
.sfx-mm-grid-ads{grid-template-columns:repeat(2,1fr) !important;gap:12px}
.sfx-mm-ad{border-color:#f2d580;background:#fffdf2;flex-direction:row !important;align-items:center;text-align:right;gap:13px;padding:13px 15px}
.sfx-mm-ad:hover{background:#fff7d6;border-color:#eac94a}
.sfx-mm-ad .sfx-mm-logo{background:#fff6d6;width:54px;height:50px;border-radius:10px;padding:6px;max-width:none}
.sfx-mm-ad .sfx-mm-logo img{max-height:100%}
.sfx-mm-ad .sfx-mm-name{text-align:right;line-height:1.6;flex:1}
.sfx-mm-badge{position:absolute;top:8px;inset-inline-end:8px;inset-inline-start:auto;background:#f5b301;color:#5a4300;font-size:9px;font-weight:800;padding:2px 8px;border-radius:7px;line-height:1.6;z-index:2}
.sfx-mm-all{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:14px;padding:11px;border-radius:11px;background:#f4f3ff;color:#4b3fb0;font-weight:800;font-size:13px;text-decoration:none;transition:.14s}
.sfx-mm-all:hover{background:#4b3fb0;color:#fff}
.sfx-mm-all span{font-size:17px;line-height:0}
.sfx-desktop-nav .sfx-mega a.sfx-mm-card{color:inherit}
.sfx-desktop-nav .sfx-mega a.sfx-mm-all{padding:11px;color:#4b3fb0}
.sfx-desktop-nav .sfx-mega a.sfx-mm-all:hover{color:#fff}
.sfx-desktop-nav .sfx-mega a.sfx-tm-tool,.sfx-desktop-nav .sfx-mega a.sfx-tm-post{display:flex;color:inherit}
.sfx-desktop-nav .sfx-mega .sfx-tm-post .th img{width:100%;height:100%;object-fit:cover}
.sfx-mobile-nav .sfx-mega a.sfx-tm-tool,.sfx-mobile-nav .sfx-mega a.sfx-tm-post{display:flex;color:inherit}
.sfx-mobile-nav .sfx-mega .sfx-tm-post .th img{width:100%;height:100%;object-fit:cover}
/* ابزار mega — rich two-column (tools + latest posts) */
.sfx-mega-toolspanel{width:700px;max-width:calc(100vw - 32px)}
.sfx-mega-blogpanel{width:760px;max-width:calc(100vw - 32px)}
/* پنلِ بلاگ: ستونِ چپ دو بخشِ خبری روی هم */
.sfx-blogmega .sfx-tm-latest{gap:0}
.sfx-blogmega .sfx-tm-sec{display:flex;flex-direction:column}
.sfx-blogmega .sfx-tm-sec + .sfx-tm-sec{margin-top:16px;padding-top:14px;border-top:1px solid #eef0f6}
.sfx-blogmega .sfx-tm-sec .sfx-mm-all{margin-top:10px;padding:8px;font-size:12px}
.sfx-blogmega .sfx-tm-tools{display:flex;flex-direction:column}
.sfx-blogmega .sfx-tm-tool{margin-bottom:8px}
.sfx-toolsmega{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:22px}
/* The nav sets white-space:nowrap to keep the menu on one line; inherited
   into the panel it stopped titles wrapping, which blew the grid track
   past the panel and spilled the cards outside the white box. */
.sfx-mega{white-space:normal}
.sfx-desktop-nav .sfx-menu .sfx-mega a,.sfx-mobile-nav .sfx-menu .sfx-mega a{white-space:normal}
.sfx-toolsmega > *{min-width:0}
.sfx-tm-head{font-size:13px;font-weight:800;color:#2a2350;margin:0 0 12px;padding-bottom:9px;border-bottom:1px solid #eef0f6}
.sfx-tm-tool{display:flex;align-items:center;gap:12px;padding:10px 11px;border-radius:12px;text-decoration:none;transition:.14s;margin-bottom:5px}
.sfx-tm-tool:hover{background:#f6f5ff}
.sfx-tm-tool .ic{width:44px;height:44px;flex:none;border-radius:12px;background:linear-gradient(160deg,#efeaff,#e0d8fa);color:#5a4bd6;display:flex;align-items:center;justify-content:center}
.sfx-tm-tool .tx b{display:block;font-size:14px;color:#2a2350;font-weight:800;margin-bottom:2px}
.sfx-tm-tool .tx span{font-size:11.5px;color:#8a86a0}
.sfx-tm-latest{border-inline-start:1px solid #eef0f6;padding-inline-start:22px;display:flex;flex-direction:column}
.sfx-tm-posts{display:flex;flex-direction:column;gap:8px}
.sfx-tm-post{display:flex;align-items:center;gap:10px;padding:7px 9px;text-decoration:none;border:1px solid #eef0f6;border-radius:10px;background:#fafafe;transition:.14s}
.sfx-tm-post:hover{background:#f6f5ff;border-color:#d9def0}
.sfx-tm-post .th{width:40px;height:40px;border-radius:8px;overflow:hidden;flex:none;background:#f2eefb}
.sfx-tm-post .th-ph{background:linear-gradient(135deg,#efeaff,#e0d8fa)}
.sfx-tm-post .th img{width:100%;height:100%;object-fit:cover}
.sfx-tm-post .tt{font-size:11.5px;font-weight:700;color:#2a2350;line-height:1.6;display:block;min-width:0;overflow-wrap:break-word;max-height:calc(1.6em * 2);overflow:hidden;align-self:center}
.sfx-tm-post:hover .tt{color:#5a4bd6}
.sfx-tm-latest .sfx-mm-all{margin-top:auto}
.sfx-tool-ic{width:50px;height:50px;border-radius:14px;background:linear-gradient(145deg,#4b3fb0,#6a5ae0);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 14px rgba(75,63,176,.28)}
.sfx-tool-name{font-size:13.5px;font-weight:700;color:var(--sfx-ink)}

/* dropdown panel (clean white, like the filter) */
.sfx-desktop-nav .sub-menu{list-style:none;margin:0;padding:8px;position:absolute;top:calc(100% + 8px);inset-inline-start:0;min-width:210px;background:#fff;border:1px solid var(--sfx-line);border-radius:14px;box-shadow:0 14px 40px rgba(40,30,90,.16);opacity:0;visibility:hidden;transform:translateY(6px);transition:.16s;z-index:50}
.sfx-desktop-nav li:hover > .sub-menu{opacity:1;visibility:visible;transform:translateY(0)}
.sfx-desktop-nav .sub-menu a{color:var(--sfx-ink);font-weight:500;font-size:14px;padding:9px 12px;border-radius:9px}
.sfx-desktop-nav .sub-menu a:hover{background:#f4f3ff;color:var(--sfx-purple)}
.sfx-desktop-nav .sub-menu .sub-menu{position:static;box-shadow:none;border:none;padding:0 0 0 8px;min-width:0;opacity:1;visibility:visible;transform:none}

/* mega menu: add CSS class "mega-menu" to a top-level item */
.sfx-desktop-nav .mega-menu{position:static}
.sfx-desktop-nav .mega-menu > .sub-menu{inset-inline:0;left:0;right:0;margin:0 auto;max-width:1000px;display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:6px 14px;padding:16px}
.sfx-desktop-nav .mega-menu > .sub-menu > li > a{font-weight:800;color:var(--sfx-purple);border-bottom:1px solid var(--sfx-line);border-radius:0;margin-bottom:4px}
.sfx-desktop-nav .mega-menu > .sub-menu > li > a:hover{background:transparent}
.sfx-desktop-nav .mega-menu .sub-menu{padding:0}

/* actions */
.sfx-actions{flex:none;display:flex;align-items:center;gap:10px}
.sfx-search-desktop{display:flex;align-items:center;background:rgba(255,255,255,.16);border-radius:10px;padding:0 4px 0 10px;height:38px}
.sfx-search-desktop input{background:transparent;border:none;outline:none;color:#fff;font-family:inherit;font-size:13px;width:130px}
.sfx-search-desktop input::placeholder{color:rgba(255,255,255,.75)}
.sfx-search-desktop button{background:transparent;border:none;color:#fff;cursor:pointer;display:flex;padding:6px}
.sfx-login{display:inline-flex;align-items:center;gap:6px;background:#ffd23f;color:#3a2f00;font-weight:700;font-size:14px;text-decoration:none;padding:9px 16px;border-radius:10px;transition:.15s;white-space:nowrap}
.sfx-login:hover{background:#ffc400}
.sfx-burger{display:none;background:transparent;border:none;color:#fff;cursor:pointer;padding:6px;align-items:center}

/* ===== mobile popup ===== */
.sfx-modal{position:fixed;inset:0;z-index:3000;display:none;align-items:center;justify-content:center;padding:18px}
.sfx-modal.open{display:flex}
.sfx-modal-overlay{position:absolute;inset:0;background:rgba(24,18,55,.55)}
.sfx-modal-box{position:relative;background:#fff;border-radius:18px;width:min(430px,100%);max-height:86vh;overflow-y:auto;box-shadow:0 24px 70px rgba(25,18,70,.4);padding:16px;-webkit-overflow-scrolling:touch}
.sfx-modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.sfx-modal-title{font-weight:800;color:var(--sfx-purple);font-size:17px}
.sfx-modal-close{background:#f4f3ff;border:none;color:var(--sfx-purple);border-radius:10px;width:38px;height:38px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.sfx-search-mobile{display:flex;align-items:center;gap:6px;background:#f5f5fb;border:1px solid var(--sfx-line);border-radius:12px;padding:0 12px;height:44px;margin-bottom:12px}
.sfx-search-mobile input{flex:1;background:transparent;border:none;outline:none;font-family:inherit;font-size:16px;color:#333}
.sfx-search-mobile button{background:transparent;border:none;color:#9a9ab0;cursor:pointer;display:flex}
.sfx-mobile-nav .sfx-menu{list-style:none;margin:0;padding:0}
.sfx-mobile-nav .sfx-menu li{border-bottom:1px solid #f2f3f8}
.sfx-mobile-nav .sfx-menu li:last-child{border-bottom:none}
.sfx-mobile-nav .sfx-menu a{display:block;color:var(--sfx-ink);text-decoration:none;font-size:15px;font-weight:600;padding:13px 6px}
/* همان تله در منوی موبایل: بدونِ این، آیتمِ بدونِ href رنگِ body می‌گیرد. */
.sfx-mobile-nav .sfx-menu a:not([href]),
.sfx-mobile-nav .sfx-menu a:hover,
.sfx-mobile-nav .sfx-menu a:focus{color:var(--sfx-ink)}
.sfx-mobile-nav .menu-item-has-children{position:relative}
.sfx-mobile-nav .menu-item-has-children > .sfx-subtoggle{position:absolute;top:0;inset-inline-end:0;width:44px;height:50px;background:transparent;border:none;color:#9a9ab0;cursor:pointer;display:flex;align-items:center;justify-content:center}
.sfx-mobile-nav .menu-item-has-children > .sfx-subtoggle svg{transition:transform .2s}
.sfx-mobile-nav .menu-item-has-children.open > .sfx-subtoggle svg{transform:rotate(180deg)}
.sfx-mobile-nav .sub-menu{list-style:none;margin:0 0 8px;padding:0 12px;display:none;background:#faf9ff;border-radius:10px}
.sfx-mobile-nav .menu-item-has-children.open > .sub-menu{display:block}
.sfx-mobile-nav .sub-menu a{font-size:14px;font-weight:500;color:#555;padding:11px 6px}
.sfx-login-m{display:block;text-align:center;margin-top:14px;background:var(--sfx-purple);color:#fff;font-weight:700;text-decoration:none;padding:13px;border-radius:12px}
.sfx-login-m:hover{background:#3f359a}
body.sfx-noscroll{overflow:hidden !important}
/* hide the old navbar embedded in the homepage Elementor content (replaced by this header) */
.custom-navbar.navbar-glass{display:none !important}

/* responsive switch */
@media(max-width:900px){
  .sfx-desktop-nav,.sfx-search-desktop{display:none}
  .sfx-header-inner{position:relative;justify-content:space-between;gap:8px}
  .sfx-burger{display:flex;order:1}
  .sfx-actions{order:2;display:flex}
  .sfx-logo{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;width:fit-content;height:fit-content;justify-content:center;pointer-events:auto}
  .sfx-login{display:inline-flex;flex-direction:column;align-items:center;gap:2px;background:transparent;padding:0;color:#fff}
  .sfx-login:hover{background:transparent}
  .sfx-login svg{width:27px;height:27px;border:2px solid #fff;border-radius:50%;padding:4px;box-sizing:border-box}
  .sfx-login span{background:#ffd23f;color:#3a2f00;font-size:9px;font-weight:800;padding:1px 9px;border-radius:7px;line-height:1.7}
  /* mega becomes a smoothly-animated accordion block inside the popup */
  .sfx-mobile-nav .sfx-has-mega{position:relative}
  .sfx-mobile-nav .sfx-mega{position:static;visibility:visible;transform:none;box-shadow:none;border:none;border-radius:0;width:auto !important;max-width:none;display:block;max-height:0;opacity:0;padding:0;overflow:hidden;transition:max-height .46s cubic-bezier(.22,.8,.2,1),opacity .4s ease,padding .4s ease}
  .sfx-mobile-nav .sfx-has-mega.open > .sfx-mega{max-height:1600px;opacity:1;padding:6px 0 12px}
  .sfx-mobile-nav .sfx-mm-grid{grid-template-columns:1fr 1fr}
  .sfx-mobile-nav .sfx-toolsmega{grid-template-columns:1fr;gap:8px}
  .sfx-mobile-nav .sfx-tm-latest{border-inline-start:none;padding-inline-start:0;border-top:1px solid #eef0f6;padding-top:10px;margin-top:6px}
  .sfx-mobile-nav .sfx-blogmega .sfx-tm-sec + .sfx-tm-sec{margin-top:12px;padding-top:10px}
  .sfx-mobile-nav .sfx-has-mega.open > .sfx-mega{max-height:2400px}
  .sfx-mobile-nav .sfx-mega a.sfx-mm-card{padding:14px 8px;font-size:12.5px}
  .sfx-mobile-nav .sfx-mega a.sfx-mm-all{padding:11px;font-size:13px}
  .sfx-mobile-nav .sfx-mega .sfx-mm-name{font-size:12.5px}
  .sfx-mobile-nav .sfx-has-mega > .sfx-subtoggle{position:absolute;top:0;inset-inline-end:0;height:50px;width:44px;background:transparent;border:none;color:#9a9ab0;cursor:pointer;display:flex;align-items:center;justify-content:center}
  .sfx-mobile-nav .sfx-has-mega > .sfx-subtoggle svg{transition:transform .25s}
  .sfx-mobile-nav .sfx-has-mega.open > .sfx-subtoggle svg{transform:rotate(180deg)}
}
@media(min-width:901px){ .sfx-modal{display:none !important} }