/* =====================================================
   enderecos.css — Página de Unidades / Mapa Interativo
   ===================================================== */

/* ---- Layout principal ---- */
.enderecos-section {
  background: var(--color-neutral-light);
}

/* Remove onda decorativa do page-header nesta página */
.page-header--flat {
  padding-bottom: 80px;
}
.page-header--flat::after {
  display: none;
}

.enderecos-intro {
  text-align: center;
  margin-bottom: 3.5rem;
}

.enderecos-intro h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--color-secondary);
  margin-bottom: 0.75rem;
}

.enderecos-intro p {
  max-width: 540px;
  margin: 0 auto;
  font-size: 1rem;
  color: var(--color-text-muted);
}

.enderecos-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 992px) {
  .enderecos-layout {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2.5rem;
    align-items: start;
  }
}

/* ---- Coluna do mapa ---- */
.enderecos-mapa-col {
  position: sticky;
  top: 100px;
}

@media (max-width: 991px) {
  .enderecos-mapa-col {
    position: static;
  }
}

.mapa-card {
  background: var(--color-white);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(31, 36, 48, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.mapa-card-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mapa-card-header-icon {
  width: 40px;
  height: 40px;
  background: rgba(139, 36, 88, 0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-secondary);
  flex-shrink: 0;
}

.mapa-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin: 0;
}

.mapa-card-header p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.3;
}

#mapa-container {
  width: 100%;
  position: relative;
}

#mapa-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Todos os estados: neutro */
#mapa-container svg path {
  fill: #dde4ec;
  stroke: #ffffff;
  stroke-width: 0.8px;
  transition: fill 0.25s ease;
  cursor: default;
  outline: none;
}

/* Estados com unidade: destaque sutil */
#mapa-container svg path.has-unit {
  fill: rgba(139, 36, 88, 0.20);
  cursor: pointer;
}

/* Hover em estado com unidade */
#mapa-container svg path.has-unit.is-hovered {
  fill: rgba(139, 36, 88, 0.48);
}

/* Estado ativo (selecionado) */
#mapa-container svg path.is-active {
  fill: var(--color-secondary);
}

.mapa-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.mapa-hint svg {
  opacity: 0.5;
}

.mapa-loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.mapa-error {
  text-align: center;
  padding: 3rem;
  color: var(--color-error);
  font-size: 0.9rem;
}

/* ---- Tooltip ---- */
.mapa-tooltip {
  position: fixed;
  background: var(--color-secondary);
  color: var(--color-white);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-heading);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 9000;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.mapa-tooltip::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 16px;
  width: 10px;
  height: 10px;
  background: var(--color-secondary);
  transform: rotate(45deg);
  border-radius: 2px;
}

.mapa-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Coluna de cards ---- */
.enderecos-cards-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---- Card individual ---- */
.unidade-card {
  background: var(--color-white);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 12px rgba(31, 36, 48, 0.05);
  border: 1.5px solid transparent;
  border-left: 4px solid var(--color-neutral-light);
  cursor: pointer;
  will-change: transform, box-shadow;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
  position: relative;
  overflow: hidden;
}

.unidade-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 36, 88, 0.03), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.unidade-card:hover {
  border-left-color: var(--color-primary);
  box-shadow: 0 6px 24px rgba(31, 36, 48, 0.09);
  transform: translateX(4px);
}

.unidade-card:hover::before {
  opacity: 1;
}

.unidade-card.is-hovered {
  border-left-color: var(--color-primary);
  box-shadow: 0 6px 24px rgba(31, 36, 48, 0.09);
}

.unidade-card.is-active {
  border-left-color: var(--color-secondary);
  border-color: rgba(139, 36, 88, 0.15);
  box-shadow: 0 8px 28px rgba(139, 36, 88, 0.12);
  transform: translateX(4px);
}

.unidade-card.is-active::before {
  opacity: 1;
}

.unidade-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.unidade-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(139, 36, 88, 0.08);
  color: var(--color-secondary);
}

.unidade-tag.tag-matriz {
  background: rgba(242, 138, 0, 0.1);
  color: var(--color-primary);
}

.unidade-uf-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--color-neutral-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--color-secondary);
  letter-spacing: 0.5px;
  transition: background 0.25s ease, color 0.25s ease;
  flex-shrink: 0;
}

.unidade-card.is-active .unidade-uf-badge {
  background: var(--color-secondary);
  color: var(--color-white);
}

.unidade-card-nome {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-neutral-dark);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.unidade-card-cidade {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.unidade-card-endereco {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.unidade-card-endereco svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-primary);
  opacity: 0.8;
}

.btn-como-chegar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid var(--color-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-como-chegar:hover {
  background: var(--color-secondary);
  color: var(--color-white);
}

.unidade-card.is-active .btn-como-chegar {
  background: var(--color-secondary);
  color: var(--color-white);
}

/* ---- Legenda ---- */
.mapa-legenda {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.legenda-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.legenda-cor {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.legenda-cor.neutro { background: #dde4ec; }
.legenda-cor.com-unidade { background: rgba(139, 36, 88, 0.35); }
.legenda-cor.ativo { background: var(--color-secondary); }

/* ---- Estilos que substituem inline styles ---- */

/* Page header: subtítulo */
.page-header-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* Mobile overlay: bloco CTA */
.mobile-nav-cta {
  margin-top: 2rem;
}

.mobile-nav-cta .btn {
  width: 100%;
  text-align: center;
}

/* Ícones do mapa-card-header */
.icon-map-header {
  width: 20px;
  height: 20px;
}

/* Ícone de loading */
.icon-loading {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Ícone da tag de tipo (star, etc) */
.icon-tag {
  width: 11px;
  height: 11px;
}

/* Ícone de cidade no card */
.icon-city {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Ícone de navegação no botão Como Chegar */
.icon-nav {
  width: 13px;
  height: 13px;
}

/* ---- Animação de entrada dos cards ---- */
@keyframes cardEntrada {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.unidade-card:nth-child(1) { animation: cardEntrada 0.4s 0.1s both ease; }
.unidade-card:nth-child(2) { animation: cardEntrada 0.4s 0.2s both ease; }
.unidade-card:nth-child(3) { animation: cardEntrada 0.4s 0.3s both ease; }
.unidade-card:nth-child(4) { animation: cardEntrada 0.4s 0.4s both ease; }

/* ---- Rede de distribuição nacional ---- */

/* Linhas curvas suaves entre unidades e capitais */
.network-line {
  stroke: rgba(110, 60, 180, 0.14);
  stroke-width: 0.3px;
  stroke-linecap: round;
  animation: networkGlow 4s ease-in-out infinite alternate;
}

@keyframes networkGlow {
  from { opacity: 0.30; }
  to   { opacity: 0.06; }
}

/* Ponto nas capitais (discreto) */
.capital-dot {
  fill: rgba(242, 138, 0, 0.55);
  pointer-events: none;
}

/* Ponto sólido em cada unidade */
.network-dot {
  fill: var(--color-secondary);
  opacity: 0.9;
  transition: fill 0.25s ease;
}

.network-dot.is-active {
  fill: var(--color-primary);
  opacity: 1;
}

/* Anel de pulso que expande e some */
.network-pulse {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.5px;
  opacity: 0;
  animation: networkPulse 2.6s ease-out infinite;
}

@keyframes networkPulse {
  0%   { r: 5;  opacity: 0.75; }
  100% { r: 26; opacity: 0;    }
}

/* Badge "Cobertura Nacional" */
.cobertura-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(135deg, rgba(139, 36, 88, 0.06), rgba(242, 138, 0, 0.06));
  border: 1px solid rgba(139, 36, 88, 0.15);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--color-secondary);
  letter-spacing: 0.3px;
}

.cobertura-badge svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ---- Mobile ---- */
@media (max-width: 991px) {
  .enderecos-mapa-col {
    order: 1;
  }
  .enderecos-cards-col {
    order: 2;
  }
  .mapa-card {
    padding: 1.25rem;
  }
  .unidade-card {
    padding: 0.875rem 1rem;
  }
}
