/* ============================================================
   POP-UP DE MAPA estilo Booking.com — #qs-map
   Marcacao em parts/mapa.php
   Comportamento em assets/js/map-modal.js
   Carregado no header.php logo apos gallery-lightbox.css

   Layout do Booking: o mapa ocupa a tela inteira e o conteudo
   flutua por cima —  painel do hotel + atracoes na esquerda,
   botao "Fechar mapa" na direita.
   ============================================================ */

.qs-map {
  position: fixed; z-index: 10000; inset: 0;
  display: none;
  background: #e8e6e1;                 /* mesmo cinza do Google enquanto carrega */
  color: var(--black);
  font: normal 16px 'Montserrat', sans-serif;
}
.qs-map.is-open { display: block; }
body.qs-map-open { overflow: hidden; }
/* o widget de contato (WhatsApp) usa z-index 1000000 e ficaria por cima do
   mapa; some enquanto o pop-up estiver aberto — mesma regra do lightbox */
body.qs-map-open #arcontactus { display: none !important; }

/* ---------- o mapa ---------- */
.qs-map-canvas { position: absolute; inset: 0; }
.qs-map-canvas iframe { display: block; width: 100%; height: 100%; border: 0; }

/* aviso enquanto o iframe do Google nao pinta (ele so e requisitado na
   primeira abertura, entao a primeira vez sempre tem espera) */
.qs-map-loading {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--gray); font-size: 15px; font-weight: 600; pointer-events: none;
}
.qs-map-loading i { font-size: 20px; color: var(--blue); animation: qs-map-spin 1s linear infinite; }
.qs-map.is-loaded .qs-map-loading { display: none; }
@keyframes qs-map-spin { to { transform: rotate(360deg); } }

/* ---------- fechar ---------- */
.qs-map-close {
  position: absolute; z-index: 3; top: 16px; right: 16px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: 0; border-radius: 6px;
  background: #fff; color: var(--darkblue);
  font-weight: 700; font-size: 15px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  transition: background .2s ease, color .2s ease;
}
.qs-map-close:hover { background: #eef2f6; color: var(--blue); }
.qs-map-close i { font-size: 17px; }

/* ---------- painel flutuante ---------- */
.qs-map-panel {
  position: absolute; z-index: 2; top: 16px; left: 16px;
  width: 320px; max-height: calc(100% - 32px);
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; overscroll-behavior: contain;
}
.qs-map-card { padding: 16px; border-radius: 8px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.2); }

/* identificacao do hotel */
.qs-map-hotel-top { display: flex; align-items: flex-start; gap: 12px; }
.qs-map-hotel-top .qs-figimg {
  position: relative; flex: 0 0 72px; width: 72px; height: 56px;
  border-radius: 6px; background: #e7ecf1;
}
.qs-map-hotel-top .qs-figimg img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.qs-map-hotel-name { display: block; font-weight: 700; font-size: 16px; line-height: 1.25; color: var(--blue); }
.qs-map-stars { display: inline-block; margin-top: 5px; }
.qs-map-stars i { font-size: 11px; color: var(--yellow); }

/* nota geral, no formato do Booking (canto inferior esquerdo reto) */
.qs-map-score { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.qs-map-score b {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 38px; padding: 0 8px; border-radius: 6px 6px 6px 0;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 18px;
}
.qs-map-score strong { display: block; font-weight: 700; font-size: 15px; color: var(--darkblue); }
.qs-map-score small { display: block; margin-top: 2px; font-size: 12px; color: var(--gray); }

.qs-map-locscore { margin-top: 10px; font-size: 14px; color: var(--darkblue); }
.qs-map-locscore b { margin-right: 6px; font-weight: 700; font-size: 15px; color: var(--blue); }

/* selo "Cobrimos o menor preco" — botao: abre o painel da politica */
.qs-map-badge {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  margin-top: 14px; padding: 11px 12px;
  border: 1px solid #f0d9a8; border-radius: 6px; background: #fff8ea;
  font-family: inherit; text-align: left; cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.qs-map-badge:hover { background: #fdeecd; border-color: #e6c47a; }
.qs-map-badge i { margin-top: 2px; font-size: 15px; color: var(--yellow); }
.qs-map-badge strong { display: block; font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--darkblue); }
.qs-map-badge small { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--gray); }

.qs-map-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; padding: 13px 16px; border-radius: 6px;
  background: var(--blue); color: #fff;
  font-weight: 700; font-size: 15px; line-height: 1.2; text-align: center;
  transition: background .2s ease;
}
.qs-map-cta:hover { background: var(--darkblue); color: #fff; }

.qs-map-address {
  display: flex; gap: 8px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid #e4e8ec;
  font-style: normal; font-size: 13px; line-height: 1.5; color: var(--gray);
}
.qs-map-address i { margin-top: 2px; color: var(--blue); }

/* principais atracoes / aeroportos */
.qs-map-attr h3 { margin-bottom: 8px; font-weight: 700; font-size: 15px; color: var(--darkblue); }
.qs-map-attr ul + h3 { margin-top: 16px; padding-top: 14px; border-top: 1px solid #e4e8ec; }
.qs-map-attr li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 5px 0; list-style: none; font-size: 13.5px; line-height: 1.4; color: var(--black);
}
.qs-map-attr li em { flex: 0 0 auto; font-style: normal; color: var(--gray); white-space: nowrap; }

.qs-map-links { text-align: center; }
.qs-map-links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 15px; border-radius: 6px;
  background: #fff; color: var(--blue); font-weight: 600; font-size: 13.5px; line-height: 1;
  box-shadow: 0 2px 12px rgba(0,0,0,.2); transition: background .2s ease;
}
.qs-map-links a:hover { background: #eef2f6; }

/* ============================================================
   PINO + BOTAO "VER NO MAPA" sobre a imagem estatica do mapa
   (bloco #localizacao e mini-mapa da primeira dobra)
   ------------------------------------------------------------
   O <article> ja e position:relative e a <figure> dentro dele e
   absolute — basta o link cobrir a mesma area.

   Ate 28/07 a imagem do mapa trazia os dois hoteis desenhados,
   cada um com o nome ao lado, e o botao caia bem em cima do pino
   do hotel da pagina. Agora a imagem e so o mapa, gerada centrada
   nas coordenadas daquele hotel (ver a memoria do projeto sobre
   como as imagens sao geradas) — o pino e o botao sao desenhados
   aqui, como no Booking: pino com a ponta no centro exato (= o
   hotel) e o botao logo abaixo dele.
   ============================================================ */
.block-localizacao section article .qs-map-thumb {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.qs-map-thumb-bt {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 6px;
  background: #fff; color: var(--blue);
  font-weight: 700; font-size: 14px; line-height: 1; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  transition: background .2s ease, color .2s ease;
}
.qs-map-thumb:hover .qs-map-thumb-bt { background: var(--blue); color: #fff; }

/* o pino. SVG embutido em vez de icone de fonte: o Font Awesome do tema nao
   traz todos os glifos, e aqui a forma precisa ser sempre a mesma */
.qs-map-thumb::before,
.hero-minimap::before {
  content: "";
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 32px; height: 42px;
  transform: translate(-50%, -100%);   /* a ponta cai no centro da imagem */
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 .6C5.7.6.6 5.7.6 12c0 8.3 10.3 19.4 11.4 19.4S23.4 20.3 23.4 12C23.4 5.7 18.3.6 12 .6z' fill='%23ffffff'/%3E%3Cpath d='M12 2.4C6.7 2.4 2.4 6.7 2.4 12c0 6.8 8.5 16.8 9.6 18 1.1-1.2 9.6-11.2 9.6-18 0-5.3-4.3-9.6-9.6-9.6z' fill='%23005190'/%3E%3Ccircle cx='12' cy='12' r='3.6' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.3));
  pointer-events: none;
}

/* botao logo abaixo do pino */
.qs-map-thumb .qs-map-thumb-bt,
.hero-minimap .qs-map-thumb-bt {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  transform: translateX(-50%);
  margin-top: 10px;
}

/* credito obrigatorio da base de mapa. Fica aqui, e nao dentro da imagem:
   cada slot recorta a imagem de um jeito (object-fit:cover) e a faixa de
   baixo some no bloco #localizacao. */
.qs-map-thumb::after,
.hero-minimap::after {
  content: "© OpenStreetMap · © CARTO";
  position: absolute; right: 6px; bottom: 5px; z-index: 2;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(255,255,255,.72); color: #55606b;
  font-size: 9px; font-weight: 400; line-height: 1.4; white-space: nowrap;
  pointer-events: none;
}

/* ============================================================
   RESPONSIVO — breakpoints alinhados aos do tema (1220 / 970 / 680)
   ============================================================ */
@media (max-width: 970px) {
  .qs-map-panel { width: 290px; top: 12px; left: 12px; max-height: calc(100% - 24px); }
  .qs-map-close { top: 12px; right: 12px; }
}

@media (max-width: 680px) {
  /* o painel deixa de flutuar: mapa em cima, ficha embaixo */
  .qs-map.is-open { display: flex; flex-direction: column; }
  .qs-map-canvas { position: relative; inset: auto; flex: 1 1 auto; min-height: 0; }
  .qs-map-panel {
    position: relative; inset: auto; z-index: 2;
    flex: 0 0 auto; width: 100%; max-height: 52vh;
    gap: 0; padding: 0 12px 12px;
    background: #fff; box-shadow: 0 -2px 14px rgba(0,0,0,.2);
  }
  .qs-map-card { padding: 14px 0; border-radius: 0; border-bottom: 1px solid #eef1f4; box-shadow: none; }
  .qs-map-links { padding-top: 12px; }
  .qs-map-links a { box-shadow: none; border: 1px solid #d4dbe2; }

  .qs-map-close { top: 10px; right: 10px; padding: 10px 12px; gap: 0; }
  .qs-map-close span { display: none; }

  .qs-map-thumb-bt { padding: 10px 14px; font-size: 13px; }
}
