/* ============================================================
   MAP.CSS — hurt.dobrecieplo.eu
   Sekcja #mapa: mapa SVG Europy z animowanymi dostawami
   ============================================================ */

/* ─────────────────────────────────────────────────────────────
   SEKCJA WRAPPER
   ───────────────────────────────────────────────────────────── */
.section-mapa {
  overflow: hidden;
  /* padding i tło zarządzane przez main.css */
}

/* ─────────────────────────────────────────────────────────────
   SVG STAGE
   ───────────────────────────────────────────────────────────── */
.mapa__stage {
  width: 100%;
  background: transparent;
  border: none;
  line-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
  min-height: 600px;
}

.mapa__svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 640px;
}

/* ─────────────────────────────────────────────────────────────
   KRAJOWE TŁA
   ───────────────────────────────────────────────────────────── */
.map-country {
  fill: #F2F2F2;
  stroke: #C8C8C8;
  stroke-width: 0.5;
  stroke-linejoin: round;
}

.map-country--highlighted {
  fill: #FFFFFF;
  stroke: var(--color-accent-border);
  stroke-width: 1;
}

.map-country--muted {
  fill: #EFEFEF;
  stroke: #C8C8C8;
  stroke-width: 0.5;
}

.map-country--kaliningrad {
  fill: #EFEFEF;
  stroke: #C8C8C8;
  stroke-width: 0.5;
}

/* ─────────────────────────────────────────────────────────────
   TERMINALE (złote piny stałe)
   ───────────────────────────────────────────────────────────── */
.map-terminal__dot {
  fill: var(--color-accent);
  stroke: #fff;
  stroke-width: 2;
}

.map-terminal__pulse {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: terminal-pulse 2.5s ease-out infinite;
}

@keyframes terminal-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(2.8); opacity: 0;   }
}

.map-terminal__label {
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  fill: var(--color-accent);
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────
   GRUPY DOSTAW (wstrzykiwane przez JS)
   ───────────────────────────────────────────────────────────── */
.delivery-group {
  will-change: opacity;
}

/* ─────────────────────────────────────────────────────────────
   PINY DOSTAW (wstrzykiwane przez JS)
   ───────────────────────────────────────────────────────────── */
.delivery-pin {
  cursor: pointer;
  transition: opacity 0.4s ease;
}

.delivery-dot {
  fill: var(--color-accent);
  stroke: #fff;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 4px rgba(201, 149, 44, 0.50));
}

/* ─────────────────────────────────────────────────────────────
   LINIE DOSTAW (wstrzykiwane przez JS)
   ───────────────────────────────────────────────────────────── */
.delivery-line {
  fill: none;
  stroke: rgba(201, 149, 44, 0.35);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* ─────────────────────────────────────────────────────────────
   TOOLTIPS SVG
   ───────────────────────────────────────────────────────────── */
.delivery-tooltip {
  pointer-events: none;
}

.delivery-tooltip__bg {
  /* shadow now applied on group via filter="url(#tip-shadow)" injected by JS */
}

.delivery-tooltip__text-name {
  font-family: Inter, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  fill: var(--text-primary);
  pointer-events: none;
}

.delivery-tooltip__text-order {
  font-family: Inter, sans-serif;
  font-size: 10.5px;
  fill: var(--color-accent);
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────
   PASEK STATUS (pod mapą)
   ───────────────────────────────────────────────────────────── */
.mapa__bar {
  background: transparent;
  border: none;
  padding: 20px 0;
}

.mapa__bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--gap-md);
}

.mapa__last-delivery {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-size: var(--fs-small);
  color: #9CA3AF;
  margin: 0;
}

.mapa__last-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

.mapa__last-delivery strong {
  color: var(--color-accent);
}

.mapa__cta {
  flex-shrink: 0;
  font-size: var(--fs-small);
  padding: 0.6rem 1.2rem;
}

/* ─────────────────────────────────────────────────────────────
   ANIMACJA WEJŚCIA SEKCJI
   ───────────────────────────────────────────────────────────── */
.section-mapa {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.section-mapa.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────────────────────────────────────
   RESPONSYWNOŚĆ
   ───────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .mapa__bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .mapa__cta {
    width: 100%;
    text-align: center;
  }

  .mapa__stage {
    min-height: 0;
    padding: 20px 0;
  }

  .mapa__svg {
    width: 100%;
    max-height: 280px;
  }
}

@media (min-width: 640px) {
  .mapa__svg {
    max-height: 520px;
  }
}

@media (min-width: 1024px) {
  .mapa__svg {
    max-height: 640px;
  }
}
