/* Shared availability board (public site + admin) */

.apts-board {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.35rem 0 0.25rem;
}

.apts-board[hidden] {
  display: none !important;
}

/* Westland / projects without sky backdrop */
.apts-board--no-sky .apts-board-sky {
  display: none !important;
}

.apts-board--no-sky .apts-board-stage {
  background: #f3f5f7;
}

.apts-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem 1.35rem;
  margin: 0 0 1rem;
}

.apts-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Outfit", "Noto Sans Armenian", "Noto Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: #3a3a3a;
  cursor: pointer;
  user-select: none;
}

html[lang="hy"] .apts-legend-item,
html[data-locale="hy"] .apts-legend-item {
  font-family: "Noto Sans Armenian", "Outfit", "Noto Sans", sans-serif;
}

.apts-legend-check {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #2d0913;
  cursor: pointer;
}

.apts-swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 0.2rem;
  display: inline-block;
  flex: 0 0 auto;
}

.apts-swatch.is-available {
  background: #7cb342;
}
.apts-swatch.is-reserved {
  background: #f0c040;
}
.apts-swatch.is-sold {
  background: #e8919c;
}

.apts-panel {
  background: #fff;
  border: 1px solid rgba(27, 35, 48, 0.1);
  border-radius: 0.85rem;
  padding: 1rem 0 1.15rem;
  box-shadow: 0 8px 28px rgba(27, 35, 48, 0.06);
  min-height: 320px;
}

.apts-panel-title {
  margin: 0 0 0.9rem;
  padding: 0 1.1rem;
  text-align: center;
  font-family: "Noto Sans Armenian", "Outfit", "Noto Sans", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1b1b1b;
}

.apts-board-stage {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  aspect-ratio: 1728 / 1296;
  background:
    radial-gradient(ellipse 55% 38% at 18% 28%, rgba(255, 255, 255, 0.95) 0%, transparent 70%),
    radial-gradient(ellipse 48% 32% at 72% 22%, rgba(255, 255, 255, 0.88) 0%, transparent 68%),
    radial-gradient(ellipse 42% 28% at 48% 42%, rgba(255, 255, 255, 0.55) 0%, transparent 72%),
    linear-gradient(180deg, #9ec8ef 0%, #c9e2f8 28%, #eaf4fc 62%, #f7fbff 100%);
  border-radius: 0.35rem;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
}

/* Keep interactive map/blueprint surfaces fluid */
.apts-board-stage svg,
.building-levels-engine svg,
#building-levels svg,
#admin-building-levels svg {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

.apts-board-sky {
  position: absolute;
  inset: -4% -6%;
  width: 112%;
  height: 108%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  animation: apts-sky-drift 48s ease-in-out infinite alternate;
}

@keyframes apts-sky-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1.02);
  }
  to {
    transform: translate3d(-2.5%, 1%, 0) scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .apts-board-sky {
    animation: none;
  }
}

.apts-board-cover-picture {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.apts-board-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0.92;
  pointer-events: none;
  user-select: none;
}

.apts-levels {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.apts-level-row {
  position: absolute;
  left: 5%;
  right: 5%;
  display: flex;
  align-items: center;
  gap: 0;
  transform: translateY(-50%);
  transition: opacity 0.28s ease, visibility 0.28s ease;
  max-height: none;
  height: auto;
  opacity: 1;
  z-index: 1;
}

.apts-level-row.is-filtered-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.apts-level-row:has(.apts-tile:is(:hover, :focus-visible)) {
  z-index: 8;
}

.apts-level-label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2.55rem;
  width: 2.55rem;
  min-height: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(27, 35, 48, 0.16);
  border-radius: 0.45rem;
  background: #fff;
  color: #2d2d2d;
  font-family: "Outfit", "Noto Sans Armenian", "Noto Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 1;
  z-index: 2;
}

.apts-level-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  min-height: 2.35rem;
  flex: 1 1 auto;
  margin-left: clamp(2.5rem, 14%, 7.5rem);
  padding-left: 0.35rem;
}

.apts-level-empty {
  font-size: 0.75rem;
  color: #8a857c;
  padding: 0.2rem;
}

.apts-tile {
  position: relative;
  appearance: none;
  border: 1.5px solid transparent;
  border-radius: 0.45rem;
  min-height: 2.35rem;
  height: 2.35rem;
  min-width: 3.35rem;
  flex: 0 0 auto;
  padding: 0.2rem 0.45rem 0.2rem 0.35rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  max-width: 5.5rem;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    max-width 0.32s ease,
    min-width 0.32s ease,
    padding 0.28s ease,
    margin 0.28s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.apts-tile.is-filtered-out {
  opacity: 0;
  transform: scale(0.86);
  max-width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  margin: 0;
  border-width: 0;
  pointer-events: none;
}

.apts-tile.is-add {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px dashed rgba(45, 9, 19, 0.35);
  align-items: center;
  justify-content: center;
  color: #2d0913;
}

.apts-tile.is-add .apts-tile-top {
  font-size: 1.15rem;
  line-height: 1;
  color: #2d0913;
}

.apts-tile.is-add .apts-tile-bottom {
  color: #5c3a42;
  font-size: 0.55rem;
}

.apts-tile.is-add:is(:hover, :focus-visible) {
  background: #fff;
  border-color: #2d0913;
  box-shadow: 0 0 0 2px rgba(45, 9, 19, 0.12);
}

.apts-tile.is-selected,
.apts-tile:focus-visible {
  border-color: #2d0913;
  box-shadow: 0 0 0 2px rgba(45, 9, 19, 0.12);
  outline: none;
  z-index: 1;
}

.apts-levels:has(.apts-tile:is(:hover, :focus-visible))
  .apts-tile:not(:is(:hover, :focus-visible)):not(.is-filtered-out) {
  opacity: 0.8;
}

.apts-tile:is(:hover, :focus-visible) {
  opacity: 1;
  z-index: 6;
}

.apts-tile-top {
  font-family: "Outfit", "Noto Sans Armenian", "Noto Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #222;
  line-height: 1.05;
}

.apts-tile-bottom {
  font-family: "Noto Sans Armenian", "Outfit", "Noto Sans", sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  color: #444;
  line-height: 1.1;
}

.apts-tile-mark {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0.7rem 0.7rem 0;
}

.apts-tile.is-available .apts-tile-mark {
  border-color: transparent #7cb342 transparent transparent;
}
.apts-tile.is-reserved .apts-tile-mark {
  border-color: transparent #f0c040 transparent transparent;
}
.apts-tile.is-sold .apts-tile-mark {
  border-color: transparent #e8919c transparent transparent;
}

.apts-empty {
  margin: 1.5rem 0;
  text-align: center;
  color: #6a655c;
}

.apts-board--private-entrances .apts-entrances {
  display: none !important;
}

.apts-board--private-entrances .apts-level-tiles {
  margin-left: 0.5rem;
}

.apts-levels--townhouse {
  pointer-events: none;
}

.apts-townhouse-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.apts-tile--pin {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  min-width: 3.6rem;
  max-width: 5.8rem;
  box-shadow: 0 6px 18px rgba(27, 35, 48, 0.22);
}

.apts-tile--pin.is-filtered-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.apts-tile--pin:is(:hover, :focus-visible),
.apts-tile--pin.is-selected {
  z-index: 9;
  transform: translate(-50%, -50%) scale(1.06);
}

.apts-levels--townhouse:has(.apts-tile--pin:is(:hover, :focus-visible))
  .apts-tile--pin:not(:is(:hover, :focus-visible)):not(.is-filtered-out) {
  opacity: 0.55;
}

.apts-townhouse-add {
  position: absolute;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%);
  pointer-events: auto;
  z-index: 4;
}

.apts-level-empty--center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.88);
  padding: 0.45rem 0.7rem;
  border-radius: 0.35rem;
}

.apts-entrances {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 3.5%;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
  margin: 0;
  pointer-events: auto;
}

.apts-parking {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.apts-parking-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 2.55rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(27, 35, 48, 0.14);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.92);
  color: #2d2d2d;
  font-family: "Noto Sans Armenian", "Outfit", "Noto Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 35, 48, 0.12);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.apts-parking-btn:hover,
.apts-parking-btn:focus-visible,
.apts-parking-btn.is-active {
  background: #fff;
  border-color: #2d0913;
  box-shadow: 0 6px 18px rgba(45, 9, 19, 0.14);
  outline: none;
}

.apts-parking-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 0.3rem;
  background: #2d0913;
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 767.98px) {
  .apts-level-row {
    left: 2.5%;
    right: 2.5%;
  }

  .apts-level-label {
    flex-basis: 2.2rem;
    width: 2.2rem;
  }

  .apts-level-label,
  .apts-tile {
    min-height: 2.15rem;
    height: 2.15rem;
  }

  .apts-level-tiles {
    margin-left: clamp(1.25rem, 8%, 3.5rem);
  }

  .apts-tile {
    min-width: 3.1rem;
  }

  .apts-entrances {
    left: 4%;
    right: 4%;
    bottom: 2.5%;
    gap: 0.4rem 0.55rem;
  }

  .apts-parking-btn {
    min-height: 2.25rem;
    font-size: 0.78rem;
    padding: 0.3rem 0.4rem;
    gap: 0.3rem;
  }

  .apts-parking {
    grid-template-columns: 1fr;
  }
}

/* Mobile + tablet: force board/plan to fit page width (no horizontal overflow) */
@media (max-width: 991.98px) {
  .apts-board,
  .building-levels-engine,
  #building-levels,
  #building-levels.is-plan-view,
  #admin-building-levels {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .apts-panel,
  #building-levels.is-plan-view .building-levels-stage,
  #building-levels .building-levels-layout {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
}
