.rooms {
  scroll-margin-top: calc(var(--header) + 12px);
  padding: 20px 0 72px;
  background: var(--white);
}

.rooms-head {
  max-width: 46rem;
  margin-bottom: 22px;
}

.rooms h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.plant-hint {
  display: none;
  margin: 12px 0 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.plant-scroll {
  overflow-x: auto;
  width: min(100%, 980px);
  margin-inline: auto;
  border-radius: 18px;
  background: #f4f6f8;
}

.plant {
  position: relative;
  min-width: 720px;
}

.plant img,
.plant-map {
  width: 100%;
  height: auto;
}

.plant-map {
  position: absolute;
  inset: 0;
  height: 100%;
}

.plant-room rect,
.plant-room polygon {
  fill: transparent;
  stroke: rgba(160, 125, 63, 0.55);
  stroke-width: 2;
  cursor: pointer;
}

.plant-room:hover rect,
.plant-room:hover polygon,
.plant-room:focus-visible rect,
.plant-room:focus-visible polygon {
  fill: rgba(160, 125, 63, 0.34);
  stroke: var(--gold);
  stroke-width: 3;
}

.plant-room.is-selected rect,
.plant-room.is-selected polygon {
  fill: rgba(160, 125, 63, 0.48);
  stroke: var(--gold-hover);
  stroke-width: 3;
}

.plant-room.is-off {
  pointer-events: none;
}

.plant-room.is-off rect,
.plant-room.is-off polygon {
  fill: rgba(168, 176, 186, 0.62);
  stroke: transparent;
  cursor: default;
}

.plant-room-status {
  fill: #3e4650;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.plant-room:focus {
  outline: none;
}

.room-pick {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px 28px;
  margin-top: 16px;
  padding: 18px 22px;
  background: var(--card);
  border-radius: 18px;
  scroll-margin-top: calc(var(--header) + 12px);
}

.room-pick-copy {
  min-width: 220px;
}

.room-pick-status {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room-pick h3 {
  margin: 6px 0 2px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.room-pick-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.room-pick .btn {
  justify-self: end;
}

.room-pick .btn[hidden],
.room-midias[hidden],
.room-midias-vazio[hidden] {
  display: none;
}

.room-midias {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.room-midias-titulo {
  margin: 4px 0 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room-midias-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.room-midias-grade:empty {
  display: none;
}

.room-midia-item {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #ece7df;
  aspect-ratio: 4 / 3;
}

.room-midia-item button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.room-midia-item img,
.room-midia-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.room-midia-video {
  background: #1c1c1c;
}

.room-midia-video video {
  object-fit: contain;
}

.room-midias-vazio {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
}

.room-foto {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: #161616;
}

.room-foto::backdrop {
  background: rgba(28, 28, 28, 0.62);
}

.room-foto img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  margin: 0 auto;
  object-fit: contain;
}

.room-foto-fechar {
  margin: 0 0 8px auto;
  display: block;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.room-foto-fechar:focus-visible,
.room-midia-item button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .plant-hint {
    display: block;
  }

  .plant-scroll {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    width: calc(100% + (var(--pad) * 2));
    height: min(58vh, 480px);
    max-width: none;
    margin-inline: calc(var(--pad) * -1);
    border-radius: 0;
    touch-action: pan-y;
  }

  .plant {
    min-width: 0;
  }

  .room-pick {
    grid-template-columns: 1fr;
  }

  .room-pick .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .rooms {
    padding-bottom: 48px;
  }
}
