/* WHERING 4.5.2 — proporções naturais e composição sem sobreposição.
   Corrige a tentativa 4.5.1: nenhuma peça principal usa posicionamento absoluto.
   TOP, BOT e FTW têm faixas próprias e nunca invadem umas às outras. */

/* ===== BANCO DE RESERVA ===== */
.saved-bank-grid{
  align-items:start!important;
  grid-auto-rows:max-content!important;
  gap:12px!important;
}
.saved-look-card{
  align-self:start!important;
  height:auto!important;
}
.saved-look-card-head{padding:7px 9px 5px!important}
.saved-look-card-title strong{
  font-size:9.5px!important;
  line-height:1.18!important;
  font-weight:700!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.saved-look-card-title small{font-size:7px!important;margin-top:1px!important}
.saved-look-status{font-size:7px!important;padding:3px 6px!important}

/* Canvas: três zonas independentes e compactas. */
.saved-stage{
  position:relative!important;
  display:grid!important;
  height:344px!important;
  min-height:344px!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:120px 132px 76px!important;
  gap:3px!important;
  margin:0 8px!important;
  padding:4px 8px!important;
  overflow:hidden!important;
}
.saved-stage.has-optionals{
  grid-template-columns:minmax(0,1fr) 72px!important;
}
.saved-stage-main{
  position:relative!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  inset:auto!important;
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
.saved-stage-top{grid-column:1!important;grid-row:1!important}
.saved-stage-bottom{grid-column:1!important;grid-row:2!important}
.saved-stage-footwear{grid-column:1!important;grid-row:3!important}
.saved-stage-top-pair{
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  padding:0!important;
  overflow:hidden!important;
}
.saved-stage-top.two .saved-stage-top-pair{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:center!important;
  justify-items:center!important;
  gap:6px!important;
  padding:0 2px!important;
}
.saved-stage img{
  display:block!important;
  width:auto!important;
  height:auto!important;
  object-fit:contain!important;
}
/* TOP e BOT têm alturas próximas de propósito: evita o efeito "Abaporu". */
.saved-stage-top img{max-width:178px!important;max-height:118px!important}
.saved-stage-top.two img{max-width:128px!important;max-height:110px!important}
.saved-stage-bottom img{max-width:158px!important;max-height:130px!important}
.saved-stage-bottom.is-short img{max-width:155px!important;max-height:116px!important}
.saved-stage-footwear img{max-width:166px!important;max-height:70px!important}
.saved-stage-code{font-size:6px!important;bottom:0!important;opacity:.58!important}

/* Opcionais continuam legíveis, mas fora do eixo vertical do look principal. */
.saved-stage-optionals{
  position:static!important;
  transform:none!important;
  grid-column:2!important;
  grid-row:1 / span 3!important;
  width:auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  overflow:hidden!important;
}
.saved-stage-optional{
  width:64px!important;
  height:62px!important;
  min-height:62px!important;
  flex:0 0 62px!important;
  padding:4px!important;
  border-radius:9px!important;
}
.saved-stage-optional img{max-width:54px!important;max-height:52px!important}

/* Meias e relógio: leitura suficiente sem cobrir calçado. */
.saved-stage-socks,
.saved-stage-watch{
  position:absolute!important;
  z-index:9!important;
  bottom:7px!important;
  width:60px!important;
  height:60px!important;
  padding:4px!important;
  border-radius:9px!important;
}
.saved-stage-socks{left:7px!important}
.saved-stage-watch{right:7px!important}
.saved-stage.has-optionals .saved-stage-watch{right:80px!important}
.saved-stage-socks img,
.saved-stage-watch img{max-width:49px!important;max-height:47px!important}
.saved-stage-socks span,
.saved-stage-watch span{font-size:5.7px!important;bottom:2px!important}
.saved-look-card-foot{padding:6px 9px 9px!important}
.saved-look-codes-full{margin-bottom:5px!important;font-size:6.7px!important}

/* ===== TROCAR LOOK ASSOCIADO ===== */
.wear-swap-dialog{
  width:min(1240px,calc(100vw - 24px))!important;
  max-height:94vh!important;
}
.wear-swap-shell{max-height:94vh!important;padding:15px!important}
.wear-swap-head h3{font-size:19px!important}
.wear-swap-head p{font-size:11px!important}
.wear-swap-search{margin-bottom:10px!important}
.wear-swap-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:start!important;
  grid-auto-rows:414px!important;
  gap:10px!important;
  overflow:auto!important;
  padding:2px 5px 5px 0!important;
}
.wear-swap-card.wear-swap-card-visual{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:326px 38px 36px!important;
  height:414px!important;
  min-height:414px!important;
  max-height:414px!important;
  gap:5px!important;
  align-items:stretch!important;
  padding:7px!important;
  overflow:hidden!important;
}
.wear-swap-card .saved-stage{
  width:100%!important;
  height:326px!important;
  min-height:326px!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:112px 124px 70px!important;
  gap:3px!important;
  margin:0!important;
  padding:4px 7px!important;
  overflow:hidden!important;
}
.wear-swap-card .saved-stage.has-optionals{
  grid-template-columns:minmax(0,1fr) 64px!important;
}
.wear-swap-card .saved-stage-main{
  position:relative!important;
  inset:auto!important;
  width:auto!important;
  height:auto!important;
}
.wear-swap-card .saved-stage-top img{max-width:160px!important;max-height:110px!important}
.wear-swap-card .saved-stage-top.two img{max-width:112px!important;max-height:102px!important}
.wear-swap-card .saved-stage-bottom img{max-width:146px!important;max-height:122px!important}
.wear-swap-card .saved-stage-bottom.is-short img{max-width:142px!important;max-height:108px!important}
.wear-swap-card .saved-stage-footwear img{max-width:154px!important;max-height:64px!important}
.wear-swap-card .saved-stage-optionals{
  position:static!important;
  transform:none!important;
  grid-column:2!important;
  grid-row:1 / span 3!important;
  width:auto!important;
  gap:5px!important;
}
.wear-swap-card .saved-stage-optional{
  width:56px!important;
  height:56px!important;
  min-height:56px!important;
  flex:0 0 56px!important;
  padding:3px!important;
}
.wear-swap-card .saved-stage-optional img{max-width:48px!important;max-height:46px!important}
.wear-swap-card .saved-stage-socks,
.wear-swap-card .saved-stage-watch{
  width:56px!important;
  height:56px!important;
  padding:3px!important;
  bottom:6px!important;
}
.wear-swap-card .saved-stage-socks{left:6px!important}
.wear-swap-card .saved-stage-watch{right:6px!important}
.wear-swap-card .saved-stage.has-optionals .saved-stage-watch{right:70px!important}
.wear-swap-card .saved-stage-socks img,
.wear-swap-card .saved-stage-watch img{max-width:46px!important;max-height:44px!important}
.wear-swap-card-main{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  gap:2px!important;
  padding:0 2px!important;
  overflow:hidden!important;
}
.wear-swap-card-main strong{
  font-size:9.5px!important;
  line-height:1.15!important;
  font-weight:700!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.wear-swap-card-main small{
  font-size:6.5px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.wear-swap-card>button{
  align-self:end!important;
  width:100%!important;
  height:36px!important;
  min-height:36px!important;
  max-height:36px!important;
  padding:0 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:10px!important;
  line-height:1!important;
}

@media(max-width:1050px){
  .wear-swap-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
  .saved-stage{
    height:326px!important;
    min-height:326px!important;
    grid-template-rows:112px 124px 70px!important;
  }
  .saved-stage-top img{max-width:160px!important;max-height:110px!important}
  .saved-stage-bottom img{max-width:148px!important;max-height:122px!important}
  .saved-stage-footwear img{max-width:154px!important;max-height:64px!important}
  .saved-stage-optional{width:56px!important;height:56px!important;min-height:56px!important;flex-basis:56px!important}
  .saved-stage-optional img{max-width:47px!important;max-height:46px!important}
  .saved-stage-socks,.saved-stage-watch{width:55px!important;height:55px!important}

  .wear-swap-dialog{width:calc(100vw - 10px)!important;max-height:96vh!important}
  .wear-swap-shell{max-height:96vh!important;padding:11px!important}
  .wear-swap-grid{grid-template-columns:1fr!important;grid-auto-rows:398px!important;gap:8px!important}
  .wear-swap-card.wear-swap-card-visual{
    grid-template-rows:310px 36px 36px!important;
    height:398px!important;
    min-height:398px!important;
    max-height:398px!important;
  }
  .wear-swap-card .saved-stage{
    height:310px!important;
    min-height:310px!important;
    grid-template-rows:106px 116px 68px!important;
  }
}
