/* ─── Land Map Plugin Styles ─────────────────────────────── */

:root {
  --lm-available:  #4caf50;
  --lm-sold:       #e53935;
  --lm-reserved:   #fb8c00;
  --lm-hover:      #1565c0;
  --lm-popup-bg:   #1a2535;
  --lm-popup-text: #e8edf5;
  --lm-accent:     #4fc3f7;
  --lm-radius:     12px;
}

/* Скрываем логотип/флаг Leaflet, оставляем только текст копирайта ESRI */
.leaflet-control-attribution a[href*="leaflet"],
.leaflet-control-attribution svg {
  display: none !important;
}

/* ─── Wrapper ───────────────────────────────────────────── */
#land-map-wrapper {
  position: relative;
  font-family: 'Segoe UI', system-ui, sans-serif;
  max-width: 100%;
}

/* ─── Map container ─────────────────────────────────────── */
#land-map-container {
  border-radius: var(--lm-radius);
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,.18);
}

#land-map {
  width: 100%;
  height: 560px;
}

/* ─── Legend ────────────────────────────────────────────── */
#land-map-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #444;
  font-weight: 500;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot.available { background: var(--lm-available); }
.legend-dot.sold      { background: var(--lm-sold); }
.legend-dot.reserved  { background: var(--lm-reserved); }

/* ─── Custom Popup ──────────────────────────────────────── */
.lm-popup .leaflet-popup-content-wrapper {
  background: var(--lm-popup-bg);
  color: var(--lm-popup-text);
  border-radius: var(--lm-radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
  padding: 0;
  min-width: 230px;
}

.lm-popup .leaflet-popup-tip {
  background: var(--lm-popup-bg);
}

.lm-popup .leaflet-popup-content {
  margin: 0;
}

.lm-popup-inner {
  padding: 18px 20px 16px;
}

.lm-popup-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--lm-accent);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  letter-spacing: .3px;
}

.lm-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 7px;
  color: rgba(232,237,245,.75);
}

.lm-popup-row span:last-child {
  font-weight: 600;
  color: var(--lm-popup-text);
}

.lm-popup-status {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.lm-popup-status.available { background: rgba(76,175,80,.2);  color: #81c784; }
.lm-popup-status.sold      { background: rgba(229,57,53,.2);  color: #ef9a9a; }
.lm-popup-status.reserved  { background: rgba(251,140,0,.2);  color: #ffcc80; }

/* ─── Add to cart button ────────────────────────────────── */
.lm-add-to-cart {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px 0;
  background: var(--lm-accent);
  color: #0d1821;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  letter-spacing: .4px;
  transition: background .2s, transform .15s;
}
.lm-add-to-cart:hover {
  background: #81d4fa;
  transform: translateY(-1px);
}
.lm-add-to-cart:active { transform: translateY(0); }
.lm-add-to-cart:disabled {
  background: #37474f;
  color: #78909c;
  cursor: not-allowed;
  transform: none;
}

.lm-cart-success {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px 0;
  background: rgba(76,175,80,.15);
  color: #81c784;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  text-align: center;
}

.lm-cart-link {
  color: var(--lm-accent);
  text-decoration: underline;
  font-size: 12px;
  display: block;
  text-align: center;
  margin-top: 6px;
}

/* ─── Close button fix ──────────────────────────────────── */
.lm-popup .leaflet-popup-close-button {
  color: rgba(255,255,255,.5) !important;
  font-size: 20px !important;
  top: 8px !important;
  right: 10px !important;
}
.lm-popup .leaflet-popup-close-button:hover {
  color: #fff !important;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  #land-map { height: 380px; }
}
