/* ===== SECTION: ENCONTRAR LOJA ===== */

.section-lojas {
  padding: 100px 0;
  position: relative;
}

.lojas-container {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.lojas-header {
  text-align: center;
  margin-bottom: 48px;
}

/* ===== BUSCA ===== */

.lojas-busca {
  max-width: 640px;
  margin: 0 auto 48px;
}

.lojas-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  gap: 10px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lojas-input-wrapper:focus-within {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), 0 8px 32px rgba(109, 40, 217, 0.12);
}

.lojas-input-icon {
  flex-shrink: 0;
}

.lojas-input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  padding: 10px 0;
  min-width: 0;
}

.lojas-input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

/* PlaceAutocompleteElement (novo widget Google) */
.lojas-input-wrapper gmp-place-autocomplete {
  flex: 1;
  min-width: 0;
  --gmpx-color-surface: transparent;
  --gmpx-color-on-surface: #fff;
  --gmpx-color-on-surface-variant: rgba(255, 255, 255, 0.35);
  --gmpx-color-primary: var(--accent-bright);
  --gmpx-font-family-base: 'DM Sans', sans-serif;
  --gmpx-font-size-base: 0.95rem;
}

.lojas-input-wrapper gmp-place-autocomplete::part(input) {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  padding: 10px 0;
}

.lojas-input-wrapper gmp-place-autocomplete::part(predictions-list) {
  background: #1a0e33;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.lojas-input-wrapper gmp-place-autocomplete::part(prediction-item) {
  color: rgba(255, 255, 255, 0.7);
  font-family: 'DM Sans', sans-serif;
}

.lojas-input-wrapper gmp-place-autocomplete::part(prediction-item):hover,
.lojas-input-wrapper gmp-place-autocomplete::part(prediction-item-selected) {
  background: rgba(124, 58, 237, 0.15);
}

.lojas-input-wrapper button {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--roxo-400), var(--roxo-500));
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lojas-input-wrapper button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.lojas-input-wrapper button:active {
  transform: translateY(0);
}

.lojas-busca-hint {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 12px;
  min-height: 1.4em;
}

.lojas-busca-hint.error {
  color: #f87171;
}

/* ===== AUTOCOMPLETE DROPDOWN (fallback legacy) ===== */

.pac-container {
  background: #1a0e33 !important;
  border: 1px solid rgba(167, 139, 250, 0.25) !important;
  border-radius: 12px !important;
  margin-top: 8px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5) !important;
  font-family: 'DM Sans', sans-serif !important;
  overflow: hidden;
}

.pac-item {
  padding: 10px 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
}

.pac-item:first-child { border-top: none !important; }
.pac-item:hover, .pac-item-selected { background: rgba(124, 58, 237, 0.15) !important; }
.pac-item-query { color: #fff !important; font-weight: 500 !important; }
.pac-icon { filter: brightness(0) invert(1) !important; opacity: 0.4 !important; }
.pac-logo::after { display: none !important; }

/* ===== RESULTADO: LAYOUT ===== */

.lojas-resultado[hidden] {
  display: none !important;
}

.lojas-resultado {
  width: 100%;
}

/* Cards + mapa alinhados pelo topo (sem sticky que “descia” o mapa) */
.lojas-resultado-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  gap: 24px;
  align-items: start;
  width: 100%;
}

/* ===== CARDS ===== */

.lojas-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 8px;
  align-self: start;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.3) transparent;
}

.lojas-cards::-webkit-scrollbar {
  width: 5px;
}

.lojas-cards::-webkit-scrollbar-track {
  background: transparent;
}

.lojas-cards::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.3);
  border-radius: 10px;
}

.loja-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.loja-card:hover,
.loja-card.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(167, 139, 250, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(109, 40, 217, 0.15);
}

.loja-card.active {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.2), 0 12px 40px rgba(109, 40, 217, 0.2);
}

.loja-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.loja-card-nome {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.loja-card-distancia {
  flex-shrink: 0;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-bright);
  white-space: nowrap;
}

.loja-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.loja-card-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.loja-card-info-row svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.loja-card-actions {
  display: flex;
  gap: 10px;
}

.loja-btn-direcoes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--roxo-400), var(--roxo-500));
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.loja-btn-direcoes:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

.loja-btn-ligar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.loja-btn-ligar:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(167, 139, 250, 0.3);
  color: #fff;
}

/* ===== MAPA ===== */

.lojas-mapa {
  height: 520px;
  min-height: 520px;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
  align-self: start;
  line-height: 0;
}

.lojas-mapa > * {
  line-height: normal;
}

/* ===== ESTADOS: LOADING ===== */

.lojas-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.lojas-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(167, 139, 250, 0.15);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  animation: lojas-spin 0.8s linear infinite;
}

@keyframes lojas-spin {
  to { transform: rotate(360deg); }
}

.lojas-loading-text {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* ===== ESTADOS: VAZIO ===== */

.lojas-vazio {
  text-align: center;
  padding: 60px 20px;
  width: 100%;
}

.lojas-vazio-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lojas-vazio-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.lojas-vazio-desc {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== SKELETON CARDS ===== */

.loja-card-skeleton {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  animation: lojas-pulse 1.5s ease-in-out infinite;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}

.skeleton-line--title {
  width: 60%;
  height: 16px;
  margin-bottom: 14px;
}

.skeleton-line--short {
  width: 40%;
}

.skeleton-line--medium {
  width: 75%;
}

@keyframes lojas-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== MAPA: ESTILOS GOOGLE MAPS ===== */

.gm-style .gm-style-iw-c {
  background: #1a0e33 !important;
  border: 1px solid rgba(167, 139, 250, 0.2) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
}

.gm-style .gm-style-iw-d {
  overflow: auto !important;
  padding: 16px !important;
}

.gm-style .gm-style-iw-tc::after {
  background: #1a0e33 !important;
}

.gm-style .gm-ui-hover-effect {
  filter: invert(1) !important;
}

.iw-loja-nome {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.iw-loja-endereco {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.iw-loja-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-bright);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.iw-loja-link:hover {
  text-decoration: underline;
}

/* ===== RESPONSIVO ===== */

@media (max-width: 900px) {
  .lojas-resultado-inner {
    grid-template-columns: 1fr;
  }

  .lojas-mapa {
    height: 340px;
    min-height: 340px;
    order: -1;
  }

  .lojas-cards {
    max-height: none;
    padding-right: 0;
  }
}

@media (max-width: 768px) {
  .section-lojas {
    padding: 72px 0;
  }

  .lojas-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .lojas-mapa {
    height: 300px;
    min-height: 300px;
  }

  .loja-card-top {
    flex-direction: column;
    gap: 8px;
  }

  .loja-card-distancia {
    align-self: flex-start;
  }

  .loja-card-actions {
    flex-direction: column;
  }

  .loja-btn-direcoes,
  .loja-btn-ligar {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .lojas-input-wrapper {
    flex-direction: column;
    padding: 12px;
    gap: 10px;
  }

  .lojas-input-icon {
    display: none;
  }

  .lojas-input-wrapper input,
  .lojas-input-wrapper gmp-place-autocomplete {
    width: 100%;
    text-align: center;
  }

  .lojas-input-wrapper button {
    width: 100%;
    text-align: center;
  }
}
