/* ===== Fonts (local, scoped usage only) ===== */
@font-face{
  font-family:'IRANSans';
  src:url('../storage/fonts/IRANSans.woff2') format('woff2'),
      url('../storage/fonts/IRANSans.woff') format('woff');
  font-display:swap;
}
@font-face{
  font-family:'Vazir';
  src:url('../storage/fonts/Vazir.woff2') format('woff2'),
      url('../storage/fonts/Vazir.woff') format('woff');
  font-display:swap;
}

/* ===== Root scope ===== */
.ms-headera, .ms-headera * { box-sizing: border-box; }
.ms-headera{
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 2147483646;
  --bg:#ffffff; --fg:#1c2643; --muted:#6b7385; --border:#e3e6ee;
  --grad-from:#ff3ca5; --grad-to:#7a5cff;

  background: var(--bg); color: var(--fg);
  font-family:'IRANSans','Vazir',Tahoma,Arial,sans-serif;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.ms-headera__spacer{ height:64px; } /* با JS هم‌قد می‌شود */

/* Bar layout */
.ms-headera__bar{
  height:64px; max-width:1280px; margin:0 auto; padding:0 16px;
  display:grid; grid-template-columns:auto 1fr auto auto; gap:16px; align-items:center;
  overflow:hidden;
}

/* Brand (right) */
.ms-headera__brand{ display:flex; align-items:center; gap:10px; min-width:0; text-decoration:none; color:inherit; justify-self:start; }
.ms-headera__logo{ width:32px; height:32px; object-fit:contain; }
.ms-headera__title{ font-weight:800; color:#c02086; white-space:nowrap; font-size:0.95rem; }

/* Desktop nav (center) */
.ms-headera__nav{ justify-self:center; min-width:0; }
.ms-headera__nav ul{ list-style:none; margin:0; padding:0; display:flex; gap:22px; align-items:center; white-space:nowrap; }
.ms-headera__nav a{
  color:var(--fg); text-decoration:none; font-weight:700; font-size:0.9rem;
  transition:opacity .2s ease, transform .2s ease;
}
.ms-headera__nav a:hover{ opacity:.9; transform: translateY(-1px); }

/* Actions (left) */
.ms-headera__actions{ justify-self:end; display:flex; align-items:center; gap:10px; min-width:0; }
.ms-headera__btn{
  height:34px; padding:0 12px; border-radius:12px;
  display:inline-flex; align-items:center; justify-content:center;
  text-decoration:none; font-weight:800; font-size:0.88rem; white-space:nowrap;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.ms-headera__btn:active{ transform: translateY(1px); }
.ms-headera__btn--ghost{ border:1px solid var(--border); background:#fff; color:var(--fg); }
.ms-headera__btn--grad{
  color:#fff; background:linear-gradient(135deg,var(--grad-from),var(--grad-to));
  box-shadow: 0 4px 14px rgba(122,92,255,.24);
}
.ms-headera__btn--grad:hover{ filter: brightness(.97); box-shadow: 0 6px 18px rgba(122,92,255,.28); }

/* Hamburger (mobile only) */
.ms-headera__hamburger{
  display:none; width:38px; height:38px; border-radius:10px; border:1px solid var(--border);
  background:#fff; color:var(--fg); cursor:pointer; position:relative; justify-self:end;
}
.ms-headera__hamburger span{position:absolute; left:10px; right:10px; height:2px; background:currentColor;}
.ms-headera__hamburger span:nth-child(1){ top:11px;}
.ms-headera__hamburger span:nth-child(2){ top:18px;}
.ms-headera__hamburger span:nth-child(3){ top:25px;}

/* Mobile panel (bottom sheet, attractive) */
.ms-headera__overlay{
  position:fixed; inset:0; background:rgba(3,7,18,.45); backdrop-filter: blur(4px);
}
.ms-headera__overlay[hidden]{ display:none !important; }

.ms-headera__drawer{
  position:fixed; inset:auto 0 0 0;
  height: min(88vh, 720px);
  background:#ffffff;
  transform: translateY(110%);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 36px rgba(0,0,0,.16);
  display:flex; flex-direction:column;
}
.ms-headera__drawer[aria-hidden="false"]{ transform: translateY(0); }

.ms-headera__drawer-head{ padding:12px 16px; display:flex; justify-content:flex-start; }
.ms-headera__close{
  width:40px; height:40px; border-radius:12px; border:1px solid var(--border); background:#fff; color:var(--fg); cursor:pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

.ms-headera__drawer-nav{ padding:8px 10px; overflow:auto; }
.ms-headera__drawer-nav ul{ list-style:none; margin:0; padding:0; }
.ms-headera__drawer-nav li{ border-bottom:1px dashed #eef1f6; }
.ms-headera__drawer-nav li:last-child{ border-bottom:0; }
.ms-headera__drawer-nav a{
  display:block; padding:14px 10px; text-decoration:none; color:var(--fg);
  font-weight:700; font-size:0.92rem; border-radius:10px;
  transition: background .2s ease, transform .12s ease;
}
.ms-headera__drawer-nav a:hover{ background:#f7f8fb; }
.ms-headera__drawer-nav a:active{ transform: translateY(1px); }

.ms-headera__drawer-actions{ padding:14px 16px 18px; display:flex; flex-direction:column; gap:12px; }
.ms-headera__drawer-actions .ms-headera__btn{ width:100%; height:44px; font-size:0.94rem; }

/* Responsive — دقیقاً مطابق چینش خواسته */
@media (max-width:1150px){
  .ms-headera__nav{ display:none; }
  .ms-headera__hamburger{ display:inline-flex; align-items:center; justify-content:center; }
  .ms-headera__bar{ grid-template-columns:auto 1fr auto auto; }
}
@media (max-width:640px){
  .ms-headera__bar{ gap:10px; }
  .ms-headera__btn{ height:32px; padding:0 10px; font-size:0.86rem; }
}
@media (max-width:420px){
  .ms-headera__btn--ghost{ display:none; } /* خیلی کم‌عرض: فقط CTA */
}

/* Dark mode */
@media (prefers-color-scheme: dark){
  .ms-headera{ --bg:#0f1115; --fg:#e6e7eb; --border:#333a47; }
  .ms-headera__btn--ghost{ background:#151920; color:var(--fg); border-color:var(--border); }
  .ms-headera__drawer{ background:#0f1115; }
  .ms-headera__close{ background:#151920; color:var(--fg); border-color:var(--border); }
  .ms-headera__drawer-nav a:hover{ background:#131722; }
  .ms-headera__drawer-nav li{ border-bottom:1px dashed #1f2533; }
}
