/*
 * D2P Mapa – Regionalna pokrivenost
 * Leaflet-based interactive map + sidebar.
 * Scopovano na .d2p-mapa-wrap da nema konflikta sa WP/Elementor stilovima.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

.d2p-mapa-wrap *,
.d2p-mapa-wrap *::before,
.d2p-mapa-wrap *::after {
  box-sizing: border-box;
}

.d2p-mapa-wrap {
  font-family: 'DM Sans', sans-serif;
  color: #2c2c2a;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.d2p-mapa-section-title {
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 4px;
  color: #3a3a38;
  margin: 0 0 32px;
}

.d2p-mapa-container {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 24px rgba(0,0,0,0.07);
  background: #fff;
  min-height: 560px;
}

.d2p-mapa-side {
  flex: 1;
  min-width: 0;
  position: relative;
}

#d2p-map {
  width: 100%;
  height: 100%;
  min-height: 560px;
}

.d2p-mapa-wrap .leaflet-container {
  background: #eef1f3 !important;
}

.d2p-mapa-wrap .leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.75) !important;
  color: #666 !important;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.d2p-mapa-wrap .leaflet-control-attribution a {
  color: #789B9E !important;
}

.d2p-mapa-sidebar {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid #e8e6e1;
  overflow-y: auto;
  max-height: 560px;
  background: #fff;
}

.d2p-mapa-sidebar::-webkit-scrollbar { width: 4px; }
.d2p-mapa-sidebar::-webkit-scrollbar-track { background: transparent; }
.d2p-mapa-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.d2p-country-item { border-bottom: 1px solid #f0eeea; }
.d2p-country-item:last-child { border-bottom: none; }

.d2p-country-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.8px;
  color: #3a3a38;
  user-select: none;
}

.d2p-country-header:hover { background: #f9f9f7; }
.d2p-country-header.active { color: #789B9E; }

.d2p-chevron {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.d2p-chevron svg {
  width: 14px;
  height: 14px;
  stroke: #aaa;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}

.d2p-country-header.active .d2p-chevron { transform: rotate(180deg); }
.d2p-country-header.active .d2p-chevron svg { stroke: #789B9E; }

.d2p-country-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 24px;
}

.d2p-country-body.open {
  max-height: 150px;
  padding: 0 24px 18px;
}

.d2p-firm-name {
  font-size: 14px;
  font-weight: 500;
  color: #3a3a38;
  margin-bottom: 4px;
}

.d2p-firm-link {
  display: block;
  font-size: 13px;
  color: #789B9E;
  text-decoration: none;
  transition: color 0.15s;
}

.d2p-firm-email {
  margin-top: 2px;
}

.d2p-firm-link:hover {
  color: #5a7d80;
  text-decoration: underline;
}

.d2p-mapa-wrap .d2p-custom-tip {
  background: #fff !important;
  border: 1px solid #ddd !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.8px !important;
  color: #3a3a38 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.d2p-mapa-wrap .d2p-custom-tip::before {
  border-top-color: #fff !important;
}

@media (max-width: 768px) {
  .d2p-mapa-container {
    flex-direction: column;
    min-height: auto;
  }
  .d2p-mapa-sidebar {
    width: 100%;
    max-height: 300px;
    border-left: none;
    border-top: 1px solid #e8e6e1;
  }
  #d2p-map { min-height: 360px; }
}

/* ─── Region map (d2p_mapa_region shortcode) – bez sidebar-a ────────── */

#d2p-map-region {
  width: 100%;
  height: 100%;
  min-height: 520px;
}

@media (max-width: 768px) {
  #d2p-map-region { min-height: 360px; }
}
