/* ════════════════════════════════════════════════════════════════════════
   TOMODATCHI SHOP — sales-map.css
   Styling for the Country Sales Map widget. Loaded only on pages where
   the widget actually renders (see inc/class-tomo-sales-map-widget.php).
   ════════════════════════════════════════════════════════════════════════ */

.tomo-sales-map {
  position: relative;
  width: 100%;
  /* Small inside a widget box, as requested — pan/zoom does the rest. */
  height: 180px;
  border-radius: 14px;
  border: 2px solid var(--border-soft);
  background: #f4f9fd;
  overflow: hidden;
  cursor: grab;
}
.tomo-sales-map:active { cursor: grabbing; }

/* Dark mode: ocean deliberately darker than most other page elements
   (the page bg is #23232e, card surfaces are #2a2a38 — this sits
   below both), so the map reads as a distinct "water" depth rather
   than just another panel. Country/state/nation fill colours are set
   in JS (see sales-map.js colorScale/NO_DATA_FILL) since they're
   computed per-region, not styleable from CSS alone. */
[data-theme="dark"] .tomo-sales-map {
  background: #1a1a22;
  border-color: var(--border-soft);
}

.tomo-sales-map svg { width: 100%; height: 100%; display: block; touch-action: none; }

.tomo-sales-map-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka', sans-serif; font-size: 0.78rem; color: var(--muted);
  text-align: center; padding: 12px;
}

.tomo-sales-map-region {
  stroke: #ffffff;
  stroke-width: 0.5;
  transition: filter 0.12s ease;
  /* vector-effect (set on the element itself in JS) keeps this stroke
     width visually constant at any zoom level — it's set as an SVG
     attribute rather than purely in CSS so it can't be silently lost. */
}
.tomo-sales-map-region:hover,
.tomo-sales-map-region.is-hovered {
  filter: brightness(0.92);
  stroke: var(--ink);
  stroke-width: 0.8;
}

.tomo-sales-map-tooltip {
  position: absolute;
  top: 0; left: 0;
  z-index: 5;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.74rem;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(46,55,251,0.28);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.tomo-sales-map-tooltip strong { font-weight: 700; }
.tomo-sales-map-tooltip-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.66rem;
  color: rgba(255,255,255,0.72);
}
