/* Product details only. Existing content, image sources and actions are preserved. */
#unitModal,
#unitModal * {
  box-sizing: border-box;
  font-family: 'Be Vietnam Pro', Arial, sans-serif !important;
}
#unitModal {
  padding: 18px;
  color: #18483e;
  font-size: 15px;
  line-height: 1.55;
}
#unitModal[hidden],
#unitModal [hidden] { display: none !important; }
#unitModal .modal-card {
  width: min(1100px, calc(100vw - 36px));
  max-width: 1100px;
  height: auto;
  max-height: calc(100dvh - 36px);
  border-radius: 18px;
  background: #fff;
  overflow: auto;
  overscroll-behavior: contain;
}
#unitModal .modal-card > header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  padding: 16px 22px !important;
  border-bottom: 1px solid #e0e8e2;
  background: #fff;
  backdrop-filter: none;
}
#unitModal .modal-card > header > div { min-width: 0; }
#unitModal .modal-card > header .kicker {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 1px;
  color: #92743e;
}
#unitModal #modalTitle {
  margin: 4px 0 0;
  color: #134c43;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.35px;
  overflow-wrap: anywhere;
}
#unitModal .close-btn {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: #edf3ef;
  color: #184d42;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
#unitModal .modal-body {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: start;
  gap: 20px;
  padding: 20px 22px 22px;
  min-width: 0;
}
#unitModal .modal-body > div { min-width: 0; }
#unitModal .modal-media {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #f1f5f2;
  overflow: hidden;
  align-self: start;
}
#unitModal .modal-media img {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  object-fit: contain;
  object-position: center;
  aspect-ratio: auto;
}
#unitModal .modal-media .empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: #728478;
}
#unitModal .detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
#unitModal .detail-grid > .detail {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e6ece7;
  border-radius: 10px;
  background: #f7f9f6;
}
#unitModal .detail-grid > .detail:first-child { grid-column: 1 / -1; }
#unitModal .detail span {
  display: block;
  margin: 0;
  color: #6b8072;
  font-size: 13px !important;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#unitModal .detail b {
  display: block;
  margin-top: 3px;
  color: #244f41;
  font-size: 16px !important;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: normal;
}
#unitModal .modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
#unitModal .modal-actions a,
#unitModal .modal-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px !important;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
#unitModal .modal-actions .booking { grid-column: 1 / -1; }
#unitModal .sale-warning {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.65;
}
#unitModal button:focus-visible,
#unitModal a:focus-visible {
  outline: 3px solid #aac4b5;
  outline-offset: 2px;
}
/* Keep the floating assistant from obscuring information inside the open dialog. */
body:has(#unitModal:not([hidden])) .npd-ai-chat { display: none !important; }
@media (max-width: 900px) {
  #unitModal .modal-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}
@media (max-width: 640px) {
  #unitModal { padding: 0; }
  #unitModal .modal-card {
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  #unitModal .modal-card > header {
    min-height: 76px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px !important;
    gap: 12px;
  }
  #unitModal #modalTitle { font-size: 22px; }
  #unitModal .modal-card > header .kicker {
    font-size: 10px;
    letter-spacing: .8px;
  }
  #unitModal .modal-body { padding: 14px 16px calc(22px + env(safe-area-inset-bottom)); }
  #unitModal .modal-media { border-radius: 10px; }
  #unitModal .detail-grid { gap: 8px; }
  #unitModal .detail-grid > .detail { padding: 9px 10px; }
  #unitModal .detail b { font-size: 15px !important; }
  #unitModal .modal-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
