/**
 * Live Sales Map — Styles
 */

/* ── Wrapper ─────────────────────────────────────────────────────── */

.lsm-wrapper {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  background: #f5f5f5;
}

.lsm-map {
  width: 100%;
  min-height: 300px;
  z-index: 1;
}

/* Hide Leaflet default blue marker shadows */
.lsm-map .leaflet-marker-icon {
  background: none !important;
  border: none !important;
}

/* ── Pin icon ────────────────────────────────────────────────────── */

.lsm-pin-icon {
  background: none !important;
  border: none !important;
  transition: opacity 0.4s ease;
  color: var(--lsm-marker-color, #ee7723);
}

.lsm-pin-active {
  z-index: 1000 !important;
}

/* ── City label ──────────────────────────────────────────────────── */

.lsm-city-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  text-align: center;
  white-space: nowrap;
}

.lsm-city-label::before {
  display: none !important;
}

/* ── Loader ──────────────────────────────────────────────────────── */

.lsm-loader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(245, 245, 245, 0.9);
  backdrop-filter: blur(4px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #888;
  transition: opacity 0.3s;
}

.lsm-loader__spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--lsm-marker-color, #ee7723);
  border-radius: 50%;
  animation: lsm-spin 0.8s linear infinite;
}

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

/* ── Notification — shared ───────────────────────────────────────── */

.lsm-notification {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--lsm-notif-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--lsm-notif-text, #333);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.lsm-notification.lsm-notif--visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Notification — card variant (top-left) ──────────────────────── */

.lsm-notification--card {
  top: 20px;
  left: 20px;
  max-width: 320px;
  padding: 16px 20px;
  transform: translateY(-10px);
}

.lsm-notification--card.lsm-notif--visible {
  transform: translateY(0);
}

/* ── Notification — toast variant (bottom center) ────────────────── */

.lsm-notification--toast {
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 10px);
  max-width: 380px;
  padding: 12px 20px;
  border-radius: 50px;
  font-size: 13px;
}

.lsm-notification--toast.lsm-notif--visible {
  transform: translate(-50%, 0);
}

/* ── Notification — none variant ─────────────────────────────────── */

.lsm-notification--none {
  display: none !important;
}

/* ── Notification inner elements ─────────────────────────────────── */

.lsm-notif__image {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}

.lsm-notif__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lsm-notif__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--lsm-accent-color, #4caf50) 15%, transparent);
  color: var(--lsm-accent-color, #388e3c);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lsm-notif__icon svg {
  width: 24px;
  height: 24px;
}

.lsm-notif__content {
  flex: 1;
  min-width: 0;
}

.lsm-notif__title {
  font-size: 14px;
  font-weight: 400;
  color: inherit;
  line-height: 1.45;
}

.lsm-notif__title strong {
  font-weight: 600;
}

.lsm-notif__time {
  margin-top: 3px;
  font-size: 12px;
  color: var(--lsm-accent-color, #4caf50);
  font-weight: 500;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .lsm-notification--card {
    left: 10px;
    right: 10px;
    max-width: none;
    top: 10px;
  }

  .lsm-notification--toast {
    left: 10px;
    right: 10px;
    max-width: none;
    transform: translateY(10px);
  }

  .lsm-notification--toast.lsm-notif--visible {
    transform: translateY(0);
  }

  .lsm-notif__icon,
  .lsm-notif__image {
    width: 38px;
    height: 38px;
  }
}

/* ── Dark theme adjustments ──────────────────────────────────────── */

.lsm-wrapper[data-theme="dark"] .lsm-notification,
.lsm-wrapper:has(.leaflet-tile-pane [src*="dark"]) .lsm-notification {
  background: rgba(30, 30, 30, 0.95);
  color: #eee;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.lsm-wrapper[data-theme="dark"] .lsm-notif__title,
.lsm-wrapper:has(.leaflet-tile-pane [src*="dark"]) .lsm-notif__title {
  color: #f0f0f0;
}

.lsm-wrapper[data-theme="dark"] .lsm-notif__title strong,
.lsm-wrapper:has(.leaflet-tile-pane [src*="dark"]) .lsm-notif__title strong {
  color: #fff;
}

.lsm-wrapper[data-theme="dark"] .lsm-notif__time,
.lsm-wrapper:has(.leaflet-tile-pane [src*="dark"]) .lsm-notif__time {
  color: #66bb6a;
}

.lsm-wrapper[data-theme="dark"] .lsm-notif__icon,
.lsm-wrapper:has(.leaflet-tile-pane [src*="dark"]) .lsm-notif__icon {
  background: rgba(56, 142, 60, 0.2);
  color: #66bb6a;
}

.lsm-wrapper[data-theme="dark"] .lsm-loader,
.lsm-wrapper:has(.leaflet-tile-pane [src*="dark"]) .lsm-loader {
  background: rgba(20, 20, 20, 0.85);
  color: #aaa;
}

.lsm-wrapper[data-theme="dark"] .lsm-city-label,
.lsm-wrapper:has(.leaflet-tile-pane [src*="dark"]) .lsm-city-label {
  color: #ccc;
}
