:root { 
  --site-header-height: 200px; 
}

/* ===============  PAGE BASE  =============== */
.sightmap-wrapper {
  position: relative;
  width: 100%;
  height: 80vh;
  border: 2px solid #ccc;
}

.sightmap-wrapper iframe {
  display: block;
  border: 0;
  width: 100%;
  height: 100%;
}

html.modal-open,
body.modal-open {
  overflow: hidden;
}

/* ===============  OVERLAY  =============== */
.unit-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding-top: calc(var(--site-header-height) + 20px);
  background: rgba(0, 0, 0, .5);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.unit-modal::-webkit-scrollbar {
  display: none;
}

/* ===============  WHITE CARD  =============== */
.unit-modal-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  max-height: calc(100vh - var(--site-header-height) - 40px);
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.unit-modal-content::-webkit-scrollbar {
  display: none;
}

.unit-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
  color: #999;
  background: rgba(255, 255, 255, .9);
  border-radius: 50%;
}

.unit-modal-close:hover {
  color: #000;
  background: #fff;
}

/* ===============  HEADER  =============== */
.unit-modal-header {
  padding: 20px 40px 15px 20px;
  border-bottom: 1px solid #eee;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.unit-modal-header-right {
  text-align: right;
}

.unit-modal-header-right > * {
  margin-bottom: 5px;
}

.unit-modal-header-right > *:last-child {
  margin-bottom: 0;
}

.unit-modal-header h2 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 700;
  color: #333;
}

.unit-modal-details {
  font-size: 16px;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
}

.unit-modal-floorplan {
  font-size: 14px;
  color: #888;
  line-height: 1.3;
}

.unit-modal-availability {
  font-size: 14px;
  color: #28a745;
  font-weight: 500;
  line-height: 1.3;
}

.unit-modal-price {
  font-size: 26px;
  font-weight: 700;
  color: #2c5aa0;
  line-height: 1.2;
}

/* ===============  BODY  =============== */
.unit-modal-body {
  display: flex;
  min-height: 300px;
}

.unit-modal-image {
  flex: 1;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.unit-modal-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ===============  LOADING STATE  =============== */
.image-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #666;
  font-size: 14px;
  display: none;
  align-items: center;
  justify-content: center;
}

.image-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top: 2px solid #666;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.unit-modal-actions {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unit-action-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: #2c5aa0;
  border: 1px solid #e1e8ed;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
}

.unit-action-link:hover {
  background: #f8f9fa;
  border-color: #2c5aa0;
  color: #2c5aa0;
}

.action-icon {
  margin-right: 8px;
  font-size: 16px;
}

.unit-apply-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: var(--sightmap-secondary-color);
  color: #fff;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 10px;
  transition: background .2s ease;
  text-decoration: none;
}

.unit-apply-button:hover {
  background: var(--sightmap-secondary-color, #dc3545);
  filter: brightness(0.85);
  color: #fff;
}

.unit-modal-footer {
  padding: 15px 20px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
  text-align: center;
  color: #666;
}

.unit-modal-footer small {
  font-size: 12px;
  line-height: 1.4;
}

/* ===============  RESPONSIVE  =============== */
@media (max-width: 768px) {
  :root {
    --site-header-height: 80px;
  }
  
  .unit-modal-content {
    width: 95%;
    max-width: 95%;
    max-height: calc(100vh - var(--site-header-height) - 30px);
  }
  
  .unit-modal-body {
    flex-direction: column;
  }
  
  .unit-modal-image {
    min-height: 200px;
  }
  
  .unit-modal-header h2 {
    font-size: 26px;
  }
  
  .unit-modal-price {
    font-size: 22px;
  }
} 