html, body { height: 100%; font-family: 'Montserrat', sans-serif; }
body { margin: 0; background: #ededed; }
#app { width: 100vw; height: 100vh; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: #22222A; width: min(420px, 92vw); max-height: 90vh; border-radius: 16px; box-shadow: 0 20px 48px rgba(0,0,0,0.25); overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.modal-header { background: #22222A; color: #fff; padding: 1rem; display: flex; align-items: center; justify-content: center; position: relative; }
.modal-header h4 { margin: 0; font-weight: 600; font-size: 2rem; }
.modal-close { position: absolute; left: 12px; top: 12px; width: 32px; height: 32px; background: #fb922e; border: none; color: #fff; font-size: 30px; line-height: 1; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.modal-body { padding: 0.5rem; display: grid; grid-template-rows: auto auto; gap: 0.5rem; overflow-y: auto; overscroll-behavior: contain; }
.modal-main { display: flex; align-items: center; justify-content: center; background: transparent; border-radius: 16px; padding: 0.75rem; }
#modalMainImage { width: 100%; height: 200px; object-fit: contain; border-radius: 20px; display: block; }
.modal-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 0.5rem; }
.modal-gallery img { width: 100%; height: 35px; object-fit: cover; border-radius: 8px; cursor: pointer; transition: transform 200ms ease, box-shadow 200ms ease; }
.modal-gallery img:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.2); }
.modal-overlay[hidden] { display: none !important; }
.modal-details { background: #22222A; color: #ffffff; border-radius: 16px; padding: 0.75rem 1rem; font-size: 0.95rem; }
.badge { display: inline-block; background: #fb922e; color: #fff; padding: 0.25rem 0.6rem; border-radius: 9999px; font-weight: 600; margin-bottom: 0.5rem; }
.modal-details h3 { margin: 0.25rem 0; font-size: 1.4rem; font-weight: 700; }
.address { display: flex; align-items: center; gap: 0.25rem; opacity: 0.9; margin-bottom: 0.75rem; }
.addr-icon { width: 18px; height: 18px; display: inline-block; }
.full-address { font-size: 0.85rem; opacity: 0.85; }
.modal-details h5 { margin: 0 0 0.5rem 0; font-weight: 600; }
.details-list { display: grid; gap: 0.5rem; }
.detail-item { background: #1f1f25; border-radius: 12px; padding: 0.5rem 0.75rem; }
.detail-label { font-size: 0.9rem; margin-bottom: 0.25rem; }
.detail-value { font-size: 0.95rem; font-weight: 500; opacity: 0.95; }
.modal-details a { color: #ffffff; text-decoration: underline; }
.modal-details td { word-break: break-word; }

.cta-btn { display: block; width: 100%; max-width: 280px; text-align: center; margin: 1rem auto 0; padding: 0.75rem; border-radius: 9999px; background: #d0d0d5; color: #22222A; font-weight: 600; text-decoration: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15); }

.loading-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #ededed; z-index: 2000; opacity: 1; transition: opacity 300ms ease; }
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-box { display: grid; gap: 0.75rem; align-items: center; justify-items: center; padding: 1.25rem 1.5rem; border-radius: 16px; background: rgba(255,255,255,0.85); box-shadow: 0 12px 36px rgba(0,0,0,0.2); }
.spinner { width: 48px; height: 48px; border: 4px solid #d0d0d5; border-top-color: #fb922e; border-radius: 50%; animation: spin 1s linear infinite; }
.loading-text { font-weight: 600; color: #22222A; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1081px) {
  html { font-size: clamp(18px, 5vw, 24px); }
  .modal-overlay { align-items: stretch; justify-content: stretch; }
  .modal-box { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .modal-body { padding: 0.75rem; grid-template-rows: auto 1fr; }
  .modal-header { padding: 1rem; }
  .modal-header h4 { font-size: clamp(1.6rem, 5.2vw, 2.4rem); }
  .modal-close { left: clamp(12px, 3vw, 16px); top: clamp(12px, 3vw, 16px); width: clamp(44px, 12vw, 64px); height: clamp(44px, 12vw, 64px); font-size: clamp(34px, 10vw, 52px); }
  #modalMainImage { height: 35vh; object-fit: contain; border-radius: clamp(16px, 4vw, 24px); }
  .modal-details { font-size: clamp(1rem, 3.4vw, 1.2rem); }
  .modal-details h3 { font-size: clamp(1.25rem, 4vw, 1.6rem); }
  .detail-label { font-size: clamp(0.95rem, 3.2vw, 1.1rem); }
  .detail-value { font-size: clamp(1rem, 3.4vw, 1.2rem); }
  .badge { font-size: clamp(0.9rem, 3vw, 1.05rem); padding: 0.3rem 0.7rem; }
  .cta-btn { width: 100%; max-width: none; margin: 1rem 0 0; }
  .cta-btn { font-size: clamp(1rem, 3.4vw, 1.2rem); padding: clamp(0.75rem, 2.8vw, 1rem); }
  .modal-gallery img { height: 9vh; }
}