/* =============================================================
   PremieRpet Store Locator — store-locator.css  v2.0
   Layout: busca → lista de lojas → mapa (vertical, mobile-first)
   ============================================================= */

/* ── WRAPPER PRINCIPAL ──────────────────────────────────────── */
.gw-store-locator {
  width: 100%;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
}

/* ── SEÇÃO DE BUSCA ─────────────────────────────────────────── */
.gw-sl-search-section {
  padding: 0 0 20px;
}

.gw-sl-search-section h2 {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: #111;
  line-height: 1.25;
}

.gw-sl-search-section p {
  font-size: 1rem;
  color: #555;
  margin: 0 0 18px;
  line-height: 1.55;
}

/* Input de endereço */
.gw-sl-address-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1.5px solid #d0d5dd;
  border-radius: 999px;
  background: #fff;
  transition: border-color 0.2s;
  overflow: hidden;
  min-height: 52px;
}

.gw-sl-address-wrap:focus-within {
  border-color: #3d6b4f;
  box-shadow: 0 0 0 3px rgba(61, 107, 79, 0.12);
}

.gw-sl-address-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  /* Padding simétrico vertical + altura mínima garantem centralização */
  padding: 0 16px 0 20px !important;
  margin: 0 !important;
  height: 50px !important;
  line-height: 50px !important;
  font-size: 0.95rem !important;
  color: #111 !important;
  min-width: 0;
  border-radius: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  vertical-align: middle !important;
  display: block !important;
  box-sizing: border-box !important;
}

.gw-sl-address-input::placeholder {
  color: #aaa;
}

.gw-sl-search-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  margin: auto 4px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.gw-sl-search-btn:hover {
  background: #f0f0f0;
  color: #3d6b4f;
}

.gw-sl-search-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Tag do endereço ativo (abaixo do input) */
.gw-sl-active-address {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 14px;
  background: #f4f9f6;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #3d6b4f;
  font-weight: 500;
}

.gw-sl-active-address.is-visible {
  display: flex;
}

.gw-sl-active-address button {
  border: none;
  background: none;
  cursor: pointer;
  color: #888;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
  margin-left: auto;
  transition: color 0.15s;
}

.gw-sl-active-address button:hover {
  color: #e53e3e;
}

/* Autocomplete dropdown */
.pac-container {
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
  margin-top: 8px !important;
  font-family: inherit !important;
  /* Remove a borda cinza padrão injetada pelo Google Maps */
  border-top: 1px solid #e2e8f0 !important;
}

/* Quando o autocomplete está aberto, remove borda inferior do wrapper */
.pac-container + * .gw-sl-address-wrap,
.gw-sl-address-wrap.pac-target-input-focused {
  border-bottom-color: transparent;
}

.pac-item {
  padding: 10px 16px !important;
  font-size: 0.9rem !important;
  cursor: pointer !important;
  border-top: 1px solid #f1f5f9 !important;
}

.pac-item:first-child {
  border-top: none !important;
}

.pac-item:hover {
  background: #f4f9f6 !important;
}

.pac-item-query {
  font-size: 0.9rem !important;
  color: #111 !important;
}

/* ── CONTAGEM DE RESULTADOS ─────────────────────────────────── */
.gw-sl-results-header {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.gw-sl-results-header strong {
  color: #111;
}

/* ── CONTAINER LISTA + MAPA (mobile: empilhado) ──────────────── */
.gw-sl-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── LISTA DE LOJAS (scroll horizontal em mobile) ────────────── */
.gw-sl-cards-wrap {
  position: relative;
}

/* Setas de navegação */
.gw-sl-nav-btn {
  display: none; /* só aparece quando JS detecta overflow */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid #e8edf0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
  padding: 0;
  line-height: 1;
}

.gw-sl-nav-btn:hover {
  border-color: #3d6b4f;
  color: #3d6b4f;
  box-shadow: 0 4px 14px rgba(61,107,79,0.15);
}

.gw-sl-nav-btn.is-visible {
  display: flex;
}

.gw-sl-nav-btn--prev {
  left: -14px;
}

.gw-sl-nav-btn--next {
  right: -14px;
}

.gw-sl-nav-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

/* Scroll horizontal dos cards */
.gw-sl-cards {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.gw-sl-cards::-webkit-scrollbar {
  display: none;
}

/* ── CARD DE LOJA ────────────────────────────────────────────── */
.gw-sl-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: #fff;
  border: 1.5px solid #e8edf0;
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.gw-sl-card:hover {
  border-color: #3d6b4f;
  box-shadow: 0 4px 16px rgba(61,107,79,0.1);
}

.gw-sl-card.is-active {
  border-color: #e8956d;
  box-shadow: 0 4px 20px rgba(232,149,109,0.18);
  background: #fff5ef;
}

/* Linha topo: nome + distância */
.gw-sl-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.gw-sl-card__name {
  font-weight: 700;
  font-size: 1rem;
  color: #111;
  line-height: 1.3;
  flex: 1;
}

.gw-sl-card__distance {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8rem;
  color: #555;
  font-weight: 500;
  white-space: nowrap;
}

.gw-sl-card__distance svg {
  width: 12px;
  height: 12px;
  color: #3d6b4f;
}

/* Endereço */
.gw-sl-card__address {
  font-size: 0.88rem;
  color: #666;
  line-height: 1.45;
  margin-bottom: 10px;
}

/* Horário */
.gw-sl-card__hours {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 12px;
}

.gw-sl-card__hours-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.gw-sl-card__hours-dot.closed {
  background: #ef4444;
}

/* Botões de ação */
.gw-sl-card__actions {
  display: flex;
  gap: 8px;
}

.gw-sl-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid #d0d5dd;
  background: #fff;
  color: #333;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  line-height: 1;
  box-sizing: border-box;
  white-space: nowrap;
}

.gw-sl-btn:hover {
  border-color: #3d6b4f;
  color: #3d6b4f;
  background: #f4f9f6;
}

.gw-sl-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.gw-sl-btn--active {
  background: #e8956d;
  border-color: #e8956d;
  color: #fff;
}

.gw-sl-btn--active:hover {
  background: #d4814e;
  color: #fff;
  border-color: #d4814e;
}

/* ── MAPA ────────────────────────────────────────────────────── */
.gw-sl-map-wrap {
  position: relative;
  margin-top: 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e8edf0;
}

.gw-sl-map {
  width: 100%;
  height: 360px;
  background: #f0f4f0;
  display: block;
}

/* Loading overlay */
.gw-sl-map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.85);
  color: #3d6b4f;
  font-size: 0.9rem;
  font-weight: 500;
  gap: 10px;
  z-index: 5;
  border-radius: 16px;
}

.gw-sl-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(61,107,79,0.2);
  border-top-color: #3d6b4f;
  border-radius: 50%;
  animation: gwSpin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes gwSpin { to { transform: rotate(360deg); } }

/* ── ESTADO VAZIO / INICIAL ─────────────────────────────────── */
.gw-sl-empty {
  padding: 32px 16px;
  text-align: center;
  color: #888;
  font-size: 0.9rem;
}

.gw-sl-empty svg {
  width: 40px;
  height: 40px;
  color: #ccc;
  display: block;
  margin: 0 auto 12px;
}

/* Geolocalização pendente */
.gw-sl-geo-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  text-align: center;
  gap: 8px;
  color: #555;
  font-size: 0.9rem;
}

.gw-sl-geo-prompt svg {
  color: #3d6b4f;
  width: 36px;
  height: 36px;
  margin-bottom: 4px;
}

/* Info window do mapa */
.gw-sl-infowin {
  font-family: inherit;
  color: #111;
  min-width: 180px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.gw-sl-infowin strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 3px;
  color: #111;
}

.gw-sl-infowin span {
  color: #555;
}

/* ── FILTRO DE CATEGORIA ────────────────────────────────────── */
.gw-sl-group-filter {
  display: none !important; /* Filtro de categoria: uso interno apenas */
}

/* ── RESPONSIVO TABLET ──────────────────────────────────────── */
@media (min-width: 768px) {
  .gw-sl-map {
    height: 420px;
  }
}

/* ── RESPONSIVO DESKTOP ─────────────────────────────────────── */
@media (min-width: 1024px) {
  .gw-sl-map {
    height: 480px;
  }
}

/* ── ELEMENTOR EDITOR ───────────────────────────────────────── */
.elementor-editor-active .gw-sl-map-loading {
  display: none;
}

/* ── CORREÇÃO: borda cinza do Google Places Autocomplete ──────── */
.pac-container {
  border-top: none !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important;
}

.pac-logo {
  display: none !important;
}

/* ── MODAL DE ESCOLHA DE ROTA ───────────────────────────────── */
.gw-sl-route-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 0;
}

.gw-sl-route-modal-overlay.is-open {
  opacity: 1;
}

.gw-sl-route-modal {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  transform: translateY(40px);
  transition: transform 0.25s ease;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.12);
}

.gw-sl-route-modal-overlay.is-open .gw-sl-route-modal {
  transform: translateY(0);
}

.gw-sl-route-modal__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 20px;
  text-align: center;
}

.gw-sl-route-modal__header span {
  font-size: 0.85rem;
  color: #888;
}

.gw-sl-route-modal__header strong {
  font-size: 1rem;
  color: #111;
  font-weight: 700;
}

.gw-sl-route-modal__btns {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.gw-sl-route-opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
  border: none;
}

.gw-sl-route-opt:hover {
  opacity: 0.85;
}

.gw-sl-route-opt svg {
  width: 28px;
  height: 28px;
}

.gw-sl-route-opt--gmaps {
  background: #e8f4fb;
  color: #1a73e8;
}

.gw-sl-route-opt--waze {
  background: #fef9e7;
  color: #33ccff;
  color: #05c8f0;
}

.gw-sl-route-modal__close {
  width: 100%;
  padding: 13px;
  border-radius: 999px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.gw-sl-route-modal__close:hover {
  background: #f5f5f5;
}

@media (min-width: 480px) {
  .gw-sl-route-modal {
    border-radius: 20px;
    margin-bottom: 24px;
    max-width: 380px;
  }

  .gw-sl-route-modal-overlay {
    align-items: center;
  }
}


/* ── AUTOCOMPLETE NOMINATIM ─────────────────────────────────── */
.gw-sl-ac-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 6px 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  display: none;
  position: relative;
  z-index: 1000;
}

.gw-sl-ac-item {
  padding: 10px 20px;
  font-size: 0.88rem;
  color: #333;
  cursor: pointer;
  border-top: 1px solid #f1f5f9;
  line-height: 1.4;
  transition: background 0.1s;
}

.gw-sl-ac-item:first-child { border-top: none; }

.gw-sl-ac-item:hover,
.gw-sl-ac-item.is-focused {
  background: #f4f9f6;
  color: #3d6b4f;
}
