/* ═══════════════════════════════════════════════
   Tessaro Geo Stores — v2.0
   Layout em fluxo normal (sticky), sem sobreposição
   ═══════════════════════════════════════════════ */

:root {
  --tgs-bg:     #16b525;
  --tgs-color:  #ffffff;
  --tgs-radius: 0px;
  --tgs-fs:     13px;
}

/* ── Barra principal ── */
#tgs-bar-root {
  width: 100%;
  /* sticky: fica presa ao topo enquanto o usuário rola, mas NÃO sobrepõe — empurra o conteúdo */
}

.tgs-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--tgs-bg);
  color: var(--tgs-color);
  font-size: var(--tgs-fs);
  line-height: 1.4;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  /* animação de entrada */
  animation: tgs-slide-in .35s ease both;
}

@keyframes tgs-slide-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ── Layout interno ── */
.tgs-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 9px 48px 9px 16px; /* espaço à direita para o botão fechar */
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* ── Ícone de localização ── */
.tgs-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: .85;
}

/* ── Texto/conteúdo da barra ── */
.tgs-content {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  min-width: 0;
}

.tgs-label {
  opacity: .88;
  white-space: nowrap;
}

.tgs-name {
  font-weight: 700;
  white-space: nowrap;
}

.tgs-sep {
  opacity: .45;
}

.tgs-address {
  opacity: .88;
}

/* ── Pills de telefone ── */
.tgs-pill {
  display: inline-flex;
  align-items: center;
}

.tgs-pill a {
  color: var(--tgs-color);
  text-decoration: none;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  transition: background .15s;
  white-space: nowrap;
}

.tgs-pill a:hover,
.tgs-pill a:focus {
  background: rgba(255, 255, 255, .3);
  outline: none;
}

/* ── Select customizado ── */
.tgs-select {
  height: 28px;
  padding: 0 28px 0 10px;
  border: 1.5px solid rgba(255, 255, 255, .4);
  border-radius: 6px;
  background-color: transparent;
  color: var(--tgs-color);
  font-size: 12px;
  cursor: pointer;
  /* seta customizada */
  appearance: none;
  background-image:
    linear-gradient(45deg,  transparent 50%, var(--tgs-color) 50%),
    linear-gradient(135deg, var(--tgs-color) 50%, transparent 50%);
  background-position:
    calc(100% - 12px) 50%,
    calc(100% - 7px)  50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color .15s;
}

.tgs-select:focus {
  outline: 2px solid rgba(255, 255, 255, .6);
  outline-offset: 2px;
  border-color: rgba(255, 255, 255, .7);
}

.tgs-select option {
  background: #1a1a1a;
  color: #fff;
}

/* ── Botão fechar ── */
.tgs-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: background .15s;
  flex-shrink: 0;
}

.tgs-close:hover { background: rgba(0, 0, 0, .38); }
.tgs-close:focus { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }

/* ── Botão CTA (pedir GPS) ── */
.tgs-cta-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  background: var(--tgs-bg);
  color: var(--tgs-color);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .22);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: tgs-cta-in .4s .6s ease both;
}

@keyframes tgs-cta-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0);    }
}

.tgs-cta-btn:hover { filter: brightness(1.08); }
.tgs-cta-btn:focus { outline: 2px solid rgba(255,255,255,.6); outline-offset: 3px; }

/* ── Estado: carregando ── */
.tgs-loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tgs-spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes tgs-spin {
  to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════
   MOBILE (≤ 640px)
   ════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .tgs-inner {
    padding: 8px 44px 8px 12px;
    gap: .5rem;
    flex-direction: row;
    align-items: flex-start;
  }

  .tgs-icon { margin-top: 2px; }

  .tgs-content {
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    min-width: 0;
  }

  .tgs-label { font-size: .8em; opacity: .8; }

  .tgs-name  { white-space: normal; word-break: break-word; }

  .tgs-sep   { display: none; }

  .tgs-address {
    font-size: .8em;
    opacity: .82;
    word-break: break-word;
  }

  .tgs-pill a {
    font-size: .85em;
    padding: 3px 10px;
  }

  .tgs-select {
    height: 32px;
    font-size: 13px;
    width: 100%;
    max-width: 260px;
  }

  .tgs-close {
    top: 10px;
    transform: none;
  }

  /* CTA: ocupa toda a largura disponível no mobile */
  .tgs-cta-btn {
    width: calc(100% - 32px);
    justify-content: center;
    font-size: 15px;
    padding: 13px 20px;
  }
}

/* ════════════════════════════════════════════════
   ACESSIBILIDADE: reduzir movimento
   ════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .tgs-bar,
  .tgs-cta-btn { animation: none; }
  .tgs-loading { animation-duration: 1.5s; }
}
