/* LALALAY Residences 360° — Reference Modals & Responsive Breakpoints */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 9, 18, 0.82);
  backdrop-filter: blur(12px);
}

.modal-backdrop.is-open { display: flex; }

.modal-card {
  width: min(1040px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  border-radius: 18px;
  background: var(--navy-panel);
  border: 1px solid var(--gold-border);
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.72);
  position: relative;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-head h3 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--gold-light);
}

.modal-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.modal-figure {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--gold-border);
  background: rgba(255, 255, 255, 0.03);
}

.modal-figure img { width: 100%; display: block; }
.modal-figure figcaption { padding: 10px 12px; font-size: 12px; color: var(--muted); }

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

.modal-head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Khung nhúng mô hình 3D phủ toàn màn hình */
.hud-btn.hud-btn-3d { color: #1c1306; background: linear-gradient(135deg, var(--gold), #b8894a); font-weight: 600; }
.hud-btn.hud-btn-3d:hover { color: #1c1306; filter: brightness(1.08); }

.spec-pills-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.spec-pill {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(216, 179, 106, 0.12);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
}

/* Khung tiện ích: ảnh tổng mặt bằng có điểm đánh số + bảng chú thích */
.modal-card.modal-card-wide { width: min(1320px, 100%); }
.amenity-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.amenity-map-stage { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--gold-border); }
.amenity-map-stage img { width: 100%; display: block; }
.amenity-spot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 1; }
.amenity-spot b { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 2px solid rgba(255, 255, 255, 0.9); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); transition: transform 0.25s var(--ease-luxury), box-shadow 0.25s; }
.amenity-spot.is-red b { background: #c9573e; color: #fff; }
.amenity-spot.is-blue b { background: #d6eef7; color: #0c2430; }
.amenity-spot.is-gold b { background: #cfa36a; color: #1c1306; }
.amenity-spot em { position: absolute; bottom: calc(100% + 6px); font-style: normal; font-size: 11.5px; font-weight: 600; white-space: nowrap; padding: 4px 9px; border-radius: 999px; background: rgba(8, 17, 31, 0.9); border: 1px solid var(--gold-border); color: var(--ivory); opacity: 0; transform: translateY(4px); transition: all 0.25s var(--ease-luxury); pointer-events: none; }
.amenity-spot:hover em, .amenity-spot.is-on em { opacity: 1; transform: none; }
.amenity-spot.is-on { z-index: 3; }
.amenity-spot.is-on b { transform: scale(1.3); box-shadow: 0 0 0 4px rgba(243, 219, 164, 0.6), 0 4px 12px rgba(0, 0, 0, 0.45); }
.amenity-spot.is-dim { opacity: 0.35; }
.amenity-legend { padding: 4px 2px; }
.amenity-legend-kicker { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.amenity-legend-title { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--gold-light); margin: 4px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--gold-border); }
.amenity-group { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--gold-light); margin: 10px 2px 4px; }
.amenity-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 8px; border-radius: 10px; text-align: left; font-size: 13px; color: var(--ivory); transition: background 0.25s; }
.amenity-row i { flex-shrink: 0; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700; border: 2px solid rgba(255, 255, 255, 0.8); }
.amenity-row i.is-red { background: #c9573e; color: #fff; }
.amenity-row i.is-blue { background: #d6eef7; color: #0c2430; }
.amenity-row i.is-gold { background: #cfa36a; color: #1c1306; }
.amenity-row:hover, .amenity-row.is-on { background: rgba(216, 179, 106, 0.18); }
/* Thẻ ảnh phối cảnh của tiện ích đang chọn (đầu bảng chú thích) và ảnh phóng to */
.amenity-card { display: none; margin: 10px 0 6px; padding: 10px; border-radius: 12px; background: rgba(216, 179, 106, 0.08); border: 1px solid var(--gold-border); animation: amenity-card-in 0.4s var(--ease-luxury); }
.amenity-card.is-open { display: block; }
.amenity-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.amenity-card-head i { flex-shrink: 0; display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 999px; font-style: normal; font-size: 12px; font-weight: 700; border: 2px solid rgba(255, 255, 255, 0.85); }
.amenity-card-head i.is-red { background: #c9573e; color: #fff; }
.amenity-card-head i.is-blue { background: #d6eef7; color: #0c2430; }
.amenity-card-head i.is-gold { background: #cfa36a; color: #1c1306; }
.amenity-card-head strong { flex: 1; font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.15; color: var(--gold-light); }
.amenity-card-close { width: 26px; height: 26px; border-radius: 8px; color: var(--muted); }
.amenity-card-close:hover { color: var(--ivory); background: rgba(255, 255, 255, 0.08); }
.amenity-card-photo { position: relative; display: block; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--gold-border); cursor: zoom-in; }
.amenity-card-photo img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.8s var(--ease-luxury); }
.amenity-card-photo:hover img { transform: scale(1.05); }
.amenity-card-photo span { position: absolute; right: 7px; bottom: 7px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: rgba(8, 17, 31, 0.8); color: var(--gold-light); }
.amenity-card-note { margin-top: 6px; font-size: 10.5px; font-style: italic; color: var(--muted); }
.amenity-card-empty { display: grid; place-items: center; aspect-ratio: 16 / 10; padding: 12px; border-radius: 10px; border: 1px dashed var(--gold-border); font-size: 12px; color: var(--muted); text-align: center; }
.amenity-lightbox { position: fixed; inset: 0; z-index: 5; display: none; place-items: center; padding: 24px; background: rgba(4, 9, 18, 0.9); cursor: zoom-out; }
.amenity-lightbox.is-open { display: grid; animation: amenity-card-in 0.4s var(--ease-luxury); }
.amenity-lightbox figure { width: min(1400px, 100%); }
/* Ảnh giãn vừa khung (kể cả ảnh gốc nhỏ); drop-shadow bám theo phần ảnh thật. */
.amenity-lightbox img { display: block; width: 100%; height: min(calc(100vh - 120px), 820px); object-fit: contain; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.6)); }
.amenity-lightbox figcaption { margin-top: 12px; text-align: center; font-family: var(--font-display); font-size: 22px; color: var(--ivory); }
.amenity-lightbox figcaption b { color: var(--gold-light); margin-right: 6px; }
.amenity-lightbox figcaption small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
@keyframes amenity-card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .amenity-map-layout { grid-template-columns: 1fr; }
  .amenity-spot b { min-width: 18px; height: 18px; font-size: 9px; border-width: 1.5px; }
}

@media (max-width: 900px) {
  .minimap-box, .scene-caption-chip, .compass-pill { display: none; }
  .hud-top { top: 10px; left: 10px; right: 10px; }
  .hud-bottom { bottom: 10px; }
  .hud-toggle-float { top: 10px; right: 10px; bottom: auto; padding: 7px 10px; font-size: 11px; }
  /* Chừa chỗ cho nút Ẩn/Hiện HUD nổi ở góc phải để thẻ tên không bị nút đè. */
  .brand-badge { gap: 10px; padding: 9px 12px; min-width: 0; max-width: calc(100% - 100px); }
  .brand-badge > div { min-width: 0; }
  .brand-meta-tag { letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
