/* ── Agrobiotics – Mapa Przedstawicieli ──────────────────────────────────
   Scoped: wszystkie selektory zaczynają się od .mp-root
   Kolory: brand Agrobiotics (#0E6A36 zielony, #333333 ciemny)
   Typografia: dziedziczy font motywu
──────────────────────────────────────────────────────────────────────── */

/* ── Variables ── */
.mp-root {
  --mp-accent:  #0E6A36;
  --mp-dark:    #1a3326;
  --mp-text:    #333333;
  --mp-muted:   rgba(0,0,0,0.42);
  --mp-border:  rgba(0,0,0,0.09);
  --mp-surface: rgb(231 238 229 / 50%);
  --mp-white:   #ffffff;

  --mp-bw: #6db868;
  --mp-mb: #5ea4d8;
  --mp-kk: #d4a642;
  --mp-pp: #9d7bc5;
  --mp-js: #d4735a;

  --mp-def: #8a9199;
}

/* ── Reset (scoped) ── */
.mp-root,
.mp-root *,
.mp-root *::before,
.mp-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.mp-root {
  font-size: 16px;
  font-family: var(--familyFontHead, "Bebas Neue", sans-serif);
  line-height: 1.5;
  color: var(--mp-text);
  background: transparent;
  position: relative;
}

.mp-root p   { margin: 0; padding: 0; line-height: inherit; text-align: left; }
.mp-root a   { text-decoration: none; line-height: inherit; }

/* Globalne letter-spacing dla całej mapki */
.mp-root,
.mp-root * {
  letter-spacing: 1px !important;
}

/* Wymuszenie fontu — override globalnego a { font-family: var(--familyFontPara) } z motywu */
.mp-bounce,
.mp-root,
.mp-root *,
.mp-panel,
.mp-panel * {
  font-family: var(--familyFontHead, "Bebas Neue", sans-serif) !important;
}

/* ── Outer wrapper ── */
.mp-wrap {
  position: relative;
  z-index: 1;
  padding: 0 0 16px;
}

/* ── Intro heading ── */
.mp-intro {
  text-align: center;
  margin-bottom: 4px;
}

.mp-intro h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 400;
  font-family: var(--familyFontHead, "Bebas Neue", sans-serif);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  line-height: 1.2;
  color: var(--mp-dark);
}

.mp-intro h2 em {
  font-style: normal;
}

.mp-intro > p {
  font-size: 0.88rem;
  color: var(--mp-muted);
  margin: 0;
  text-align: center;
}

.mp-bounce {
  display: inline-block;
  animation: mp-bounce 2s ease-in-out infinite;
}

@keyframes mp-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}

/* ── Layout row (mobile: column, desktop: 3 cols) ── */
.mp-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1220px;
  margin: 0 auto;
}

.mp-legend {
  order: 3;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.mp-row #poland-map { order: 1; }
.mp-panel          { order: 2; }

@media (min-width: 860px) {
  .mp-row {
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
  .mp-row #poland-map {
    flex: 1;
    min-width: 0;
    order: 2;
    align-self: flex-start;
    width: 100%;
    height: auto;
    aspect-ratio: 1000 / 900;
    display: block;
    overflow: visible;
  }
  .mp-legend {
    order: 1;
    width: 160px;
    flex-shrink: 0;
  }
}

/* ── Legend ── */
.mp-legend-title {
  font-size: 0.9rem;
  font-weight: 400;
  font-family: var(--familyFontHead, "Bebas Neue", sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mp-muted);
  margin-bottom: 8px;
  line-height: 1.4;
  text-align: center;
}

.mp-lgrid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

@media (min-width: 860px) {
  .mp-lgrid {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
}

/* Legend item */
.mp-litem {
  display: flex;
  align-items: center;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--mp-white);
  border: 1px solid var(--mp-border);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  line-height: 1.4;
}

.mp-litem:hover  { background: var(--mp-surface); }
.mp-litem.active { background: rgba(231,238,229,.6); box-shadow: 0 1px 4px rgba(14,106,54,.18); }

.mp-lname {
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

/* ── SVG Map ── */
.mp-root #poland-map {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: all;
}

.mp-root #features path {
  fill: var(--mp-def);
  cursor: pointer;
  transition: fill .18s ease;
  stroke: #ffffff !important;
  stroke-width: 1.2 !important;
  pointer-events: all;
}

.mp-root #features path:hover {
  stroke: #ffffff !important;
  stroke-width: 1.8 !important;
  filter: brightness(1.15);
}

.mp-root #features path.sel {
  stroke: #ffffff !important;
  stroke-width: 2.2 !important;
  animation: mp-pulse 2.5s ease-in-out infinite;
}

@keyframes mp-pulse {
  0%, 100% { filter: brightness(1.05); }
  50%       { filter: brightness(1.2); }
}

.mp-root #points,
.mp-root #label_points { display: none; }

/* ── Contact panel (right column) ── */
.mp-panel {
  background: var(--mp-white);
  border: 1px solid var(--mp-border);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

@media (min-width: 860px) {
  .mp-panel {
    order: 3;
    width: 265px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
  }
  .mp-cname,
  .mp-citem {
    line-height: 3 !important;
  }
}

/* Empty state */
.mp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 20px;
  text-align: center;
  min-height: 175px;
}

@media (min-width: 860px) { .mp-empty { flex: 1; } }

.mp-empty-icon {
  width: 44px;
  height: 44px;
  border: 1px dashed rgba(0,0,0,0.18);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-empty p {
  font-size: 0.88rem;
  color: var(--mp-muted);
  max-width: 190px;
  line-height: 1.5;
  margin: 0;
}

/* Contact filled state */
.mp-contact { display: none; flex-direction: column; }
.mp-contact.on { display: flex; }

/* Accent bar */
.mp-cbar {
  height: 3px;
  background: #106036;
  flex-shrink: 0;
}

/* Region header */
.mp-cheader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px 5px;
  background: var(--mp-surface);
  border-bottom: 1px solid var(--mp-border);
  flex-shrink: 0;
  gap: 8px;
}

.mp-cregion {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #106036;
  line-height: 1;
  text-align: left;
  flex: 1;
}

.mp-cclose,
#mp-close {
  background: #106036 !important;
  border: none;
  color: var(--mp-white) !important;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background .12s, color .12s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  margin: auto;
}

.mp-cclose:hover { background: rgba(0,0,0,0.06); color: var(--mp-text); }

/* Person */
/* Person */
.mp-cperson {
  padding: 5px 14px;
  border-bottom: 1px solid var(--mp-border);
  flex-shrink: 0;
  text-align: left;
  line-height: 0.7;
}

.mp-cname {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mp-dark);
  line-height: 0.7;
  margin: 0;
  padding: 0;
}

/* Contact rows */
.mp-citems { display: flex; flex-direction: column; }

.mp-citem {
  padding: 4px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  line-height: 0.7;
}

.mp-citem:last-child { border-bottom: none; }

.mp-clabel {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mp-muted);
  margin-bottom: 1px;
  line-height: 0.7;
}

.mp-clink {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--mp-text) !important;
  text-decoration: none !important;
  user-select: text;
  -webkit-user-select: text;
  line-height: 0.7;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
}

.mp-clink:hover {
  color: var(--mp-accent) !important;
  text-decoration: underline !important;
}

.mp-clink-phone {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 0.7;
}

@media (max-width: 859px) {
  .mp-cperson,
  .mp-cname,
  .mp-citem,
  .mp-clabel,
  .mp-clink,
  .mp-clink-phone {
    line-height: 2;
  }
}
