.gio-fp {
  --gio-fp-accent: #111;
  display: grid;
  grid-template-columns: minmax(220px, 22%) minmax(0, 78%);
  width: 100%;
  min-width: 0;
  background: #fff;
  color: #505050;
  font-family: inherit;
}

.gio-fp *,
.gio-fp *::before,
.gio-fp *::after {
  box-sizing: border-box;
}

.gio-fp button {
  font: inherit;
}

.gio-fp__sidebar,
.gio-fp__content,
.gio-fp__group-panel,
.gio-fp__map-layout,
.gio-fp__details,
.gio-fp__details-head,
.gio-fp__details-stage,
.gio-fp__details-panel,
.gio-fp__main-images,
.gio-fp__main-image {
  min-width: 0;
}

.gio-fp__sidebar {
  padding: clamp(28px, 5vw, 76px) clamp(18px, 3vw, 42px);
}

.gio-fp__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.gio-fp__section-tab,
.gio-fp__group-tab,
.gio-fp__map-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: #c9c9c9;
  transition: color .2s ease, opacity .2s ease;
}

.gio-fp__section-tab:focus-visible,
.gio-fp__group-tab:focus-visible,
.gio-fp__map-tab:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.gio-fp__section-tab {
  margin: 0 0 12px;
  line-height: 1.35;
  text-transform: uppercase;
}

.gio-fp__section-tab.is-active,
.gio-fp__group-tab.is-active,
.gio-fp__map-tab.is-active {
  color: var(--gio-fp-accent);
}

.gio-fp__sidebar-rule {
  width: 100%;
  max-width: 170px;
  height: 1px;
  margin: 6px 0 15px;
  background: #949494;
}

.gio-fp__group-heading {
  margin: 0 0 14px;
  color: #555;
  font-weight: 600;
}

.gio-fp__group-tab {
  margin: 0 0 15px;
}

.gio-fp__content,
.gio-fp__group-panel,
.gio-fp__scroll-stack,
.gio-fp__scroll-item {
  width: 100%;
}

/*
 * Layout desktop stabile: colonna informazioni + immagine vera.
 * La planimetria non è mai usata come background e non riceve altezze forzate.
 */
.gio-fp__map-layout {
  display: grid;
  grid-template-columns: minmax(360px, 54%) minmax(0, 46%);
  align-items: stretch;
  width: 100%;
}

.gio-fp__details {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
  padding: 0 clamp(24px, 3.4vw, 64px);
}

/* FLOOR e legenda iniziano dalla stessa coordinata. */
.gio-fp__details-head,
.gio-fp__details-stage,
.gio-fp__details-panel,
.gio-fp__legend,
.gio-fp__note {
  width: 100%;
  max-width: none;
}

.gio-fp__details-head {
  flex: 0 0 auto;
}

.gio-fp__map-tabs {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0 0 24px;
  padding: 0;
}

.gio-fp__map-tab,
.gio-fp__map-label {
  display: block;
  min-height: 22px;
  padding: 0 0 4px;
  color: #777;
  line-height: 1.35;
  letter-spacing: .02em;
}

.gio-fp__map-tab span,
.gio-fp__map-label span {
  margin-left: 6px;
}

.gio-fp__map-tab.is-active {
  font-weight: 500;
}

.gio-fp__details-stage {
  display: block;
  margin: 0;
  padding: 0;
}

.gio-fp__map-title {
  margin: 0 0 24px;
  color: var(--gio-fp-accent);
  font-weight: 400;
}

/*
 * La tabella usa tutta la colonna disponibile.
 * Il valore in SQM mantiene una colonna stabile, mentre il titolo usa tutto il resto.
 */
.gio-fp__legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) minmax(110px, 32%);
  gap: 10px;
  align-items: start;
  width: 100%;
  margin: 0 0 9px;
  letter-spacing: .01em;
}

.gio-fp__legend-color {
  display: block;
  width: 12px;
  height: 12px;
  margin-top: .22em;
}

.gio-fp__legend-label {
  min-width: 0;
  text-transform: uppercase;
  overflow-wrap: normal;
  word-break: normal;
}

.gio-fp__legend-value {
  min-width: 0;
  text-align: right;
  white-space: nowrap;
}

.gio-fp__note {
  margin-top: 34px;
  color: #777;
}

.gio-fp__note > :first-child {
  margin-top: 0;
}

.gio-fp__note > :last-child {
  margin-bottom: 0;
}

/* L'indicatore rimane in basso, sulla stessa linea inferiore della planimetria. */
.gio-fp__indicator-stack {
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
}

.gio-fp__indicator {
  width: 100%;
  max-width: 260px;
  margin: 0;
}

.gio-fp__indicator:empty {
  display: none;
}

.gio-fp__indicator-image {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 190px;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: left bottom;
}

/* Immagine principale: elemento IMG naturale, mai background, mai stretch verticale. */
.gio-fp__main-images {
  align-self: start;
  width: 100%;
  background: transparent;
  overflow: visible;
}

.gio-fp__main-image {
  display: block;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

.gio-fp__plan-image {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: top left;
}

.gio-fp__scroll-item + .gio-fp__scroll-item {
  margin-top: clamp(54px, 8vw, 130px);
  padding-top: clamp(42px, 6vw, 96px);
  border-top: 1px solid #8d8d8d;
}

.gio-fp__map-layout--scroll .gio-fp__map-label {
  color: var(--gio-fp-accent);
  margin-bottom: 24px;
}

.gio-fp__image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 420px;
  padding: 30px;
  background: #f7f7f7;
  color: #999;
  text-align: center;
}

.gio-fp__empty,
.gio-fp-error {
  padding: 24px;
}

.gio-fp [hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .gio-fp {
    grid-template-columns: minmax(190px, 24%) minmax(0, 76%);
  }

  .gio-fp__map-layout {
    grid-template-columns: minmax(300px, 52%) minmax(0, 48%);
  }
}

@media (max-width: 980px) {
  .gio-fp {
    grid-template-columns: 1fr;
  }

  .gio-fp__sidebar {
    padding: 24px;
    border-bottom: 1px solid #e5e5e5;
  }

  .gio-fp__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 18px;
  }

  .gio-fp__section-tab,
  .gio-fp__group-tab {
    margin: 0;
  }

  .gio-fp__sidebar-rule {
    max-width: none;
  }

  .gio-fp__group-heading {
    width: 100%;
    margin: 6px 0 4px;
  }

  .gio-fp__map-layout {
    grid-template-columns: 1fr;
  }

  .gio-fp__main-images {
    grid-row: 1;
  }

  .gio-fp__details {
    grid-row: 2;
    padding: 24px;
  }

  .gio-fp__indicator-stack {
    margin-top: 30px;
  }

  .gio-fp__indicator {
    max-width: 210px;
  }
}

@media (max-width: 560px) {
  .gio-fp__sidebar,
  .gio-fp__details {
    padding: 20px;
  }

  .gio-fp__legend-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .gio-fp__legend-color {
    width: 10px;
    height: 10px;
  }
}

/* Lightbox planimetrie: una sola immagine, con zoom e trascinamento. */
.gio-fp__lightbox-trigger {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  cursor: zoom-in;
  line-height: 0;
  overflow: visible;
  text-align: inherit;
  transform: none !important;
}

.gio-fp__lightbox-trigger:focus-visible {
  outline: 2px solid var(--gio-fp-accent);
  outline-offset: -2px;
}

html.gio-fp-lightbox-open,
body.gio-fp-lightbox-open {
  overflow: hidden !important;
}

.gio-fp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 52px);
  background: rgba(0, 0, 0, .9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}

.gio-fp-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.gio-fp-lightbox[hidden] {
  display: none !important;
}

.gio-fp-lightbox__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(96vw, 1800px);
  height: min(94vh, 1200px);
  min-width: 0;
  min-height: 0;
  outline: 0;
}

.gio-fp-lightbox__media {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.gio-fp-lightbox__viewport {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.gio-fp-lightbox__viewport.is-zoomed {
  cursor: grab;
}

.gio-fp-lightbox__viewport.is-dragging {
  cursor: grabbing;
}

.gio-fp-lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center center;
  will-change: transform;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
  pointer-events: none;
}

.gio-fp-lightbox__caption {
  flex: 0 0 auto;
  width: 100%;
  max-width: 1100px;
  margin-top: 14px;
  color: #fff;
  line-height: 1.4;
  text-align: center;
}

.gio-fp-lightbox__toolbar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gio-fp-lightbox__close,
.gio-fp-lightbox__zoom,
.gio-fp-lightbox__zoom-level {
  appearance: none;
  min-width: 44px;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  transition: background-color .18s ease, opacity .18s ease;
}

.gio-fp-lightbox__zoom,
.gio-fp-lightbox__close {
  width: 44px;
  padding: 0;
}

.gio-fp-lightbox__zoom-level {
  min-width: 70px;
}

.gio-fp-lightbox__close:hover,
.gio-fp-lightbox__zoom:hover,
.gio-fp-lightbox__zoom-level:hover,
.gio-fp-lightbox__close:focus-visible,
.gio-fp-lightbox__zoom:focus-visible,
.gio-fp-lightbox__zoom-level:focus-visible {
  background: rgba(255, 255, 255, .24);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.gio-fp-lightbox__zoom:disabled {
  cursor: default;
  opacity: .38;
}

.gio-fp-lightbox__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
}

.gio-fp-lightbox__close::before,
.gio-fp-lightbox__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 1px;
  background: currentColor;
}

.gio-fp-lightbox__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.gio-fp-lightbox__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@media (max-width: 700px) {
  .gio-fp-lightbox {
    padding: 12px;
  }

  .gio-fp-lightbox__dialog {
    width: 100%;
    height: 100%;
  }

  .gio-fp-lightbox__close,
  .gio-fp-lightbox__zoom,
  .gio-fp-lightbox__zoom-level {
    min-width: 38px;
    height: 38px;
  }

  .gio-fp-lightbox__zoom,
  .gio-fp-lightbox__close {
    width: 38px;
  }

  .gio-fp-lightbox__zoom-level {
    min-width: 62px;
  }

  .gio-fp-lightbox__toolbar {
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gio-fp-lightbox,
  .gio-fp-lightbox__close,
  .gio-fp-lightbox__zoom,
  .gio-fp-lightbox__zoom-level {
    transition: none;
  }
}
