/* ===== Footer – escopo seguro (.fr-footer) ===== */
.fr-footer { 
  /* Fundo uniforme definido pelo design (#1A211B) */
  background: #1A211B;
  position: relative;
  isolation: isolate; /* evita interferência de mix-blend externos */
}

/* Força também o overlay interno do Astra (que recebe background via Dynamic CSS do Customizer) */
.fr-footer .footer-adv-overlay { 
  background: #1A211B; /* override do cinza padrão (#3a3a3a) */
}

/* Grid principal: 4 colunas desktop, stack no mobile */
.fr-footer .footer-adv .ast-row {
  display: grid;
  /* Ajuste conforme novo prompt: garantir 4 colunas alinhadas e baseline consistente */
  grid-template-columns: minmax(240px,1.1fr) minmax(220px,1fr) minmax(220px,1fr) auto;
  gap: 24px;
  align-items: start;
  width: 100%;
}

/* Colocação explícita das colunas para impedir criação de "célula fantasma" que empurra a 4ª para linha 2 */
.fr-footer .footer-adv .ast-row > .footer-adv-widget-1 { grid-column: 1; }
.fr-footer .footer-adv .ast-row > .footer-adv-widget-2 { grid-column: 2; }
.fr-footer .footer-adv .ast-row > .footer-adv-widget-3 { grid-column: 3; }
.fr-footer .footer-adv .ast-row > .footer-adv-widget-4 { grid-column: 4; }

/* Esconder possíveis elementos de limpeza herdados (clear div, br, hr) que causam slot extra no grid */
.fr-footer .footer-adv .ast-row > .clear,
.fr-footer .footer-adv .ast-row > br,
.fr-footer .footer-adv .ast-row > hr { display:none !important; }

/* Zerar qualquer margin-top residual em widgets (defensivo) */
.fr-footer .footer-adv .ast-row > .footer-adv-widget { margin-top:0 !important; }

/* Garantir que a 4ª coluna não quebre para baixo */
.fr-footer .footer-adv-widget-4 { align-self: start; }

/* Padding geral do bloco principal */
/* Novo respiro segundo prompt */
.fr-footer .footer-adv-overlay { padding: 36px 0 24px; }
@media (max-width: 1200px){ .fr-footer .footer-adv-overlay { padding: 34px 0 24px; } }
@media (max-width: 921px){ .fr-footer .footer-adv-overlay { padding: 28px 0 24px; } }

@media (max-width: 921px) {
  /* Mobile: coluna única, ordem definida, sem overflow lateral */
  .fr-footer .footer-adv .ast-row { display:flex; flex-direction:column; gap:20px; }
  .fr-footer .footer-adv .ast-row > .footer-adv-widget { grid-column:auto; width:100%; padding:0 14px; box-sizing:border-box; }
  /* Ordem solicitada */
  .fr-footer .footer-adv .ast-row > .footer-adv-widget-1 { order:1; }
  .fr-footer .footer-adv .ast-row > .footer-adv-widget-2 { order:2; }
  .fr-footer .footer-adv .ast-row > .footer-adv-widget-3 { order:3; }
  .fr-footer .footer-adv .ast-row > .footer-adv-widget-4 { order:4; }
  /* Wrapper do CTA inserido via JS ganha order 5 */
  .fr-footer .fr-footer-cta-mobile { order:5; width:100%; }
  .fr-footer #block-9.widget_text p.has-text-align-center { text-align:left; }
  /* CTA full-width e touch target ampliado */
  .fr-footer .fr-footer-cta-mobile a[href*="mapa"],
  .fr-footer #block-9.widget_text a[href*="mapa"] { width:90%; max-width:480px; display:flex; padding:14px 20px; font-size:14px; margin:4px auto 0; justify-content:center; box-sizing:border-box; }
  /* Quebra segura de e-mails e strings longas */
  .fr-footer .footer-adv .footer-adv-widget a { overflow-wrap:anywhere; word-break:break-word; }
  /* Evitar que listas / ícones causem scroll horizontal */
  .fr-footer .astra-widget-social-profiles-inner ul { flex-wrap:nowrap; overflow-x:auto; padding-bottom:2px; }
  .fr-footer .astra-widget-social-profiles-inner a { min-height:44px; }

  /* Micro-ajuste: centralizar visualmente conteúdo sem centralizar texto */
  .fr-footer .astra-widget-social-profiles-inner ul { padding-left:2px; padding-right:2px; }
  .fr-footer .widget-address .widget-address-field { padding-right:4px; }
}

/* Títulos */
.fr-footer .widget-title {
  color: #fff;
  font-weight: 600;
  letter-spacing: .01em;
  margin: 0 0 8px;
  text-transform: none;
  line-height: 1.25;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}
.fr-footer .footer-adv .footer-adv-widget { align-self:start; }
.fr-footer .footer-adv-widget-4 .widget-title { /* reforça consistência sem quebrar */
  margin-bottom:8px;
  white-space:normal;
  hyphens:none;
}

/* Impedir títulos quebrando letra a letra (caso plugins injetem spans) */
.fr-footer .widget-title * { white-space: inherit !important; display: inline; }

/* Texto e links base */
.fr-footer,
.fr-footer .widget,
.fr-footer .widget a,
.fr-footer .widget .address-meta,
.fr-footer .widget p,
.fr-footer .widget li { color: #E5E5E5; }

.fr-footer .widget a {
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.fr-footer .widget a:hover,
.fr-footer .widget a:focus {
  color: #D9A441;
}

/* Ícones sociais inline */
.fr-footer .astra-widget-social-profiles-inner ul {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: 8px 0 4px;
  padding: 0;
  list-style: none;
}
.fr-footer .astra-widget-social-profiles-inner li { list-style: none; margin: 0; padding:0; }
.fr-footer .astra-widget-social-profiles-inner a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #E5E5E5;
  font-size: 14px;
  line-height: 1.3;
}
.fr-footer .astra-widget-social-profiles-inner .ast-widget-icon { display: inline-flex; width:32px; height:32px; border-radius:50%; background:#3a2a29; align-items:center; justify-content:center; }
.fr-footer .astra-widget-social-profiles-inner .ast-widget-icon svg { width:18px; height:18px; display:block; }
.fr-footer .astra-widget-social-profiles-inner .ast-widget-icon svg path { fill: currentColor; }
.fr-footer .astra-widget-social-profiles-inner a:hover .ast-widget-icon { background:#4b3634; }

/* Endereços */
.fr-footer .widget-address .widget-address-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 8px;
}
.fr-footer .widget-address .address-icons { opacity: .85; }

/* Normalizar blocos de endereço / telefone para não quebrar cada palavra em linha */
.fr-footer .widget-address .address-meta,
.fr-footer .widget-address a { white-space: normal; word-break: normal; }

/* Evita <br> quebrando itens em colunas estreitas – substitui por espaço se houver excesso */
.fr-footer .widget-address .address-meta br { content: ""; }

/* CTA do mapa (não mover de coluna; estilizar no widget_text original) */
.fr-footer #block-9.widget_text p.has-text-align-center { text-align:left; margin-top:8px; }
.fr-footer #block-9.widget_text a[href*="mapa"] {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 16px;
  border:1px solid #D9A441;
  border-radius:999px;
  color:#D9A441;
  text-decoration:none;
  font-weight:500;
  line-height:1;
  letter-spacing:.02em;
  transition:background-color .2s ease, color .2s ease, border-color .2s ease;
  background:transparent;
  white-space:nowrap;
}
.fr-footer #block-9.widget_text a[href*="mapa"]:hover,
.fr-footer #block-9.widget_text a[href*="mapa"]:focus { background:rgba(217,164,65,.08); }

/* Copyright bloco menor */
.fr-footer .ast-small-footer { background: #161c17; }
.fr-footer .ast-small-footer .ast-footer-overlay { border-top: 1px solid rgba(255,255,255,.12); padding: 14px 20px 18px; background:#1A211B; }
.fr-footer .ast-small-footer-wrap { justify-content: center; text-align: center; }
.fr-footer .ast-small-footer, .fr-footer .ast-small-footer a { color: #BDBDBD; font-size: 12px; line-height: 1.6; }
.fr-footer .ast-small-footer a:hover { color: #D9A441; }

/* Espaçamento entre bloco principal e barra inferior sem buraco */
.fr-footer .footer-adv { margin: 0; }
.fr-footer .footer-adv-overlay { margin:0; }

/* Limpeza: evitar quebra de linha desnecessária no texto do ícone social */
.fr-footer .footer-adv .astra-widget-social-profiles.stack .link { white-space: nowrap; }

/* Forçar que widgets não colapsem sua largura removendo floats ou flex herdado */
.fr-footer .footer-adv .footer-adv-widget { width:auto; min-width:0; }

/* Remover bullets e espaçamentos residuais */
.fr-footer .footer-adv ul { list-style:none; margin:0; padding:0; }

/* Normalizar strong e b */
.fr-footer strong, .fr-footer b { font-weight:600; }

/* Garantir que o 4º widget não desça para a linha de baixo em desktop grande */
@media (min-width: 922px){
  .fr-footer .footer-adv .footer-adv-widget { margin:0; }
}

/* Coluna 4 (Contato Administração) - layout vertical enxuto do único item de contato */
.fr-footer .footer-adv-widget-4 .astra-widget-social-profiles-inner ul { display:flex; flex-direction:column; gap:10px; margin:8px 0 0; padding:0; }
.fr-footer .footer-adv-widget-4 .astra-widget-social-profiles-inner li { list-style:none; }
.fr-footer .footer-adv-widget-4 .astra-widget-social-profiles-inner a { display:inline-flex; align-items:center; gap:10px; }
.fr-footer .footer-adv-widget-4 li:empty { display:none; }
.fr-footer .footer-adv-widget-4 li a:empty { display:none; }
/* Fallback: se houver .link vazio, esconder o li (uso de :has com @supports) */
@supports(selector(:has(*))){
  .fr-footer .footer-adv-widget-4 li:has(.link:empty){ display:none; }
}

/* Ajustes de acessibilidade visual para foco */
.fr-footer a:focus-visible { outline:2px solid color-mix(in srgb,#D9A441 50%,transparent); outline-offset:2px; border-radius:6px; }

/* Reduzir quebra forçada em âncoras com telefones / endereços (se vierem com spans) */
.fr-footer a span { white-space:inherit; }

/* Evitar que labels do mapa quebrem verticalmente em colunas estreitas */
.fr-footer .fr-footer-cta a { white-space:nowrap; }

/* Micro-fix: evitar colapso se algum plugin injeta display:block no link do social label */
.fr-footer .astra-widget-social-profiles-inner .link { display:inline; }
