/* =========================================================
   LOCATION MAP + MODAL
   - Leaflet map styling
   - Location modal sizing + animation
   - iOS-friendly interactions
   ========================================================= */

.modal-backdrop.show {
  opacity: 0.55; /* slightly softer */
}

/* Main modal card */
.ss-modal {
  background: #FAF4EE;                 /* your cream */
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 1.25rem;              /* ~20px */
  box-shadow: 0 1.25rem 3.75rem rgba(0,0,0,0.22);
  overflow: hidden;
}

/* Header */
.ss-modal__header {
  border: 0;
  padding: 1.25rem 1.5rem 0.75rem;
  background: transparent;
}

.ss-modal__title {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.ss-modal__sub {
  color: rgba(20,25,30,0.7);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

/* Close button: soften it a bit */
.ss-modal__close {
  opacity: 0.65;
}
.ss-modal__close:hover {
  opacity: 1;
}

/* Body */
.ss-modal__body {
  padding: 0.75rem 1.5rem 1.1rem;
}

/* Map wrapper (rounded + subtle border) */
.ss-map {
  border-radius: 1rem; /* 16px */
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.5);
}

/* Footer */
.ss-modal__footer {
  border: 0;
  padding: 0 1.5rem 1.25rem;
  gap: 0.75rem;
  background: transparent;
}

/* Buttons */
.ss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 150ms ease, filter 150ms ease, background 150ms ease;
  white-space: nowrap;
}

.ss-btn--primary {
  background: rgba(120, 145, 130, 0.95); /* your sage */
  color: #fff;
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,0.14);
}

.ss-btn--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.ss-btn--ghost {
  background: rgba(255,255,255,0.55);
  color: rgba(20,25,30,0.85);
  border-color: rgba(0,0,0,0.14);
}

.ss-btn--ghost:hover {
  background: rgba(255,255,255,0.7);
}

/* Reduce overall modal size */
.modal-dialog.modal-xl {
  max-width: 52rem; /* ~830px instead of full XL */
}

/* Header tighter */
.ss-modal__header {
  padding: 1rem 1.25rem 0.5rem;
}

/* Body tighter */
.ss-modal__body {
  padding: 0.5rem 1.25rem 0.9rem;
}

/* Footer tighter */
.ss-modal__footer {
  padding: 0 1.25rem 1rem;
}

.ss-modal {
  border-radius: 1.1rem;
}

.ss-map {
  border-radius: 0.9rem;
}

/* Modal microfade + scale */
.modal.fade .modal-dialog {
  transform: translateY(0.5rem) scale(0.98);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .modal.fade .modal-dialog,
  .modal.show .modal-dialog {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

/* Leaflet map sizing inside modal */
.ss-leaflet {
  width: 100%;
  height: 22rem;            /* smaller + cleaner */
}

/* Match your rounded map wrapper */
.ss-map {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.5);
}

/* --- Location modal layout: remove “dead space” --- */
#locationModal .modal-body {
  padding: 0.75rem 1.25rem 0.75rem;
}

#locationModal .ss-map {
  margin: 0;                 /* ensure no extra gap */
}

#locationModal .ss-leaflet {
  height: 26rem;             /* taller map = more premium */
  min-height: 18rem;
}

/* --- Premium modal look --- */
#locationModal .modal-content {
  border: 0;
  border-radius: 1.25rem;
  background: rgba(250, 244, 238, 0.96); /* your cream tone */
  box-shadow: 0 1.5rem 4rem rgba(0,0,0,0.28);
}

/* Header looks cleaner */
#locationModal .modal-header {
  border-bottom: 0;
  padding: 1rem 1.25rem 0.25rem;
}

#locationModal .modal-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Footer: less “empty band” */
#locationModal .modal-footer {
  border-top: 0;
  padding: 0.75rem 1.25rem 1rem;
  gap: 0.75rem;
}

/* ===== Location modal: remove bottom gap + make map fill nicely ===== */
#locationModal .modal-body{
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1.25rem 0; /* no bottom padding */
}

/* the wrapper around the map should fill the body */
#locationModal .ss-map{
  flex: 1;
  margin: 0;
}

/* make the leaflet div fill the wrapper */
#locationModal .ss-leaflet{
  width: 100%;
  height: 100%;
  min-height: 26rem;  /* keep it feeling premium */
  border-radius: 1rem;
}

/* Bootstrap modal adds padding-right to compensate for scrollbar removal.
   We already reserve scrollbar width (html { overflow-y: scroll; }),
   so kill that extra padding to prevent the right-side gap. */
body.modal-open {
  padding-right: 0 !important;
}

/* Also protect sticky elements (topbar/nav) if they appear to shift */
body.modal-open .topbar,
body.modal-open .main-nav {
  padding-right: 0 !important;
}

/* Belt + braces: sometimes Bootstrap applies padding to .modal itself */
.modal {
  padding-right: 0 !important;
}
