/* =====================================================
  Poke Ponte — Página "Lojas de TCG Próximas"
  Mapa do Google Maps (sem necessidade de chave de API)
  com busca por cidade/endereço ou pela localização atual
  do treinador.
  ===================================================== */

#lojas-page {
  padding: 60px 8% 80px;
  min-height: 80vh;
  overflow-x: hidden;
}

#lojas-page h1 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 38px;
}

.lojas-controles {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(940px, 100%);
  margin: 30px auto 10px;
}

.lojas-search {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 52px;
  padding: 0 17px;
  border: 1px solid var(--borda-forte);
  border-radius: 12px;
  background: var(--bg-elevado);
}

.lojas-search:focus-within {
  border-color: var(--accent);
  outline: 3px solid var(--accent-suave);
}

.lojas-search > svg {
  width: 21px;
  height: 21px;
  color: var(--accent);
  stroke-width: 2.2;
}

.lojas-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--texto-primario);
  background: transparent;
  font: 500 14px var(--fonte-base);
}

.lojas-search input::placeholder {
  color: var(--texto-terciario);
}

.lojas-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.lojas-search-acoes {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  background: var(--accent);
  color: var(--accent-contraste);
  border: none;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  box-shadow: none;
  white-space: nowrap;
}

.btn-mini svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
}

.btn-mini:hover {
  background: var(--accent-forte);
}

.btn-mini:active {
  background: var(--accent);
}

.btn-mini-secundario {
  background: var(--bg-elevado);
  color: var(--texto-primario);
  border: 1px solid var(--borda-forte);
  box-shadow: none;
}

.btn-mini-secundario:hover {
  border-color: var(--accent);
  color: var(--accent-forte);
  background: var(--bg-elevado);
}

.lojas-status {
  text-align: center;
  color: var(--texto-secundario);
  font-size: 13px;
  min-height: 18px;
  margin: 16px 0 24px;
  transition: color .2s;
}

.lojas-status.lojas-status-erro {
  color: var(--erro);
  font-weight: 600;
}

#lojasSugestoes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
  padding-inline: 8px;
}

#lojasSugestoes .busca-tag-pill {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--borda-forte);
  border-radius: 999px;
  background: var(--bg-elevado);
  color: var(--texto-secundario);
  font: 700 12px var(--fonte-base);
  cursor: pointer;
}

.lojas-mapa-wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--borda-cor);
  box-shadow: 0 20px 45px var(--sombra-forte);
  background: var(--bg-elevado);
}

.lojas-mapa-shell {
  position: relative;
}

.lojas-mapa {
  width: 100%;
  height: 520px;
  border: 0;
  display: block;
}

.lojas-mapa:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.pokemon-indicador {
  position: absolute;
  z-index: 700;
  top: 12px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #17151d;
  font-size: 12px;
  font-weight: 800;
  transform: translateX(-50%);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .12);
  pointer-events: none;
}

.pokemon-indicador-ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5100;
}

.pokemon-map-marker {
  background: transparent;
  border: 0;
  transition: transform .12s linear;
}

.lpc-character {
  position: absolute;
  inset: 0;
  display: block;
  --direction-y: -160px;
}

.lpc-character.direction-up { --direction-y: 0; }
.lpc-character.direction-left { --direction-y: -80px; }
.lpc-character.direction-down { --direction-y: -160px; }
.lpc-character.direction-right { --direction-y: -240px; }

.lpc-character-shadow {
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 12px;
  width: 31px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .26);
  transform: translateX(-50%);
}

.lpc-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 80px;
  height: 80px;
  background-repeat: no-repeat;
  background-position-x: 0;
  background-position-y: var(--direction-y);
  background-size: 720px 320px;
  image-rendering: pixelated;
}

.lpc-body { background-image: url('../vendor/lpc/trainer/body.png'); }
.lpc-shoes { background-image: url('../vendor/lpc/trainer/custom-shoes.png'); }
.lpc-pants { background-image: url('../vendor/lpc/trainer/custom-pants.png'); }
.lpc-shirt { background-image: url('../vendor/lpc/trainer/custom-shirt.png'); }
.lpc-head { background-image: url('../vendor/lpc/trainer/head.png'); }
.lpc-hair { background-image: url('../vendor/lpc/trainer/custom-hair.png'); }

.lpc-character.is-moving .lpc-character-shadow {
  animation: lpc-shadow-step .36s ease-in-out infinite alternate;
}

@keyframes lpc-shadow-step {
  from { transform: translateX(-50%) scaleX(1); opacity: .8; }
  to { transform: translateX(-50%) scaleX(.82); opacity: .58; }
}

@media (prefers-reduced-motion: reduce) {
  .pokemon-map-marker,
  .lpc-character.is-moving .lpc-character-shadow {
    animation: none;
    transition: none;
  }
}

.mapa-direcional {
  position: absolute;
  z-index: 700;
  right: 14px;
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(3, 42px);
  grid-template-rows: repeat(3, 42px);
  gap: 3px;
  touch-action: none;
}

.mapa-direcao {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: #17151d;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  cursor: pointer;
}

.mapa-direcao svg {
  width: 19px;
  height: 19px;
}

.mapa-direcao:active,
.mapa-centro {
  background: #ff5100;
  color: #fff;
}

.mapa-cima { grid-column: 2; grid-row: 1; }
.mapa-esquerda { grid-column: 1; grid-row: 2; }
.mapa-centro { grid-column: 2; grid-row: 2; }
.mapa-direita { grid-column: 3; grid-row: 2; }
.mapa-baixo { grid-column: 2; grid-row: 3; }

.leaflet-popup-content strong {
  font-weight: 800;
}

.busca-tag-pill.ativa {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-mini:disabled {
  cursor: wait;
  opacity: .58;
}

.lojas-dica {
  text-align: center;
  color: var(--texto-terciario);
  font-size: 12.5px;
  max-width: 640px;
  margin: 0;
  padding: 16px 20px;
  line-height: 1.6;
}

@media (max-width: 760px) {
 html body:has(#lojas-page),
 body:has(#lojas-page) .page-wrap,
 body:has(#lojas-page) .page-wrap > main {
    max-width: 100%;
    overflow-x: hidden;
  }

 html body #lojas-page {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 112px 0 92px;
  }

 #lojas-page > header,
 #lojas-page > .lojas-controles,
 #lojas-page > .lojas-status {
    width: calc(100% - 24px);
    margin-inline: auto;
  }

 #lojas-page h1 {
    font-size: 27px;
    line-height: 1.08;
  }

 #lojasSugestoes {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 12px 8px;
    scrollbar-width: none;
  }

 #lojasSugestoes::-webkit-scrollbar {
    display: none;
  }

 .lojas-mapa-wrap {
    width: calc(100% - 24px);
    margin-inline: auto;
    border-radius: 16px;
  }

 .lojas-mapa {
    height: 380px;
  }

 .lojas-controles {
    grid-template-columns: 1fr;
    gap: 10px;
  }

 .lojas-search-acoes {
    display: grid;
    grid-template-columns: 1fr 1fr;
 }

 .lojas-search-acoes .btn-mini {
    width: 100%;
    padding-inline: 14px;
 }

 .mapa-direcional {
    right: 10px;
    bottom: 48px;
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(3, 40px);
  }

 .mapa-direcao {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 560px) {
 .lojas-search-acoes {
    grid-template-columns: 1fr;
  }
}

/* Sem animacoes nos botoes da pagina de lojas. */
button,
.btn-mini,
.btn-mini-secundario,
.busca-tag-pill {
  animation: none !important;
  transition: none !important;
}

button:hover,
button:active,
.btn-mini:hover,
.btn-mini:active,
.btn-mini-secundario:hover,
.busca-tag-pill:hover {
  transform: none !important;
}

/* Full-screen exploration map: tools float above the map instead of framing it. */
html:has(#lojas-page),
body:has(#lojas-page) { width: 100%; height: 100%; overflow: hidden; }
body:has(#lojas-page) .page-wrap,
body:has(#lojas-page) .page-wrap > main { height: 100%; padding: 0; }
body:has(#lojas-page) footer { display: none; }

body:has(#lojas-page) #lojas-page {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #e9e6e2;
}

body:has(#lojas-page) .lojas-mapa-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body:has(#lojas-page) .lojas-mapa-shell,
body:has(#lojas-page) .lojas-mapa { width: 100%; height: 100%; }

body:has(#lojas-page) #lojas-page > header,
body:has(#lojas-page) .lojas-controles,
body:has(#lojas-page) #lojasSugestoes,
body:has(#lojas-page) #lojasStatus { position: absolute; z-index: 800; }
body:has(#lojas-page) #lojas-page > header {
  top: 94px;
  left: clamp(18px, 4vw, 60px);
  max-width: 360px;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 10px;
  background: rgba(255,255,255,.93);
  box-shadow: 0 12px 30px rgba(25,23,31,.16);
}
body:has(#lojas-page) #lojas-page h1 { margin: 0 0 4px; color: #19171f; font-size: 24px; text-align: left; }
body:has(#lojas-page) .busca-sub { margin: 0; color: #66574f; font-size: 12px; line-height: 1.4; }
body:has(#lojas-page) .lojas-controles {
  top: 168px;
  left: clamp(18px, 4vw, 60px);
  display: grid;
  grid-template-columns: minmax(300px, 470px) auto;
  width: auto;
  margin: 0;
}
body:has(#lojas-page) .lojas-search { height: 48px; border-color: rgba(255,255,255,.9); border-radius: 8px; box-shadow: 0 10px 24px rgba(25,23,31,.14); }
body:has(#lojas-page) .lojas-search-acoes { gap: 8px; }
body:has(#lojas-page) .btn-mini { min-height: 48px; padding-inline: 16px; border-radius: 7px; box-shadow: 0 10px 24px rgba(25,23,31,.12); }
body:has(#lojas-page) #lojasSugestoes {
  top: 228px;
  left: clamp(18px, 4vw, 60px);
  justify-content: flex-start;
  width: min(700px, calc(100% - 36px));
  padding: 0;
}
body:has(#lojas-page) #lojasSugestoes .busca-tag-pill { min-height: 32px; border-color: rgba(255,255,255,.9); background: rgba(255,255,255,.93); box-shadow: 0 8px 18px rgba(25,23,31,.1); }
body:has(#lojas-page) #lojasStatus {
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  min-height: 0;
  margin: 0;
  padding: 12px 15px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 26px rgba(25,23,31,.15);
  color: #4f433c;
  text-align: left;
}
body:has(#lojas-page) .lojas-dica { display: none; }
body:has(#lojas-page) .pokemon-indicador { top: auto; right: 20px; bottom: 78px; left: auto; transform: none; }
body:has(#lojas-page) .mapa-direcional { right: 20px; bottom: 142px; }
body:has(#lojas-page) .leaflet-top { top: 12px; }
body:has(#lojas-page) .leaflet-left { left: 12px; }

.mapa-joystick { display: none; }

@media (max-width: 760px) {
  body:has(#lojas-page) #lojas-page > header { top: 16px; left: 14px; max-width: calc(100% - 28px); padding: 10px 13px; }
  body:has(#lojas-page) #lojas-page h1 { font-size: 18px; }
  body:has(#lojas-page) .busca-sub { display: none; }
  body:has(#lojas-page) .lojas-controles { top: 66px; right: 14px; left: 14px; display: flex; width: auto; }
  body:has(#lojas-page) .lojas-search { flex: 1; min-width: 0; height: 46px; padding-inline: 13px; }
  body:has(#lojas-page) .lojas-search-acoes { display: flex; flex: 0 0 auto; }
  body:has(#lojas-page) .lojas-search-acoes .btn-mini { width: 46px; min-width: 46px; min-height: 46px; padding: 0; }
  body:has(#lojas-page) .lojas-search-acoes .btn-mini span { display: none; }
  body:has(#lojas-page) #lojasSugestoes { top: 122px; width: auto; max-width: none; right: 14px; left: 14px; flex-wrap: nowrap; overflow-x: auto; padding: 0 0 4px; }
  body:has(#lojas-page) #lojasSugestoes .busca-tag-pill { min-height: 30px; padding-inline: 12px; font-size: 10px; }
  body:has(#lojas-page) .leaflet-top { top: 168px; }
  body:has(#lojas-page) .leaflet-left { left: 12px; }
  body:has(#lojas-page) .pokemon-indicador { top: 168px; right: 12px; bottom: auto; min-height: 31px; padding-inline: 10px; font-size: 10px; }
  body:has(#lojas-page) .mapa-direcional { display: none; }
  body:has(#lojas-page) #lojasStatus { right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); left: 132px; max-width: none; padding: 10px 12px; font-size: 11px; }

  .mapa-joystick {
    position: absolute;
    z-index: 800;
    bottom: calc(86px + env(safe-area-inset-bottom));
    left: 16px;
    display: grid;
    width: 98px;
    height: 98px;
    place-items: center;
    touch-action: none;
    user-select: none;
  }
  .mapa-joystick-base { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.84); border-radius: 50%; background: rgba(25,23,31,.28); box-shadow: 0 10px 22px rgba(0,0,0,.2); backdrop-filter: blur(4px); }
  .mapa-joystick-knob { position: relative; width: 43px; height: 43px; border: 2px solid rgba(255,255,255,.92); border-radius: 50%; background: rgba(255,81,0,.92); box-shadow: 0 5px 12px rgba(0,0,0,.26); transition: transform 70ms linear; }
  .mapa-joystick.is-active .mapa-joystick-base { background: rgba(25,23,31,.42); }
}

@media (min-width: 761px) {
  body:has(#lojas-page) #lojas-page > header {
    top: 112px;
    left: clamp(26px, 3vw, 56px);
  }
  body:has(#lojas-page) .lojas-controles {
    top: 112px;
    left: 50%;
    grid-template-columns: minmax(330px, 470px) auto;
    transform: translateX(-50%);
  }
  body:has(#lojas-page) #lojasSugestoes {
    top: 174px;
    left: 50%;
    justify-content: center;
    transform: translateX(-50%);
  }
  body:has(#lojas-page) .pokemon-indicador {
    top: 112px;
    right: 28px;
    bottom: auto;
  }
  body:has(#lojas-page) #lojasStatus {
    right: auto;
    bottom: 28px;
    left: 28px;
  }
  body:has(#lojas-page) .mapa-direcional {
    right: 28px;
    bottom: 28px;
  }
  body:has(#lojas-page) .leaflet-top { top: 262px; }
}
