/* r851 — mobile commerce navigation:
   the logo already links home; keep only useful links on small screens.
   The wider header and all payment controls are unchanged. */
@media(max-width:580px){
  html[dir="rtl"] body.fbrkh-commerce-shell > header.topbar:has(>a.brand):has(>nav){
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:7px!important;
    width:calc(100% - 12px)!important;
    max-width:calc(100% - 12px)!important;
    padding-inline:9px!important;
    margin-inline:auto!important;
    direction:rtl!important;
    box-sizing:border-box!important;
  }
  html[dir="rtl"] body.fbrkh-commerce-shell > header.topbar > a.brand{
    display:flex!important;flex:0 1 123px!important;
    width:min(123px,37vw)!important;
    min-width:0!important;max-width:123px!important;
    margin:0!important;padding:0!important;
    justify-content:flex-start!important;
  }
  html[dir="rtl"] body.fbrkh-commerce-shell > header.topbar > a.brand img{
    width:100%!important;max-width:123px!important;
    height:auto!important;max-height:62px!important;
    object-fit:contain!important;
  }
  html[dir="rtl"] body.fbrkh-commerce-shell > header.topbar > nav{
    display:flex!important;flex:0 1 auto!important;
    min-width:0!important;max-width:calc(100% - 128px)!important;
    margin:0!important;padding:0!important;
    flex-wrap:nowrap!important;align-items:center!important;
    gap:4px!important;
    justify-content:flex-end!important;
  }
  html[dir="rtl"] body.fbrkh-commerce-shell > header.topbar > nav > a[href="/"]{
    display:none!important;
  }
  html[dir="rtl"] body.fbrkh-commerce-shell > header.topbar > nav > a{
    flex:0 1 auto!important;min-width:0!important;
    font-size:11px!important;
    padding-inline:5px!important;
    white-space:nowrap!important;
  }
  html[dir="rtl"] body.fbrkh-commerce-shell > header.topbar > nav > button{
    flex:0 0 42px!important;width:42px!important;
    min-width:42px!important;max-width:42px!important;
    margin:0!important;padding:0!important;
  }
}


/* r852: r851 link had lower specificity than fbrkh-next-shell modern nav.
 * The brand already links to home; keep available width for accessibility. */
@media (max-width:580px){
  :root[data-ui-mode="modern"] body.fbrkh-next-shell.fbrkh-commerce-shell > header.topbar > nav > a[href="/"],
  :root[data-ui-mode="classic"] body.fbrkh-commerce-shell > header.topbar > nav > a[href="/"]{
    display:none!important;
    visibility:hidden!important;
  }
  :root[data-ui-mode="modern"] body.fbrkh-next-shell.fbrkh-commerce-shell > header.topbar > nav{
    min-width:0!important;
    max-width:calc(100% - 128px)!important;
  }
}
