/* Poké Mart full-page — cream sheet, padrão do PC HUD. */

.loja-hud {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: stretch;
  pointer-events: auto;
  font: 500 14px/1.45 "Segoe UI", system-ui, sans-serif;
  --hud-pill-ink: #3a3328;
  --hud-pill-muted: #5c5346;
  --hud-ctrl-ink: #2a241c;
  --hud-ctrl-thumb: #0e7490;
  --text: var(--hud-pill-ink);
  --text-dim: var(--hud-pill-muted);
  color: var(--hud-pill-ink, #3a3328);
  color-scheme: light;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.loja-hud[hidden] {
  display: none !important;
}

.loja-hud.is-in {
  opacity: 1;
}

.loja-hud.is-motion,
.loja-hud.is-motion .loja-hud__sheet {
  will-change: opacity, transform;
}

.loja-hud__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 32, 24, 0.28);
}

.loja-hud__sheet {
  position: relative;
  z-index: 1;
  margin: 16px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffef8 0%, #f6f1e6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 48px rgba(40, 32, 24, 0.28);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.loja-hud.is-in .loja-hud__sheet {
  transform: none;
}

.loja-hud.is-out .loja-hud__sheet {
  transform: translateY(10px) scale(0.985);
}

.loja-hud__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
}

.loja-hud__identity {
  min-width: 0;
}

.loja-hud__kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hud-pill-muted, #7a6f5b);
}

.loja-hud__title {
  margin: 2px 0 0;
  font: 800 26px/1.1 "Segoe UI", system-ui, sans-serif;
}

.loja-hud__wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 7.5ch;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  font: 750 16px/1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #8a6914;
  background: linear-gradient(180deg, #fffef8 0%, #f3efe6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(180, 168, 148, 0.28);
}

.loja-hud__wallet-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
}

.loja-hud__wallet b {
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
}

.loja-hud__close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--hud-pill-ink, #3a3328);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.loja-hud__close:hover {
  background: var(--hud-pill-hover, rgba(40, 32, 24, 0.07));
}

.loja-hud__modes {
  display: flex;
  gap: 8px;
}

.loja-hud__mode {
  min-height: 36px;
  padding: 6px 16px;
  border: 0;
  border-radius: 999px;
  font: 700 13px/1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hud-pill-muted, #7a6f5b);
  background: linear-gradient(180deg, #fffef8 0%, #f3efe6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(180, 168, 148, 0.28);
  cursor: pointer;
}

.loja-hud__mode:hover {
  box-shadow:
    inset 0 0 0 2px var(--hud-pill-ring, rgba(40, 32, 24, 0.28)),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.loja-hud__mode.is-active {
  color: #3f6212;
  background: color-mix(in srgb, var(--hud-pill-ready, #65a30d) 18%, #fffef8);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--hud-pill-ready, #65a30d) 50%, transparent);
}

.loja-hud__main {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  min-height: 0;
  flex: 1;
}

.loja-hud__cats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding: 2px;
}

.loja-hud__cats[hidden] {
  display: none !important;
}

.loja-hud__cat {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  font: 650 13px/1.2 system-ui, sans-serif;
  color: var(--hud-pill-ink, #3a3328);
  text-align: left;
  background: linear-gradient(180deg, #fffef8 0%, #f3efe6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(180, 168, 148, 0.28);
  cursor: pointer;
}

.loja-hud__cat:hover {
  background: var(--hud-pill-hover, rgba(40, 32, 24, 0.07));
}

.loja-hud__cat.is-active {
  color: #3f6212;
  background: color-mix(in srgb, var(--hud-pill-ready, #65a30d) 16%, #fffef8);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--hud-pill-ready, #65a30d) 46%, transparent);
}

.loja-hud__shelf {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 2px 6px 8px 2px;
  outline: none;
}

.loja-hud__empty {
  margin: auto;
  padding: 28px 12px;
  color: var(--hud-pill-muted, #7a6f5b);
  text-align: center;
}

.loja-hud__aisle-title {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 10px;
  padding: 6px 2px 8px;
  font: 750 13px/1 system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hud-pill-muted, #7a6f5b);
  background: linear-gradient(180deg, #fffef8 0%, #f3efe6 88%);
}

.loja-hud__aisle-title[hidden] {
  display: none !important;
}

.loja-hud__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  align-content: start;
}

.loja-hud__card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 128px;
  padding: 14px 10px 12px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  color: inherit;
  text-align: center;
  background: linear-gradient(180deg, #fffef8 0%, #f3efe6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(180, 168, 148, 0.28),
    0 4px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.loja-hud__card:hover {
  box-shadow:
    inset 0 0 0 2px var(--hud-pill-ring, rgba(40, 32, 24, 0.28)),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.loja-hud__card.is-selected,
.loja-hud__card:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--hud-pill-ready, #65a30d) 55%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 6px 16px rgba(0, 0, 0, 0.12);
}

.loja-hud__card.is-unaffordable .loja-hud__card-price {
  color: #b45309;
}

.loja-hud__card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}

.loja-hud__icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}

.loja-hud__icon.item-icon--tileset {
  display: inline-block;
  overflow: hidden;
  background-repeat: no-repeat;
}

.loja-hud__swatch {
  --swatch: #94a3b8;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 8px color-mix(in srgb, var(--swatch) 40%, transparent);
}

.loja-hud__swatch--diamond {
  border-radius: 0;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.loja-hud__card-name {
  max-width: 100%;
  font: 650 13px/1.25 system-ui, sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loja-hud__card-owned {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--hud-pill-muted, #7a6f5b);
}

.loja-hud__card-owned[hidden] {
  display: none !important;
}

.loja-hud__card-price {
  font: 750 13px/1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #8a6914;
}

.loja-hud__inspector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffef8 0%, #f3efe6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(180, 168, 148, 0.28);
}

.loja-hud__detail-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7f3ea, #e8e0d2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(180, 168, 148, 0.28);
}

.loja-hud__detail-icon .loja-hud__icon {
  width: 56px;
  height: 56px;
}

.loja-hud__detail-name {
  font: 750 18px/1.2 system-ui, sans-serif;
  text-align: center;
}

.loja-hud__detail-meta,
.loja-hud__detail-owned {
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #8a6914;
  text-align: center;
}

.loja-hud__detail-desc {
  margin: 0;
  min-height: 3.2em;
  font-size: 13px;
  line-height: 1.45;
  color: var(--hud-pill-muted, #7a6f5b);
}

.loja-hud__qty {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
}

.loja-hud__qty-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--hud-pill-muted, #7a6f5b);
}

.loja-hud__qty-input {
  width: 58px;
  padding: 6px 8px;
  font: inherit;
  color: var(--hud-pill-ink, #3a3328);
  text-align: center;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffef8 0%, #f3efe6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(180, 168, 148, 0.28);
}

.loja-hud__qty-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.loja-hud__qty-btn,
.loja-hud__action {
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  font: 700 12px/1 system-ui, sans-serif;
  color: var(--hud-pill-ink, #3a3328);
  background: linear-gradient(180deg, #fffef8 0%, #f3efe6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(180, 168, 148, 0.28);
  cursor: pointer;
}

.loja-hud__qty-btn:hover:not(:disabled) {
  box-shadow:
    inset 0 0 0 2px var(--hud-pill-ring, rgba(40, 32, 24, 0.28)),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.loja-hud__qty-btn:disabled,
.loja-hud__action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.loja-hud__action {
  flex: 1;
  min-width: 120px;
  min-height: 40px;
  font-size: 13px;
  color: #3f6212;
  background: color-mix(in srgb, var(--hud-pill-ready, #65a30d) 18%, #fffef8);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--hud-pill-ready, #65a30d) 50%, transparent);
}

.loja-hud__message {
  margin: 0;
  min-height: 1.3em;
  font-size: 12px;
  color: var(--hud-pill-muted, #7a6f5b);
}

.loja-hud__message[data-tone="good"] {
  color: #3f6212;
}

.loja-hud__message[data-tone="bad"] {
  color: #b45309;
}

body.is-loja-open .jogo-hotbar,
body.is-loja-open .hud-item-dock,
body.is-loja-open .hud-map-dock,
body.is-loja-open .hud-party,
body.is-loja-open .jogo-canto,
body.is-loja-open #jogo-equipe,
body.is-loja-open #jogo-prompt,
body.is-loja-open #jogo-entrar {
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .loja-hud,
  .loja-hud__sheet {
    transition: opacity 0.16s ease;
  }

  .loja-hud__sheet,
  .loja-hud.is-out .loja-hud__sheet {
    transform: none;
  }
}

@media (max-width: 720px) {
  .loja-hud__sheet {
    margin: 8px;
    padding: 14px 12px 12px;
    border-radius: 18px;
  }

  .loja-hud__header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .loja-hud__title {
    font-size: 20px;
  }

  .loja-hud__main {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(140px, 1fr) auto;
  }

  .loja-hud__cats {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .loja-hud__cat {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .loja-hud__grid {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  }

  .loja-hud__inspector {
    max-height: 42vh;
    overflow: auto;
  }
}