/* RF-AVALON Market V61.0.108
   Fix selected sale-item compositing over desktop hover tooltips.
   V105 used translateZ(0) on the selected inventory slot; Chromium can promote
   that slot to its own GPU compositing layer. In a scrollable inventory this
   could paint the selected icon/check over another item's fixed tooltip.
   Keep the visible selection outline/glow/check, but remove the promoted layer
   and define one explicit stacking context for the entire inventory. */

.item-sale-modal .item-sale-bags {
  position: relative !important;
  isolation: isolate !important;
  z-index: 0 !important;
}

.item-sale-modal .item-sale-bag,
.item-sale-modal .item-sale-bag > div {
  position: relative !important;
  z-index: auto !important;
}

.item-sale-modal .item-sale-bag .equipment-slot {
  z-index: 1 !important;
}

/* Selection remains bright, but no translateZ / scale compositing layer. */
.item-sale-modal .item-sale-bag .equipment-slot.selected {
  z-index: 2 !important;
  transform: none !important;
  will-change: auto !important;
}

.item-sale-modal .item-sale-bag .equipment-slot.selected .v105-selected-check {
  z-index: 3 !important;
}

/* The slot owning a desktop hover card must always win inside the shared
   inventory stacking context, even when the selected item lives in another bag. */
@media (hover: hover) and (pointer: fine) {
  .item-sale-modal .item-sale-bag .equipment-slot.filled:hover,
  .item-sale-modal .item-sale-bag .equipment-slot.filled:focus-visible,
  .item-sale-modal .item-sale-bag .equipment-slot.filled:focus-within {
    z-index: 1000 !important;
  }

  .item-sale-modal .item-sale-bag .equipment-slot.filled:hover > .item-tooltip,
  .item-sale-modal .item-sale-bag .equipment-slot.filled:focus-visible > .item-tooltip,
  .item-sale-modal .item-sale-bag .equipment-slot.filled:focus-within > .item-tooltip {
    z-index: 100000 !important;
    background: #080d11 !important;
    opacity: 1 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transform: none !important;
  }

  /* When another item owns an open hover card, make sure the selected slot
     cannot establish a competing paint layer. Its visual selection remains. */
  .item-sale-modal .item-sale-bags:has(.equipment-slot.filled:hover > .item-tooltip)
    .equipment-slot.selected:not(:hover) {
    z-index: 1 !important;
    transform: none !important;
  }
}
