/* Seletor de cidade de listagem no header (dropdown desktop + menu mobile) */

.location-select {
  position: relative;
  cursor: pointer;
}

.location-select::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 0.5rem solid transparent;
  border-right: 0.5rem solid transparent;
  border-top: 0.6rem solid #ea3636;
  margin-left: 0.8rem;
  transition: transform 0.2s ease;
}

.location-select:hover::after {
  transform: rotate(180deg);
}

/* Painel compacto: estreito, alinhado à direita do gatilho, lista vertical
   com rolagem interna (antes: 72rem de largura em colunas). */
.location-dropdown {
  display: none;
  position: absolute;
  /* Colado no gatilho: qualquer vão faria o :hover se perder no trajeto
     e fechar o painel antes de o mouse alcançar os itens. */
  top: 100%;
  right: -1rem;
  z-index: 9998;
  width: 28rem;
  padding: 1rem;
  background-color: #14191d;
  border: 1px solid #303838;
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 1.6rem 3.6rem rgba(0, 0, 0, 0.45);
  cursor: default;
}

.location-select:hover .location-dropdown,
.location-select:focus-within .location-dropdown {
  display: block;
}

.location-select:focus-visible {
  outline: 2px solid #ea3636;
  outline-offset: 4px;
  border-radius: 0.6rem;
}

.location-dropdown-title {
  padding: 0.4rem 1rem 0.8rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.location-filter {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid #303838;
  border-radius: 0.8rem;
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  font-family: inherit;
  font-size: 1.3rem;
  color: #fff;
}

.location-filter::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.location-filter:focus {
  border-color: #ea3636;
}

.location-list {
  max-height: min(42rem, 70vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 0.4rem;
  padding-top: 0.6rem;
  border-top: 1px solid #303838;
}

.location-dropdown ul {
  list-style: none;
}

/* Cada linha: texto à esquerda, sigla ou ✓ à direita */
.location-dropdown .location-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  font-size: 1.35rem;
  line-height: 1.3;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.location-dropdown .location-option span,
.location-dropdown .location-option small {
  color: inherit;
}

.location-dropdown .location-option:hover,
.location-dropdown .location-option:focus-visible {
  outline: 0;
  background-color: rgba(255, 255, 255, 0.07);
}

.location-dropdown .location-all small {
  font-size: 1.2rem;
  opacity: 0.6;
}

.location-dropdown .location-state-name {
  margin-top: 0.4rem;
  font-weight: 700;
}

.location-dropdown .location-state-name small {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.5;
}

.location-dropdown .location-city {
  padding-left: 2.2rem;
  color: rgba(255, 255, 255, 0.82);
}

.location-dropdown .location-option.is-active {
  color: #ea3636;
  font-weight: 700;
}

.location-dropdown .location-option.is-active::after {
  content: "✓";
  color: #ea3636;
  font-weight: 700;
}

/* com o ✓, a sigla do estado ativo dá lugar à marca */
.location-dropdown .location-state-name.is-active small {
  display: none;
}

.location-empty {
  padding: 1.2rem 1rem;
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.6);
}

.location-empty[hidden] {
  display: none;
}

/* O "*" do main.min.css pintaria o <small> de "Brasil (Todas as cidades)"
   com o cinza escuro padrão; inherit devolve a cor do link (e segue o hover) */
.location-bar-options a small {
  color: inherit;
}

/* Faixa do celular (abaixo) reaproveita esta classe */
.location-state-name {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
}

/* --- Mobile: faixa de localização sempre visível sob a barra da logo ---
   O seletor do desktop some ≤991px; sem esta faixa, trocar de cidade
   exigia abrir o menu e rolar até o fim. */
.location-bar-mobile {
  display: none;
}

@media (max-width: 991px) {
  .location-bar-mobile {
    display: block;
    position: relative;
    background-color: #14191d;
    border-top: 1px solid #303838;
  }

  .location-bar-mobile summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 2rem;
    cursor: pointer;
    list-style: none;
  }

  .location-bar-mobile summary::-webkit-details-marker {
    display: none;
  }

  .location-bar-mobile summary img {
    width: 1.6rem;
    flex-shrink: 0;
  }

  .location-bar-mobile summary span {
    flex: 1;
    min-width: 0;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .location-bar-mobile summary strong {
    color: #fff;
    font-size: 1.4rem;
  }

  .location-bar-mobile summary::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 0.5rem solid transparent;
    border-right: 0.5rem solid transparent;
    border-top: 0.6rem solid #ea3636;
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }

  .location-bar-mobile[open] summary::after {
    transform: rotate(180deg);
  }

  .location-bar-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9998;
    max-height: 60vh;
    overflow-y: auto;
    flex-direction: column;
    gap: 1.1rem;
    background-color: #14191d;
    border: 1px solid #303838;
    box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.45);
    padding: 1.4rem 2rem;
  }

  .location-bar-mobile[open] .location-bar-options {
    display: flex;
  }

  .location-bar-options a {
    color: #fff;
    font-size: 1.5rem;
    text-decoration: none;
    line-height: 1.4;
  }

  .location-bar-options a:hover,
  .location-bar-options a.is-active {
    color: #ea3636;
    font-family: "Inter", sans-serif;
  font-weight: 700;
  }

  .location-bar-options .location-state-name {
    margin-top: 0.8rem;
    font-family: "Inter", sans-serif;
  font-weight: 700;
    color: #ea3636;
  }

  .location-bar-options .location-city {
    padding-left: 1.6rem;
  }
}

/* Texto só para leitores de tela (ex.: "Localização:" antes da região) */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
