/* SM Listings Map — v1.3.0 */

/* ------------------------------------------------------------------ */
/*  Sticky map wrapper                                                  */
/* ------------------------------------------------------------------ */

.sm-map-sticky {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 120px !important;
  z-index: 999 !important;
  height: calc(100vh - 120px) !important;
  width: 100% !important;
  align-self: flex-start !important;
}

/* Force parent column to allow sticky */
.elementor-column:has(.sm-map-sticky) {
  position: relative !important;
  align-self: flex-start !important;
}

/* Ensure section allows sticky children */
.elementor-section:has(.sm-map-sticky) {
  position: relative !important;
}

/* Override Elementor's default stretch */
.elementor-column:has(.sm-map-sticky) > .elementor-widget-wrap {
  align-content: flex-start !important;
  align-items: flex-start !important;
}

/* ------------------------------------------------------------------ */
/*  Map canvas                                                          */
/* ------------------------------------------------------------------ */

#sm-map {
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #f5f5f5;
}

/* ------------------------------------------------------------------ */
/*  Loading overlay                                                     */
/* ------------------------------------------------------------------ */

.sm-map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 245, 0.85);
  z-index: 10;
  gap: 12px;
  pointer-events: none;
}

.sm-map-loading p {
  margin: 0;
  font-size: 14px;
  color: #555;
}

.sm-map-loading__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ddd;
  border-top-color: #c6a85a;
  border-radius: 50%;
  animation: sm-spin 0.7s linear infinite;
}

@keyframes sm-spin {
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------------ */
/*  Anchor + selected state                                             */
/* ------------------------------------------------------------------ */

.sm-prop-anchor {
  display: block;
  height: 0;
  width: 0;
}

.sm-map-selected {
  outline: 3px solid #5f5a3c;
  outline-offset: 4px;
  border-radius: 8px;
}

/* ------------------------------------------------------------------ */
/*  Info window                                                         */
/* ------------------------------------------------------------------ */

.sm-map-infowindow {
  font-family: inherit;
  max-width: 260px;
}

.sm-map-infowindow__img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 10px;
  background: #f5f5f5;
}

.sm-map-infowindow__addr {
  font-size: 14px;
  line-height: 1.35;
  margin: 0 0 10px 0;
}

.sm-map-infowindow__btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #c6a85a;
  color: #ffffff;
}

.sm-map-infowindow__btn:hover {
  opacity: 0.9;
}

/* ------------------------------------------------------------------ */
/*  Mobile: disable sticky                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
  .sm-map-sticky {
    position: relative !important;
    top: 0 !important;
    height: 500px !important;
  }
}
