/* FollowerAbzar SMM v77.1.9 — mobile behavior owner (cards live in fasmm-orders.css) */
:root{
  --fasmm-mobile-nav-height:72px;
  --fasmm-safe-bottom:env(safe-area-inset-bottom,0px);
  --fasmm-mobile-content-bottom-gap:40px;
  --fasmm-floating-gap:12px;
  --fasmm-floating-size:54px;
  --fasmm-z-floating:1080;
}

.fasmm-panel-view{width:100%;min-width:0;max-width:100%}
.fasmm-panel-view>*{min-width:0;max-width:100%}

/* Secondary floating tools only. The shopping cart is deliberately not a child. */
.fasmm-mobile-floating-stack{
  position:fixed;
  inset-inline-end:12px;
  inset-inline-start:auto;
  inset-block-end:calc(var(--fasmm-mobile-nav-height) + var(--fasmm-safe-bottom) + 14px);
  z-index:var(--fasmm-z-floating);
  display:flex;
  flex-direction:column-reverse;
  align-items:center;
  gap:var(--fasmm-floating-gap);
  pointer-events:none;
  transition:opacity .16s ease,transform .16s ease;
}
.fasmm-mobile-floating-stack[hidden],.fasmm-mobile-floating-stack:empty{display:none}
.fasmm-mobile-floating-stack>.fasmm-mobile-floating-item,
.fasmm-mobile-floating-stack>.fasmm-representation-widget{
  position:relative;
  inset:auto;
  margin:0;
  pointer-events:auto;
}
.fasmm-mobile-floating-stack .fasmm-representation-widget__toggle{
  inline-size:var(--fasmm-floating-size);
  block-size:var(--fasmm-floating-size);
  min-inline-size:44px;
  min-block-size:44px;
}
.fasmm-mobile-floating-stack .fasmm-representation-widget__popover{
  left:0;
  right:auto;
  inset-inline:auto;
  inset-block-end:calc(100% + 10px);
}
.fasmm-floating-stack-toggle{
  pointer-events:auto;display:grid;place-items:center;width:48px;height:48px;border:0;border-radius:50%;
  background:#334155;color:#fff;box-shadow:0 8px 22px rgba(15,23,42,.2)
}
.fasmm-floating-stack-toggle .ri{display:block;width:22px;height:22px}
.fasmm-mobile-floating-stack.is-collapsible:not(.is-open)>.fasmm-mobile-floating-item{display:none}
.fasmm-mobile-floating-stack.is-collapsible.is-open>.fasmm-mobile-floating-item{display:block}
.fasmm-floating-near-footer .fasmm-mobile-floating-stack{opacity:0;pointer-events:none;transform:translateY(-8px)}

body.fasmm-ui-drawer-open .fasmm-mobile-floating-stack,
body.fasmm-admin-drawer-open .fasmm-mobile-floating-stack,
body.modal-open .fasmm-mobile-floating-stack,
body.fasmm-mobile-keyboard-open .fasmm-mobile-floating-stack,
body.wp-admin .fasmm-mobile-floating-stack{display:none}

@media(max-width:767px){
  .fasmm-panel-content{padding-inline:10px}
  .fasmm-panel-view{
    overflow-x:clip;
    padding-bottom:calc(var(--fasmm-mobile-nav-height) + var(--fasmm-safe-bottom) + var(--fasmm-mobile-content-bottom-gap));
  }
  .fasmm-panel-view[data-fasmm-tab="orders"]{
    padding-bottom:calc(var(--fasmm-mobile-nav-height) + var(--fasmm-safe-bottom) + 52px);
  }

  /* Bottom navigation owns its mobile geometry here. */
  .fasmm-ui-v75 .fasmm-mobile-bottom-nav,
  .fasmm-mobile-bottom-nav{
    position:fixed;
    inset-inline:8px;
    bottom:max(8px,var(--fasmm-safe-bottom));
    z-index:1070;
    width:auto;
    max-width:calc(100vw - 16px);
    min-height:64px;
    height:auto;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    align-items:stretch;
    gap:3px;
    padding:6px 5px;
    box-sizing:border-box;
    overflow:visible;
    border:1px solid #e7e5eb;
    border-radius:14px;
    background:#fff;
    box-shadow:0 -8px 24px rgba(15,23,42,.10);
  }
  .fasmm-mobile-bottom-nav :is(a,button){
    min-width:0;min-height:50px;padding:4px 2px;border:0;border-radius:10px;background:transparent;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    color:#778194;font-size:9px;font-weight:750;line-height:1.2;text-decoration:none;overflow:visible;
  }
  .fasmm-mobile-bottom-nav :is(a,button).active{background:#f1eaff;color:#6d4aff}
  .fasmm-mobile-bottom-nav .ri{
    display:block;width:20px;height:20px;flex:0 0 20px;color:currentColor;
  }
  .fasmm-mobile-bottom-nav span{display:block;max-width:100%;white-space:nowrap;overflow:visible;text-overflow:clip}

  /* Direct cart: always visible on panel pages except New Order, where it is not rendered server-side. */
  body.fasmm-panel-fullscreen:not(.fasmm-new-order-active) .fasmm-cart-float.fasmm-cart-float-direct{
    position:fixed;
    inset-inline-start:12px;
    inset-inline-end:auto;
    inset-block-end:calc(var(--fasmm-mobile-nav-height) + var(--fasmm-safe-bottom) + 14px);
    z-index:var(--fasmm-z-floating);
    width:54px;height:54px;min-width:54px;min-height:54px;
    display:grid;place-items:center;
    margin:0;transform:none;
  }
  body.fasmm-panel-fullscreen:not(.fasmm-new-order-active) .fasmm-cart-float.fasmm-cart-float-direct>.ri{
    display:block;width:24px;height:24px;flex:0 0 24px;color:currentColor;
  }
  body.fasmm-panel-fullscreen:not(.fasmm-new-order-active) .fasmm-cart-float.fasmm-cart-float-direct .fasmm-cart-count{
    pointer-events:none;
  }


  body.fasmm-new-order-active .fasmm-mobile-bottom-nav{display:none}
  body.fasmm-new-order-active .fasmm-cart-float.fasmm-cart-float-direct{display:none}
  body.fasmm-new-order-active [data-fasmm-representation-widget],
  body.fasmm-new-order-active .fasmm-representation-widget{display:none}
  body.fasmm-new-order-active .fasmm-panel-view,
  .fasmm-panel-view[data-fasmm-tab="new-order"]{padding-bottom:24px}
  .fasmm-mobile-floating-stack{display:flex}
  body.fasmm-mobile-keyboard-open .fasmm-cart-float,
  body.fasmm-mobile-keyboard-open .fasmm-mobile-bottom-nav{opacity:0;visibility:hidden;pointer-events:none}
}

@media(max-width:359px){
  .fasmm-panel-content{padding-inline:8px}
  .fasmm-mobile-bottom-nav{inset-inline:5px;max-width:calc(100vw - 10px);padding-inline:3px}
  .fasmm-mobile-bottom-nav :is(a,button){font-size:8.5px}
  body.fasmm-panel-fullscreen:not(.fasmm-new-order-active) .fasmm-cart-float.fasmm-cart-float-direct{
    inset-inline-start:10px;width:50px;height:50px;min-width:50px;min-height:50px;
  }
}

@media(min-width:768px){
  .fasmm-mobile-floating-stack,.fasmm-mobile-bottom-nav{display:none}
}

@media(prefers-reduced-motion:reduce){.fasmm-mobile-floating-stack{transition:none}}

/* Admin mobile refinements; scoped, no changes to desktop shell ownership. */
@media(max-width:1023px){
  body.wp-admin .fasmm-admin-root,
  body.wp-admin .wrap.fasmm-admin{max-width:100%;min-width:0;overflow-x:hidden}
  body.wp-admin .fasmm-admin-shell{display:block!important;width:100%!important;min-width:0!important;padding:12px!important}
  body.wp-admin .fasmm-admin-main{width:100%!important;min-width:0!important;max-width:100%!important;margin:0!important}
  body.wp-admin .fasmm-admin-sidebar{width:min(88vw,360px)!important;max-width:360px!important;min-width:0!important}
  body.wp-admin .fasmm-admin-page-header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
  body.wp-admin .fasmm-admin-page-header h1{font-size:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.wp-admin .fasmm-admin-toolbar,
  body.wp-admin .fasmm-admin-filterbar,
  body.wp-admin .fasmm-bulk-toolbar{grid-template-columns:1fr!important;align-items:stretch!important}
  body.wp-admin .fasmm-admin-toolbar .button,
  body.wp-admin .fasmm-admin-filterbar .button{min-height:44px}
  body.wp-admin .fasmm-admin-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media(max-width:767px){
  body.wp-admin .fasmm-summary-row{display:grid!important;grid-template-columns:1fr auto;gap:8px;padding:12px;border:1px solid #e2e8f0;border-radius:12px;margin-bottom:10px;background:#fff}
  body.wp-admin .fasmm-summary-row>td{display:block!important;width:auto!important;max-width:100%;border:0!important;padding:4px!important;white-space:normal!important}
  body.wp-admin .fasmm-summary-row>td[data-label]::before{content:attr(data-label);display:block;color:#64748b;font-size:11px;margin-bottom:2px}
  body.wp-admin .fasmm-expansion-row{display:block!important}
  body.wp-admin .fasmm-expansion-row>td{display:block!important;width:100%!important;padding:0!important}
  body.wp-admin .fasmm-admin-status-tabs{display:flex!important;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;gap:8px;padding-bottom:5px}
  body.wp-admin .fasmm-admin-status-tabs>*{flex:0 0 auto;scroll-snap-align:start;min-height:42px}
}

@media(max-width:767px){
  body.wp-admin .fasmm-services-table-scroll{overflow:visible!important;border:0!important}
  body.wp-admin table.fasmm-services-table{display:block!important;min-width:0!important;width:100%!important;background:transparent!important}
  body.wp-admin table.fasmm-services-table thead{display:none!important}
  body.wp-admin table.fasmm-services-table tbody{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
  body.wp-admin table.fasmm-services-table tbody tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%!important;padding:12px!important;border:1px solid #e2e8f0!important;border-radius:12px!important;background:#fff!important;box-sizing:border-box!important}
  body.wp-admin table.fasmm-services-table tbody td{display:block!important;width:auto!important;max-width:100%!important;padding:5px!important;border:0!important;white-space:normal!important;overflow-wrap:break-word!important}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(2),
  body.wp-admin table.fasmm-services-table tbody td:nth-child(3),
  body.wp-admin table.fasmm-services-table tbody td:nth-child(10){grid-column:1/-1}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(1)::before{content:'انتخاب';display:block;color:#64748b;font-size:11px}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(2)::before{content:'شناسه';display:block;color:#64748b;font-size:11px}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(3)::before{content:'سرویس';display:block;color:#64748b;font-size:11px}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(4)::before{content:'برند / دسته';display:block;color:#64748b;font-size:11px}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(5)::before{content:'فروش';display:block;color:#64748b;font-size:11px}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(6)::before{content:'ارائه‌دهنده';display:block;color:#64748b;font-size:11px}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(7)::before{content:'قیمت و سود';display:block;color:#64748b;font-size:11px}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(8)::before{content:'محدوده / همگام‌سازی';display:block;color:#64748b;font-size:11px}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(9)::before{content:'سلامت';display:block;color:#64748b;font-size:11px}
  body.wp-admin table.fasmm-services-table tbody td:nth-child(10)::before{content:'عملیات';display:block;color:#64748b;font-size:11px}
  body.wp-admin .fasmm-admin-order-list{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
  body.wp-admin .fasmm-admin-order-card{width:100%!important;min-width:0!important;max-width:100%!important;padding:12px!important}
  body.wp-admin .fasmm-admin-order-card .fasmm-order-admin-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.wp-admin .fasmm-services-bulk-row,.fasmm-admin-root .fasmm-bulk-row{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  body.wp-admin .fasmm-services-bulk-row>*{width:100%!important;min-height:44px!important}
}
