/**
 * Estilos para o mapa de regionais com balões posicionados
 */

/* Container principal do mapa - deve ser position relative */
.WrapperMap {
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* Solução para Elementor: faz o widget HTML cobrir toda a área */
.elementor-widget-html:has(.WrapBoxMap) {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 10 !important;
  pointer-events: none !important;
}

/* Garante que o container pai seja relativo quando contém ambos os widgets */
.elementor-element:has(.elementor-widget-image):has(.elementor-widget-html),
.e-con:has(.elementor-widget-image):has(.elementor-widget-html),
.elementor-container:has(.elementor-widget-image):has(.elementor-widget-html) {
  position: relative !important;
}

/* Fallback para navegadores que não suportam :has() - será aplicado via JavaScript */
.elementor-widget-html.elementor-map-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 10 !important;
  pointer-events: none !important;
}

.elementor-element.elementor-map-container,
.e-con.elementor-map-container,
.elementor-container.elementor-map-container {
  position: relative !important;
}

/* Container dos balões - position absolute para posicionar sobre o mapa */
.WrapBoxMap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none; /* Permite clicar através dos balões */
}

/* Estilos base para os balões */
.BoxMap {
  position: absolute;
  /* display: flex; */
  /* flex-direction: column; */
  /* align-items: center; */
  /* justify-content: center; */
  padding: 40px 0 0 40px;
  /* background-size: 100% 100%; */
  background-repeat: no-repeat;
  background-position: center;
  z-index: 10;
  /* font-family: "Roboto", sans-serif; */
  /* text-align: center; */
  pointer-events: auto;
}

/* Span interno: valor numérico (ex: 1200+) */
.BoxMap span {
  display: block;
  font-size: 24px;
  font-weight: 600;
  /* text-decoration: underline; */
  /* text-decoration-thickness: 2px; */
  /* line-height: 1.3; */
  /* color: inherit; */
  pointer-events: none;
  font-family: intalo, sans-serif;
}

/* Balões com popup são clicáveis */
/* TEMPORÁRIO: clique para modal desativado
.BoxMap[data-popup-id] {
  cursor: pointer;
}
*/

/* Mapeamento das imagens para cada BoxMap com dimensões reais e posições fixas em pixels */
/* Box01: Regional-Norte-e-Nordeste.png - 271x94 */
.BoxMap.Box01 {
  background-image: url('../images/Regional-Norte-e-Nordeste.png');
  top: 65px;
  left: 90px;
  color: #8061B0;
  text-decoration-color: #8061B0;
  width: 271px;
  height: 94px;
}

/* Box02: Regional-Centro-Oeste.png - 416x94 */
.BoxMap.Box02 {
  background-image: url('../images/Regional-Centro-Oeste.png');
  top: 295px;
  left: 110px;
  color: #50a66d;
  text-decoration-color: #50a66d;
  width: 416px;
  height: 94px;
}

/* Box03: Regional-Interior-de-SP.png - 361x94 */
.BoxMap.Box03 {
  background-image: url('../images/Regional-Interior-de-SP.png');
  bottom: 180px;
  left: 290px;
  color: #d03737;
  text-decoration-color: #d03737;
  width: 361px;
  height: 94px;
}

/* Box04: Regional-Minas-Gerais-e-Espirito-Santo.png - 320x367 */
.BoxMap.Box04 {
  background-image: url('../images/Regional-Minas-Gerais-e-Espirito-Santo.png');
  top: 15px;
  right: 70px;
  color: #2FD0BA;
  text-decoration-color: #2FD0BA;
  width: 320px;
  height: 367px;
  text-align: right;
  padding: 40px 85px 0 0;
}

/* Box05: Regional-Sul.png - 270x94 */
.BoxMap.Box05 {
  background-image: url('../images/Regional-Sul.png');
  bottom: 40px;
  left: 315px;
  color: #3f86d4;
  text-decoration-color: #3f86d4;
  width: 270px;
  height: 94px;
}

/* Box06: Regional-Sao-Paulo-e-Grande-Sao-Paulo.png - 253x106 */
.BoxMap.Box06 {
  background-image: url('../images/Regional-Sao-Paulo-e-Grande-Sao-Paulo.png');
  bottom: 70px;
  right: 65px;
  transform: translateX(-50%);
  color: #ce6c28;
  text-decoration-color: #ce6c28;
  width: 253px;
  height: 106px;
  text-align: right;
  padding: 50px 85px 0 0;
}

/* Box07: Seccional-Rio-de-Janeiro.png - 313x193 */
.BoxMap.Box07 {
  background-image: url('../images/Seccional-Rio-de-Janeiro.png');
  bottom: 200px;
  right: 60px;
  color: #4e63d7;
  text-decoration-color: #4e63d7;
  width: 313px;
  height: 193px;
  text-align: right;
  padding: 40px 85px 0 0;
}

/* Responsividade - MOBILE
   No mobile o mapa fica centralizado como imagem
   e os cards de informação das regionais aparecem
   empilhados abaixo do mapa, sem os balões sobrepostos. */
@media (max-width: 768px) {
  /* Libera o widget HTML para fluir normalmente */
  .elementor-widget-html:has(.WrapBoxMap),
  .elementor-widget-html.elementor-map-overlay {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    pointer-events: auto !important;
  }

  .WrapperMap {
    position: static;
    width: 100%;
    max-width: 100%;
  }

  /* Container dos cards das regionais */
  .WrapBoxMap {
    position: static;
    width: 100%;
    height: auto;
    padding: 24px 16px 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: auto;
  }

  /* Estilo base dos cards abaixo do mapa */
  .BoxMap {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px 20px;
    background-color: #ffffff;
    background-image: none;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    text-align: left;
  }

  /* Garante que cada box ignore width/height/posicionamento e imagens de fundo do desktop */
  .BoxMap.Box01,
  .BoxMap.Box02,
  .BoxMap.Box03,
  .BoxMap.Box04,
  .BoxMap.Box05,
  .BoxMap.Box06,
  .BoxMap.Box07 {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: auto;
    padding: 16px 20px;
    background-color: #ffffff;
    background-image: none;
    text-align: left;
  }

  /* Remove qualquer transformação aplicada no desktop */
  .BoxMap.Box06 {
    transform: none;
  }

  .BoxMap span {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
  }

  /* Usa as cores de cada regional na borda superior do card */
  .BoxMap.Box01 {
    border-top: 4px solid #8061B0;
    color: #8061B0;
  }

  .BoxMap.Box02 {
    border-top: 4px solid #50a66d;
    color: #50a66d;
  }

  .BoxMap.Box03 {
    border-top: 4px solid #d03737;
    color: #d03737;
  }

  .BoxMap.Box04 {
    border-top: 4px solid #2FD0BA;
    color: #2FD0BA;
  }

  .BoxMap.Box05 {
    border-top: 4px solid #3f86d4;
    color: #3f86d4;
  }

  .BoxMap.Box06 {
    border-top: 4px solid #ce6c28;
    color: #ce6c28;
  }

  .BoxMap.Box07 {
    border-top: 4px solid #4e63d7;
    color: #4e63d7;
  }
}
