* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100dvh;
  background: #000;
  color: #fff;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

#map-area {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #000;
  touch-action: none;
}

#map-viewport {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

#map-viewport img {
  display: block;
  width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

#map-viewport svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#floor-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 20;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.accessibility-banner {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 520px;
  padding: 12px;
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.95);
  color: #fef3c7;
  font-size: 13px;
  font-weight: 700;
}

.accessibility-banner[hidden] {
  display: none;
}

.accessibility-banner button {
  flex-shrink: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: #facc15;
  color: #111827;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.route-line {
  fill: none;
  stroke: #00aeef;
  stroke-width: 30;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 90 60;
  animation: dash 0.4s linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -84; }
}

#search-modal-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.search-modal-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.search-modal-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

#bottom-panel {
  width: min(90vw, 400px);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  border-radius: 16px;
  background: #1a1e2e;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.drawer-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#close-search-btn,
.info-header button {
  flex-shrink: 0;
  padding: 7px 16px;
  border: 0;
  border-radius: 20px;
  background: #2a3150;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.field-section {
  position: relative;
  margin-bottom: 14px;
}

.field-spaced {
  margin-bottom: 20px;
}

.field-section-label {
  margin-bottom: 7px;
  padding-left: 2px;
  color: #d1d5db;
  font-size: 14px;
  font-weight: 600;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  overflow: visible;
  border: 1px solid #333a55;
  border-radius: 12px;
  background: #252a3d;
}

.pin-icon {
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 800;
}

.origin-pin,
.destination-pin {
  position: relative;
}

.origin-pin::before,
.destination-pin::before {
  width: 12px;
  height: 12px;
  content: "";
  border-radius: 999px;
}

.origin-pin::before {
  background: #22c55e;
}

.destination-pin::before {
  background: #ef4444;
}

.select-wrapper select,
.select-wrapper input[type="text"] {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 14px 36px 14px 0;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
}

.select-wrapper select option {
  background: #252a3d;
  color: #fff;
}

.chevron {
  position: absolute;
  right: 14px;
  color: #94a3b8;
  pointer-events: none;
  font-size: 13px;
}

.custom-datalist {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 10000;
  display: none;
  flex-direction: column;
  width: 100%;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.custom-datalist.active {
  display: flex;
}

.custom-datalist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #334155;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
}

.custom-datalist-item:last-child {
  border-bottom: 0;
}

.custom-datalist-item:hover,
.custom-datalist-item:active {
  background: #2a3150;
}

.custom-datalist-item small {
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
}

.btn-row {
  display: flex;
  width: 100%;
  gap: 10px;
  margin-top: 15px;
}

.btn-row button,
#fixed-actions-bar button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 15px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-row button {
  flex: 1;
}

.btn-row button:active,
#fixed-actions-bar button:active {
  transform: scale(0.96);
}

#buscar-btn,
#main-buscar-btn {
  background: #ed1c24;
}

#main-limpar-btn {
  background: #2cbcb6;
}

#main-info-btn {
  background: #ffc232;
}

#phase-next-btn {
  flex: 1.6;
  background: #2563eb;
}

#phase-next-btn[hidden] {
  display: none;
}

#fixed-actions-bar {
  /* Aproxima o bloco da planta sem redimensionar o mapa ou cobrir a imagem. */
  transform: translateY(min(0px, max(calc((100vw * 10792 / 7543 - 100dvh + 100%) / 2), calc((100vw * 10792 / 7543 - 100dvh + 100%) / 3 - 10px))));
  z-index: 990;
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 10px;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid #1a1a1a;
  background: #000;
}

#fixed-actions-bar button {
  flex: 1;
}

.map-actions-title,
.map-actions-credit {
  flex: 0 0 100%;
  text-align: center;
  font-weight: 400;
}

.map-actions-title {
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
}

.map-actions-credit {
  color: #2786ef;
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
}

@keyframes pulse-effect {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.pulse-marker {
  transform-origin: center;
  animation: pulse-effect 1.8s ease-out infinite;
}

.store-label {
  fill: #fff;
  stroke: #0f172a;
  stroke-width: 3px;
  paint-order: stroke;
  pointer-events: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.info-dialog {
  width: min(90vw, 400px);
  height: min(80dvh, 600px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.info-dialog.chat-menu {
  height: auto;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
}

.chat-menu .chat-history {
  flex: 0 0 auto;
  overflow: visible;
}

.chat-menu .info-header,
.chat-menu .chat-options {
  flex-shrink: 0;
}

.info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid #334155;
  background: #1e293b;
}

.info-header h3 {
  font-size: 16px;
}

.chat-history {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 15px;
}

.chat-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #334155;
  background: #1e293b;
}

.chat-intro {
  width: 100%;
  padding: 14px 10px;
  border-top: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
  background: #161b26;
  color: #fff;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
}

.chat-msg {
  max-width: 85%;
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  animation: fadeIn 0.3s ease;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.bot-msg {
  align-self: flex-start;
  border: 1px solid #334155;
  border-bottom-left-radius: 2px;
  background: #1e293b;
  color: #f8fafc;
}

.user-msg {
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  background: #16a34a;
  color: #fff;
}

.chat-msg a {
  color: #67e8f9;
  font-weight: 700;
}

.chat-msg iframe {
  width: 100%;
  border-radius: 8px;
}

.chat-msg.chat-video-msg {
  width: 100%;
  max-width: 100%;
}

.chat-video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
}

.chat-btn-option {
  width: 100%;
  display: block;
  padding: 12px 15px;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.1s ease;
}

.chat-btn-option.chat-btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chat-btn-option:hover {
  background: #1d4ed8;
}

.chat-btn-option:active {
  transform: scale(0.98);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.commercial-page {
  min-height: 100dvh;
  height: auto;
  overflow: auto;
  background: #0f172a;
}

.commercial-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.commercial-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.commercial-header h1 {
  margin-bottom: 6px;
  font-size: 26px;
}

.commercial-header p {
  color: #cbd5e1;
  font-size: 14px;
}

.commercial-actions {
  display: flex;
  gap: 10px;
}

.commercial-actions a,
.commercial-actions button {
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.commercial-actions a {
  background: #334155;
}

.commercial-section {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111827;
}

.commercial-section h2 {
  margin-bottom: 14px;
  font-size: 17px;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-field span,
.store-luc {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.editor-field input,
.store-row input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  outline: 0;
  background: #0f172a;
  color: #fff;
  font: inherit;
  font-size: 14px;
}

.store-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-row {
  display: grid;
  grid-template-columns: 140px 1fr 220px;
  align-items: center;
  gap: 10px;
}

.commercial-status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: none;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.commercial-status.show {
  display: block;
}

@media (max-width: 720px) {
  .commercial-header,
  .commercial-actions {
    flex-direction: column;
  }

  .commercial-actions,
  .commercial-actions a,
  .commercial-actions button {
    width: 100%;
  }

  .store-row {
    grid-template-columns: 1fr;
  }
}

/* Setas direcionais da rota */
.route-direction-arrow {
  fill: #00aeef;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linejoin: round;
  pointer-events: none;
}
