/* ==========================================================================
   v1.2.0-fix317
   Unified mobile management-scope switcher for headquarters + store drawers.
   ========================================================================== */

/* The scope area is mobile-drawer-only. Desktop keeps the proven existing UI. */
.fix315-mobile-menu-content .fix317-scope-heading,
.fix316-headquarters-nav-content .fix317-scope-heading{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin:2px 2px 9px;
  color:#171717;
}
.fix315-mobile-menu-content .fix317-scope-heading>div,
.fix316-headquarters-nav-content .fix317-scope-heading>div{
  display:grid;
  gap:2px;
  min-width:0;
}
.fix315-mobile-menu-content .fix317-scope-heading b,
.fix316-headquarters-nav-content .fix317-scope-heading b{
  color:#171717!important;
  font-size:15px!important;
  line-height:1.35!important;
}
.fix315-mobile-menu-content .fix317-scope-heading span,
.fix316-headquarters-nav-content .fix317-scope-heading span{
  color:#706a62!important;
  font-size:12px!important;
  line-height:1.45!important;
}
.fix315-mobile-menu-content .fix317-scope-count,
.fix316-headquarters-nav-content .fix317-scope-count{
  flex:0 0 auto;
  padding:4px 7px;
  border-radius:999px;
  background:#eee9e1;
  color:#5d564d!important;
  font-size:11px!important;
  font-style:normal;
  font-weight:800;
}

/* Explicitly defeat historical topbar white text inside the light drawer. */
.fix315-mobile-menu-content .store-scope-switcher,
.fix316-headquarters-nav-content .store-scope-switcher{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-auto-flow:row!important;
  width:100%!important;
  gap:8px!important;
  margin:0 0 14px!important;
  padding:0!important;
}
.fix315-mobile-menu-content .store-scope-switcher .store-scope-button,
.fix316-headquarters-nav-content .store-scope-switcher .store-scope-button{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-rows:auto auto!important;
  align-items:center!important;
  width:100%!important;
  max-width:none!important;
  min-height:66px!important;
  margin:0!important;
  padding:10px 46px 10px 13px!important;
  border:1px solid #ddd6cc!important;
  border-radius:14px!important;
  background:#fff!important;
  color:#171717!important;
  box-shadow:0 6px 18px rgba(35,28,21,.08)!important;
  text-align:left!important;
  opacity:1!important;
  overflow:hidden!important;
}
.fix315-mobile-menu-content .store-scope-switcher .store-scope-button>span,
.fix316-headquarters-nav-content .store-scope-switcher .store-scope-button>span{
  grid-column:1!important;
  grid-row:1!important;
  min-width:0!important;
  margin:0!important;
  color:#746d64!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:1.35!important;
  opacity:1!important;
  white-space:normal!important;
}
.fix315-mobile-menu-content .store-scope-switcher .store-scope-button>b,
.fix316-headquarters-nav-content .store-scope-switcher .store-scope-button>b{
  grid-column:1!important;
  grid-row:2!important;
  min-width:0!important;
  margin:2px 0 0!important;
  color:#171717!important;
  font-size:15px!important;
  font-weight:900!important;
  line-height:1.35!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  opacity:1!important;
}
.fix315-mobile-menu-content .store-scope-switcher .store-scope-button>i,
.fix316-headquarters-nav-content .store-scope-switcher .store-scope-button>i{
  position:absolute!important;
  top:50%!important;
  right:14px!important;
  transform:translateY(-50%)!important;
  margin:0!important;
  color:#171717!important;
  font-size:18px!important;
  font-style:normal!important;
  opacity:1!important;
}
.fix315-mobile-menu-content .store-scope-switcher .store-scope-button.is-current,
.fix316-headquarters-nav-content .store-scope-switcher .store-scope-button.is-current{
  border:2px solid #ff7200!important;
  background:#fff8ef!important;
  box-shadow:0 7px 20px rgba(255,114,0,.12)!important;
}
.fix315-mobile-menu-content .store-scope-switcher .store-scope-button.is-current::after,
.fix316-headquarters-nav-content .store-scope-switcher .store-scope-button.is-current::after{
  content:'現在';
  position:absolute;
  top:8px;
  right:9px;
  padding:3px 6px;
  border-radius:999px;
  background:#ff7200;
  color:#fff;
  font-size:10px;
  font-weight:900;
  line-height:1.2;
}
.fix315-mobile-menu-content .store-scope-switcher .store-scope-button.is-current>i,
.fix316-headquarters-nav-content .store-scope-switcher .store-scope-button.is-current>i{
  top:auto!important;
  right:14px!important;
  bottom:10px!important;
  transform:none!important;
}

/* Static/current company scope in headquarters must still be readable. */
.fix315-mobile-menu-content .store-scope-switcher span.store-scope-button,
.fix316-headquarters-nav-content .store-scope-switcher span.store-scope-button{
  cursor:default!important;
}

/* A real button gets a subtle affordance; current still remains visually clear. */
.fix315-mobile-menu-content .store-scope-switcher button.store-scope-button:not(.is-current)::before,
.fix316-headquarters-nav-content .store-scope-switcher button.store-scope-button:not(.is-current)::before{
  content:'切り替える';
  position:absolute;
  right:12px;
  bottom:9px;
  color:#d95f00;
  font-size:10px;
  font-weight:900;
}

/* Divider before navigation/actions so scope and menu are not mixed together. */
.fix315-mobile-menu-content .fix317-scope-switcher + .fix317-scope-divider,
.fix316-headquarters-nav-content .fix317-scope-switcher + .fix317-scope-divider{
  height:1px;
  margin:2px 0 12px;
  background:#ded8cf;
}

/* Store drawer: top-actions is moved wholesale by fix315.
   Keep scope switcher first, logout clearly separated underneath. */
.fix315-mobile-menu-content>.top-actions{
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
}
.fix315-mobile-menu-content>.top-actions>.store-scope-switcher{
  order:1!important;
}
.fix315-mobile-menu-content>.top-actions>#logoutButton,
.fix315-mobile-menu-content>.top-actions>.logout-button,
.fix315-mobile-menu-content>.top-actions>.tab:last-child{
  order:3!important;
}

/* Headquarters drawer: session actions contains scope + logout. */
.fix316-headquarters-nav-content .headquarters-session-actions{
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
}
.fix316-headquarters-nav-content .headquarters-session-actions>.store-scope-switcher{
  order:1!important;
}
.fix316-headquarters-nav-content .headquarters-session-actions>#companyLogoutButton{
  order:3!important;
  margin-top:2px!important;
}

/* Long store names remain usable on narrow devices. */
@media(max-width:420px){
  .fix315-mobile-menu-content .store-scope-switcher .store-scope-button>b,
  .fix316-headquarters-nav-content .store-scope-switcher .store-scope-button>b{
    font-size:14px!important;
  }
}
