/* TAIF V5 — Currency Management Bulk Editor Mobile Cards V1
   Base: V3 Dropdowns Fixed.
   Scope: only "تعديل كافة العملات" window in mobile mode.
   Converts the bulk table rows into readable cards and hides pair column on mobile. */

@media (max-width: 860px){
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-scrollarea{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    padding:8px 8px 92px !important;
    -webkit-overflow-scrolling:touch !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-sticky-stack{
    position:sticky !important;
    top:0 !important;
    z-index:8 !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    gap:6px !important;
    margin:0 0 8px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-toolbar{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:6px !important;
    padding:7px !important;
    border-radius:14px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-toolbar__search{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    flex:auto !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-toolbar__summary{
    width:100% !important;
    min-width:0 !important;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:6px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-toolbar__pill{
    width:100% !important;
    min-width:0 !important;
    min-height:28px !important;
    padding:0 6px !important;
    font-size:10.2px !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  /* Header table is not needed in mobile cards */
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-grid-head{
    display:none !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-list{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:9px !important;
    padding:0 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    display:block !important;
    padding:8px !important;
    border-radius:16px !important;
    border:1px solid rgba(37,99,235,.14) !important;
    background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%) !important;
    box-shadow:0 8px 20px rgba(15,23,42,.06) !important;
    overflow:hidden !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card--usd{
    border-color:rgba(37,99,235,.22) !important;
    background:linear-gradient(180deg,#f5f9ff 0%,#ffffff 100%) !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__row{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    display:grid !important;
    direction:rtl !important;
    grid-template-columns:42px 64px minmax(0,1fr) minmax(0,1fr) !important;
    grid-template-areas:
      "flag code name name"
      "buy buy sell sell"
      "ratio-buy ratio-buy ratio-sell ratio-sell" !important;
    gap:7px !important;
    align-items:stretch !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell{
    min-width:0 !important;
    width:100% !important;
    max-width:100% !important;
    min-height:0 !important;
    padding:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:hidden !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--flag{
    grid-area:flag !important;
    min-height:36px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--code{
    grid-area:code !important;
    min-height:36px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--name{
    grid-area:name !important;
    min-height:36px !important;
    justify-content:flex-start !important;
    padding-inline:4px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--pair{
    display:none !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--buy{
    grid-area:buy !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--sell{
    grid-area:sell !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--ratio-buy{
    grid-area:ratio-buy !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--ratio-sell{
    grid-area:ratio-sell !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__flag{
    width:34px !important;
    height:34px !important;
    flex:0 0 34px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__code{
    width:100% !important;
    height:32px !important;
    min-height:32px !important;
    border-radius:10px !important;
    font-size:11px !important;
    font-weight:900 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__name-wrap{
    width:100% !important;
    min-width:0 !important;
    display:block !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__name{
    width:100% !important;
    color:#0f172a !important;
    text-align:right !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    font-size:13px !important;
    font-weight:900 !important;
    line-height:1.1 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--input{
    display:grid !important;
    grid-template-rows:auto 36px !important;
    gap:4px !important;
    align-items:stretch !important;
    justify-content:stretch !important;
    min-height:58px !important;
    padding:6px !important;
    border-radius:13px !important;
    border:1px solid rgba(148,163,184,.18) !important;
    background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.92) !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--input::before{
    content:attr(data-mobile-label) !important;
    min-width:0 !important;
    display:block !important;
    color:#64748b !important;
    font-size:9.7px !important;
    font-weight:900 !important;
    line-height:1.2 !important;
    text-align:center !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-input{
    width:100% !important;
    height:36px !important;
    min-height:36px !important;
    padding:0 7px !important;
    border-radius:11px !important;
    font-size:12.2px !important;
    font-weight:900 !important;
    text-align:center !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--buy .currency-management-bulk-input,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--ratio-buy .currency-management-bulk-input{
    color:#15803d !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--sell .currency-management-bulk-input,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--ratio-sell .currency-management-bulk-input{
    color:#dc2626 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-modal-actions,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-modal-actions--dock{
    position:absolute !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:8px !important;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px)) !important;
    margin:0 !important;
    background:#f3f7ff !important;
    border-top:1px solid rgba(148,163,184,.16) !important;
    box-shadow:0 -10px 28px rgba(15,23,42,.08) !important;
    z-index:14 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-modal-actions .currency-management-btn{
    width:100% !important;
    min-width:0 !important;
    height:44px !important;
    min-height:44px !important;
    border-radius:14px !important;
    font-size:13px !important;
    font-weight:900 !important;
    justify-content:center !important;
  }
}

@media (max-width: 430px){
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__row{
    grid-template-columns:38px 58px minmax(0,1fr) minmax(0,1fr) !important;
    gap:6px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card{
    padding:7px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--input{
    min-height:56px !important;
    padding:5px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--input::before{
    font-size:9px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-input{
    height:34px !important;
    min-height:34px !important;
    font-size:11.6px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__flag{
    width:32px !important;
    height:32px !important;
    flex-basis:32px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__code{
    height:30px !important;
    min-height:30px !important;
    font-size:10.4px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__name{
    font-size:12.2px !important;
  }
}
