/* v1.5.7 mobile header/cart tap reliability */
@media (max-width:960px){
  .msf-header{overflow:visible !important;}
  .msf-header .msf-actions{position:relative !important;z-index:140 !important;pointer-events:auto !important;gap:8px !important;max-width:none !important;}
  .msf-header .msf-header-cart{display:inline-flex !important;align-items:center !important;justify-content:center !important;width:46px !important;height:46px !important;min-width:46px !important;min-height:46px !important;padding:0 !important;border-radius:16px !important;position:relative !important;z-index:145 !important;pointer-events:auto !important;touch-action:manipulation !important;}
  .msf-header .msf-header-cart-icon{font-size:22px !important;line-height:1 !important;}
  .msf-header .msf-header-cart-label{display:none !important;}
  .msf-header .msf-mobile-toggle{pointer-events:auto !important;touch-action:manipulation !important;}
}

/* Header login button modern outline style */
.msf-header .msf-login-btn-modern{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  min-height:48px!important;
  padding:10px 22px!important;
  border-radius:18px!important;
  background:#fff!important;
  color:#0f172a!important;
  text-decoration:none!important;
  font-weight:900!important;
  font-size:16px!important;
  line-height:1!important;
  white-space:nowrap!important;
  border:1.5px solid #15803d!important;
  box-shadow:0 10px 24px rgba(15,23,42,.07)!important;
  transition:background-color .2s ease,color .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease!important;
}
.msf-header .msf-login-btn-modern .msf-login-icon{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  color:#16a34a!important;
  line-height:0!important;
}
.msf-header .msf-login-btn-modern .msf-login-text{display:inline-block!important}
.msf-header .msf-login-btn-modern:hover{
  background:#f0fdf4!important;
  color:#052e16!important;
  border-color:#16a34a!important;
  box-shadow:0 14px 30px rgba(22,163,74,.16)!important;
  transform:translateY(-1px)!important;
  filter:none!important;
}
.msf-header .msf-login-btn-modern:hover .msf-login-icon{color:#15803d!important}
@media (max-width:700px){
  .msf-header .msf-login-btn-modern{min-height:44px!important;padding:9px 16px!important;border-radius:16px!important;font-size:15px!important;gap:8px!important}
  .msf-header .msf-login-btn-modern svg{width:20px!important;height:20px!important}
}

/* Modern floating quick donation card */
.msf-quick-donate-card{position:fixed;right:24px;bottom:26px;z-index:94;width:190px;background:#fff;border:1px solid rgba(22,163,74,.18);border-radius:18px;padding:30px 16px 14px;text-align:center;box-shadow:0 18px 38px rgba(15,23,42,.14);font-family:var(--msf-body-font);color:var(--msf-text);direction:rtl;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}.msf-quick-donate-card:hover{transform:translateY(-4px);box-shadow:0 24px 46px rgba(15,23,42,.18);border-color:rgba(22,163,74,.35)}.msf-quick-donate-icon{position:absolute;top:-24px;right:50%;transform:translateX(50%);width:54px;height:54px;border-radius:999px;background:linear-gradient(135deg,#16a34a,#15803d);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 12px 26px rgba(22,163,74,.32);border:4px solid #fff}.msf-quick-donate-card h3{margin:12px 0 5px;font-size:20px;line-height:1.25;font-weight:900;color:var(--msf-text)}.msf-quick-donate-card p{margin:0 0 14px;font-size:13px;line-height:1.7;color:var(--msf-muted)}.msf-quick-donate-action{display:flex;align-items:center;justify-content:center;width:100%;min-height:42px;border-radius:9px;background:linear-gradient(135deg,#16a34a,#15803d);color:#fff;text-decoration:none;font-weight:900;font-size:14px;box-shadow:0 12px 22px rgba(22,163,74,.23);transition:transform .2s ease,filter .2s ease}.msf-quick-donate-action:hover{transform:translateY(-1px);filter:brightness(1.04);color:#fff}.msf-quick-donate-note{display:inline-flex;align-items:center;justify-content:center;gap:5px;margin-top:10px;font-size:11px;font-weight:700;color:#15803d}.msf-floating-donate{display:none!important}@media (max-width:960px){.msf-quick-donate-card{right:12px;left:12px;bottom:12px;width:auto;display:grid;grid-template-columns:56px 1fr auto;grid-template-areas:'icon title btn' 'icon text btn' 'icon note btn';align-items:center;gap:2px 10px;text-align:right;padding:12px 14px;border-radius:18px}.msf-quick-donate-card:hover{transform:none}.msf-quick-donate-icon{position:static;grid-area:icon;transform:none;width:50px;height:50px;border-width:0}.msf-quick-donate-card h3{grid-area:title;margin:0;font-size:18px}.msf-quick-donate-card p{grid-area:text;margin:0;font-size:12px}.msf-quick-donate-action{grid-area:btn;min-width:104px;width:auto;padding:0 16px}.msf-quick-donate-note{grid-area:note;margin-top:4px;justify-content:flex-start}}
/* Quick donate floating card must open the original quick-donation modal, not scroll/hide it */
.msf-quick-donate-card button.msf-quick-donate-action{appearance:none;-webkit-appearance:none;border:0;cursor:pointer;font-family:inherit;text-align:center}
.msf-quick-donation-modal .msf-modal-dialog{width:min(1240px,96vw);border-radius:26px;padding:0;overflow:hidden;background:#fff}
.msf-quick-donation-modal .msf-modal-content{padding:0}
.msf-quick-donation-modal .miyaar-quick-donate-wrap,
.msf-quick-donation-modal .miyaar-quick-donate,
.msf-quick-donation-modal .msf-donation{margin:0!important;max-width:none!important}
/* Quick donate: use original backend modal only, hide its internal launcher button */
/* التبرع السريع: لا نخفي الحاوية الأصلية حتى لا يرث المودال opacity:0.
   نخفي زر التشغيل الداخلي فقط، والبطاقة الجديدة تستدعي نفس حدثه. */
.msf-qd-native-host{display:block!important;position:static!important;width:0!important;height:0!important;overflow:visible!important;opacity:1!important;pointer-events:auto!important;z-index:auto!important}
.msf-qd-native-host .miyaar-qd-open{position:absolute!important;left:-99999px!important;top:auto!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.msf-qd-native-host .miyaar-qd-modal,
.msf-qd-native-host .miyaar-qd-thanks-modal,
.msf-qd-native-host .miyaar-qd-receipt-modal{opacity:1!important;pointer-events:auto!important;z-index:999999!important}
.msf-quick-donate-card{position:fixed;left:18px;bottom:18px;z-index:9998;width:230px;max-width:calc(100vw - 32px);background:#fff;border:1px solid #e5e7eb;border-radius:20px;box-shadow:0 18px 46px rgba(15,23,42,.18);padding:44px 18px 16px;text-align:center;direction:rtl;color:#0f172a;box-sizing:border-box}
.msf-quick-donate-icon{position:absolute;top:-30px;right:50%;transform:translateX(50%);width:66px;height:66px;border-radius:999px;background:linear-gradient(135deg,#16a34a,#047857);color:#fff;display:grid;place-items:center;border:6px solid rgba(255,255,255,.92);box-shadow:0 12px 28px rgba(4,120,87,.28)}
.msf-quick-donate-card h3{margin:0 0 8px;font-size:23px;line-height:1.3;font-weight:1000;color:#0f172a}.msf-quick-donate-card p{margin:0 0 14px;font-size:14px;line-height:1.7;color:#64748b}.msf-quick-donate-action{width:100%;min-height:48px;border:0;border-radius:12px;background:linear-gradient(135deg,#16a34a,#047857);color:#fff;font-weight:900;font-size:15px;cursor:pointer;box-shadow:0 12px 24px rgba(4,120,87,.22)}.msf-quick-donate-note{display:inline-flex;align-items:center;gap:6px;margin-top:12px;font-size:12px;font-weight:800;color:#047857}.msf-quick-donate-action:hover{filter:brightness(.96);transform:translateY(-1px)}
@media(max-width:782px){.msf-quick-donate-card{left:12px;right:12px;bottom:12px;width:auto;display:grid;grid-template-columns:54px 1fr 110px;align-items:center;gap:10px;text-align:right;padding:14px 14px 14px 14px;border-radius:18px}.msf-quick-donate-icon{position:static;transform:none;width:54px;height:54px;border-width:0}.msf-quick-donate-card h3{font-size:18px;margin:0}.msf-quick-donate-card p{font-size:12px;margin:2px 0 0}.msf-quick-donate-action{min-height:46px}.msf-quick-donate-note{grid-column:2/4;margin:0;font-size:11px}}


/* vFINAL quick donate: keep backend native modal available, hide only its original small launcher */
#msf-qd-native-host{display:block!important;position:static!important;width:auto!important;height:0!important;min-height:0!important;overflow:visible!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;z-index:auto!important;}
#msf-qd-native-host .miyaar-quick-donate-wrap{display:block!important;position:static!important;width:auto!important;height:0!important;min-height:0!important;overflow:visible!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;}
#msf-qd-native-host .miyaar-qd-open{position:fixed!important;left:-100000px!important;top:-100000px!important;width:1px!important;height:1px!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important;}
#msf-qd-native-host .miyaar-qd-modal,
#msf-qd-native-host .miyaar-qd-thanks-modal,
#msf-qd-native-host .miyaar-qd-receipt-modal{z-index:999999!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;}
.msf-quick-donate-card{z-index:9998!important;}

/* Cart selected/total amount in header */
.msf-header-cart-total{display:inline-flex;align-items:center;gap:3px;font-weight:900;color:inherit;white-space:nowrap;line-height:1}
.msf-header-cart-total b{font:inherit;color:inherit}

/* v1.5.8 mobile header root fix: sticky mobile header, working menu, clean cart/login layout */
@media (max-width:960px){
  .msf-header{
    position:sticky !important;
    top:0 !important;
    z-index:9990 !important;
    overflow:visible !important;
    background:var(--msf-header-bg,#fff) !important;
    box-shadow:0 8px 24px rgba(15,23,42,.10) !important;
    -webkit-transform:translateZ(0);
            transform:translateZ(0);
  }
  .msf-header .msf-header-inner{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 46px auto !important;
    grid-template-areas:"actions toggle brand" !important;
    align-items:center !important;
    gap:8px !important;
    padding:8px 10px !important;
    min-height:60px !important;
    direction:ltr !important;
  }
  .msf-header .msf-actions-login-cart,
  .msf-header .msf-actions{
    grid-area:actions !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:6px !important;
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    position:relative !important;
    z-index:3 !important;
  }
  .msf-header .msf-mobile-toggle{
    grid-area:toggle !important;
    width:46px !important;
    height:46px !important;
    min-width:46px !important;
    padding:0 !important;
    border-radius:15px !important;
    display:inline-flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    gap:4px !important;
    position:relative !important;
    z-index:4 !important;
    touch-action:manipulation !important;
  }
  .msf-header .msf-mobile-toggle span{width:20px !important;height:2px !important;margin:0 !important;display:block !important;opacity:1 !important;}
  .msf-header.is-mobile-open .msf-mobile-toggle span:nth-child(1){transform:translateY(6px) rotate(45deg) !important;}
  .msf-header.is-mobile-open .msf-mobile-toggle span:nth-child(2){opacity:0 !important;}
  .msf-header.is-mobile-open .msf-mobile-toggle span:nth-child(3){transform:translateY(-6px) rotate(-45deg) !important;}
  .msf-header .msf-brand{
    grid-area:brand !important;
    justify-self:end !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    max-width:25vw !important;
    min-width:0 !important;
    margin:0 !important;
  }
  .msf-header .msf-brand img{max-height:40px !important;width:auto !important;}
  .msf-header .msf-brand span{display:none !important;}
  .msf-header .msf-header-cart{
    width:auto !important;
    min-width:82px !important;
    max-width:128px !important;
    height:44px !important;
    min-height:44px !important;
    padding:0 10px !important;
    border-radius:15px !important;
    gap:5px !important;
    overflow:visible !important;
    flex:0 0 auto !important;
    direction:rtl !important;
  }
  .msf-header .msf-header-cart-icon{font-size:20px !important;line-height:1 !important;}
  .msf-header .msf-header-cart-label{display:none !important;}
  .msf-header .msf-header-cart-total{display:inline-flex !important;font-size:12px !important;font-weight:900 !important;line-height:1 !important;white-space:nowrap !important;}
  .msf-header .msf-cart-count{top:-6px !important;right:-6px !important;min-width:19px !important;height:19px !important;padding:0 5px !important;font-size:10px !important;border-width:2px !important;}
  .msf-header .msf-login-btn-modern{
    min-height:44px !important;
    height:44px !important;
    padding:0 12px !important;
    border-radius:15px !important;
    font-size:14px !important;
    gap:6px !important;
    flex:0 0 auto !important;
  }
  .msf-header .msf-login-btn-modern svg{width:18px !important;height:18px !important;}
  .msf-header .msf-nav{
    position:absolute !important;
    top:calc(100% + 8px) !important;
    right:10px !important;
    left:10px !important;
    display:none !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:8px !important;
    padding:10px !important;
    background:#fff !important;
    border:1px solid rgba(15,23,42,.10) !important;
    border-radius:18px !important;
    box-shadow:0 18px 46px rgba(15,23,42,.18) !important;
    z-index:9992 !important;
    overflow:visible !important;
    white-space:normal !important;
  }
  .msf-header.is-mobile-open .msf-nav{display:flex !important;}
  .msf-header .msf-nav a{display:block !important;text-align:right !important;padding:13px 14px !important;border-radius:13px !important;background:#fff !important;border:1px solid rgba(15,23,42,.08) !important;color:var(--msf-header-text,#0f172a) !important;text-decoration:none !important;}
}
@media (max-width:380px){
  .msf-header .msf-header-inner{grid-template-columns:minmax(0,1fr) 42px auto !important;gap:6px !important;padding-inline:8px !important;}
  .msf-header .msf-mobile-toggle{width:42px !important;height:42px !important;min-width:42px !important;}
  .msf-header .msf-header-cart{min-width:76px !important;max-width:106px !important;padding:0 8px !important;}
  .msf-header .msf-login-btn-modern{padding:0 10px !important;font-size:13px !important;}
  .msf-header .msf-brand img{max-height:36px !important;}
}


/* v1.5.9 ROOT FIX - mobile header only: fixed header, reliable menu, clean cart/login */
@media (max-width:960px){
  body{padding-top:70px !important;}
  body.admin-bar{padding-top:116px !important;}
  .msf-shell:has(.msf-header){padding-top:0 !important;}
  .msf-header{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    right:0 !important;
    width:100% !important;
    z-index:2147483000 !important;
    overflow:visible !important;
    background:var(--msf-header-bg,#fff) !important;
    color:var(--msf-header-text,#0f172a) !important;
    box-shadow:0 8px 24px rgba(15,23,42,.12) !important;
    transform:none !important;
    -webkit-transform:none !important;
  }
  body.admin-bar .msf-header{top:46px !important;}
  .msf-header .msf-header-inner{
    width:100% !important;
    max-width:none !important;
    box-sizing:border-box !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 46px auto !important;
    grid-template-areas:"actions toggle brand" !important;
    align-items:center !important;
    gap:8px !important;
    min-height:64px !important;
    padding:9px 10px !important;
    direction:ltr !important;
  }
  .msf-header .msf-actions,
  .msf-header .msf-actions-login-cart{
    grid-area:actions !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:7px !important;
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    margin:0 !important;
    position:relative !important;
    z-index:3 !important;
    pointer-events:auto !important;
  }
  .msf-header .msf-mobile-toggle{
    grid-area:toggle !important;
    display:inline-flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    gap:4px !important;
    width:46px !important;
    height:46px !important;
    min-width:46px !important;
    min-height:46px !important;
    padding:0 !important;
    margin:0 !important;
    border-radius:15px !important;
    background:#fff !important;
    border:1px solid rgba(15,23,42,.14) !important;
    box-shadow:0 6px 16px rgba(15,23,42,.08) !important;
    cursor:pointer !important;
    position:relative !important;
    z-index:6 !important;
    pointer-events:auto !important;
    touch-action:manipulation !important;
    order:0 !important;
  }
  .msf-header .msf-mobile-toggle span{
    display:block !important;
    width:20px !important;
    height:2px !important;
    margin:0 !important;
    border-radius:999px !important;
    background:var(--msf-header-text,#0f172a) !important;
    opacity:1 !important;
    transition:transform .18s ease,opacity .18s ease !important;
  }
  .msf-header.is-mobile-open .msf-mobile-toggle span:nth-child(1){transform:translateY(6px) rotate(45deg) !important;}
  .msf-header.is-mobile-open .msf-mobile-toggle span:nth-child(2){opacity:0 !important;}
  .msf-header.is-mobile-open .msf-mobile-toggle span:nth-child(3){transform:translateY(-6px) rotate(-45deg) !important;}
  .msf-header .msf-brand{
    grid-area:brand !important;
    justify-self:end !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    width:auto !important;
    max-width:24vw !important;
    min-width:0 !important;
    margin:0 !important;
    order:0 !important;
    position:relative !important;
    z-index:2 !important;
  }
  .msf-header .msf-brand img{max-height:40px !important;width:auto !important;display:block !important;}
  .msf-header .msf-brand span{display:none !important;}
  .msf-header .msf-header-cart{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:5px !important;
    width:auto !important;
    min-width:84px !important;
    max-width:126px !important;
    height:44px !important;
    min-height:44px !important;
    padding:0 9px !important;
    border-radius:15px !important;
    box-sizing:border-box !important;
    flex:0 0 auto !important;
    overflow:visible !important;
    direction:rtl !important;
    position:relative !important;
    z-index:4 !important;
  }
  .msf-header .msf-header-cart-icon{font-size:19px !important;line-height:1 !important;}
  .msf-header .msf-header-cart-label{display:none !important;}
  .msf-header .msf-header-cart-total{display:inline-flex !important;align-items:center !important;font-size:12px !important;font-weight:900 !important;line-height:1 !important;white-space:nowrap !important;}
  .msf-header .msf-cart-count{top:-6px !important;right:-6px !important;min-width:19px !important;height:19px !important;padding:0 5px !important;font-size:10px !important;border-width:2px !important;}
  .msf-header .msf-login-btn-modern{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    height:44px !important;
    min-height:44px !important;
    padding:0 11px !important;
    border-radius:15px !important;
    font-size:14px !important;
    gap:6px !important;
    line-height:1 !important;
    white-space:nowrap !important;
    flex:0 0 auto !important;
    box-sizing:border-box !important;
  }
  .msf-header .msf-login-btn-modern svg{width:18px !important;height:18px !important;}
  .msf-header .msf-nav{
    grid-area:unset !important;
    position:absolute !important;
    top:calc(100% + 8px) !important;
    right:10px !important;
    left:10px !important;
    width:auto !important;
    display:none !important;
    flex-direction:column !important;
    align-items:stretch !important;
    justify-content:flex-start !important;
    gap:8px !important;
    padding:10px !important;
    margin:0 !important;
    background:#fff !important;
    border:1px solid rgba(15,23,42,.10) !important;
    border-radius:18px !important;
    box-shadow:0 18px 46px rgba(15,23,42,.18) !important;
    z-index:2147483001 !important;
    overflow:visible !important;
    white-space:normal !important;
  }
  .msf-header.is-mobile-open .msf-nav{display:flex !important;}
  .msf-header .msf-nav a{
    display:block !important;
    text-align:right !important;
    padding:13px 14px !important;
    border-radius:13px !important;
    background:#fff !important;
    border:1px solid rgba(15,23,42,.08) !important;
    color:var(--msf-header-text,#0f172a) !important;
    text-decoration:none !important;
  }
}
@media (max-width:380px){
  body{padding-top:66px !important;}
  body.admin-bar{padding-top:112px !important;}
  .msf-header .msf-header-inner{grid-template-columns:minmax(0,1fr) 42px auto !important;gap:6px !important;padding-inline:8px !important;min-height:60px !important;}
  .msf-header .msf-mobile-toggle{width:42px !important;height:42px !important;min-width:42px !important;min-height:42px !important;}
  .msf-header .msf-header-cart{min-width:76px !important;max-width:106px !important;padding:0 7px !important;height:42px !important;min-height:42px !important;}
  .msf-header .msf-login-btn-modern{height:42px !important;min-height:42px !important;padding:0 9px !important;font-size:13px !important;}
  .msf-header .msf-brand img{max-height:36px !important;}
}


