.floor-map-page {
  width: min(100%, 960px);
  margin-inline: auto;
  padding-bottom: 1.5rem;
}

.floor-map-grid {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.floor-map-section {
  min-width: 0;
}

.floor-map-section__title {
  display: block;
  width: fit-content;
  margin: 0 auto 0.65rem;
}

.floor-map-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
  overflow: hidden;
}

.floor-map-card__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  position: relative;
}

.floor-map-card__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
}

.floor-map-card__hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* Floor-map modal — contained within #appCapsule (same pattern as dancer gallery) */
.floor-map-modal-shell {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1050;
  pointer-events: none;
}

.floor-map-modal-shell.is-open {
  display: block;
  pointer-events: auto;
}

.floor-map-modal-shell .floor-map-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* Hidden by default — never block page scroll or capture pointer events */
.floor-map-modal {
  display: none;
  position: absolute !important;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  visibility: hidden;
  width: auto;
  height: auto;
}

.floor-map-modal.show {
  display: block;
  pointer-events: auto;
  visibility: visible;
}

.floor-map-modal .modal-dialog {
  margin: 0;
  max-width: 100%;
  width: 100%;
  height: 100%;
}

.floor-map-modal .modal-content {
  background: #101010;
  color: #ffffff;
  height: 100%;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.floor-map-modal .modal-header {
  background: #101010;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.floor-map-modal .modal-title {
  color: #ffffff;
  font-weight: 700;
  text-shadow: none;
}

.floor-map-modal .modal-header .modal-header-close {
  filter: invert(1);
  opacity: 0.9;
}

.floor-map-modal__body {
  padding: 0;
  overflow: hidden;
  background: #000000;
  flex: 1 1 auto;
  min-height: 0;
}

.floor-map-viewport {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.floor-map-viewport.is-dragging {
  cursor: grabbing;
}

.floor-map-viewport__image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.floor-map-modal__footer {
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  background: #101010;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  padding: 0.65rem 0.75rem 0.75rem;
}

.floor-map-modal__footer > * {
  margin-right: 0;
  margin-left: 0;
}

.floor-map-modal__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
}

.floor-map-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.floor-map-zoom-controls .floor-map-zoom-btn {
  margin-right: 0;
}

.floor-map-zoom-btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.floor-map-modal .btn i.fa-solid,
.floor-map-modal .btn i.fa-regular {
  margin-right: 0 !important;
}

.floor-map-close-btn {
  min-height: 2.5rem;
  padding-inline: 1rem;
  border-radius: 999px;
  font-weight: 700;
  margin-right: 0;
}

.floor-map-close-btn--full {
  width: 100%;
  max-width: 320px;
}

.floor-map-modal__hint {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  text-align: center;
}

/* Desktop + mobile: modal shell anchors to #appCapsule content area */
#appCapsule:has(.floor-map-page) {
  position: relative;
}

#appCapsule.floor-map-modal-open {
  overflow: hidden !important;
}

#appCapsule .floor-map-modal-shell {
  position: absolute;
  inset: 0;
  z-index: 1050;
}

@media (max-width: 991.98px) {
  #appCapsule .floor-map-modal-shell {
    position: fixed;
    z-index: 1055;
  }
}

@media (min-width: 992px) {
  body.dwc-sidebar-desktop #appCapsule:has(.floor-map-page) {
    position: fixed;
  }
}

@media (min-width: 768px) {
  .floor-map-page {
    width: min(100%, 1100px);
    padding-inline: 1.25rem;
  }

  .floor-map-grid {
    gap: 1.75rem;
  }

  .floor-map-section__title {
    font-size: 0.82rem;
    margin-bottom: 0.8rem;
  }

  .floor-map-card__hint {
    font-size: 0.8rem;
  }

  .floor-map-viewport { min-height: 280px; }
}

@media (min-width: 992px) {
  .floor-map-page {
    width: min(100%, 1320px);
    padding-inline: 1.5rem;
  }

  .floor-map-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1200px) {
  .floor-map-page {
    width: min(100%, 1240px);
  }

  .floor-map-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floor-map-viewport__image {
    will-change: auto;
  }
}
