.af-world-map-wrapper { width: 100%; }

.af-world-map{
  width: 100%;
  min-height: 340px;
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  position: relative;
}

.af-world-map.jvm-container{
  width: 100%;
  min-height: 340px;
  height: 420px;
}

.af-world-map svg{ display:block; }

/* Keep country tooltip above the map surface (never below). */
.af-world-map .jvm-tooltip,
.jvm-tooltip{
  position: absolute;
  z-index: 10000 !important;
  pointer-events: none;
}

.af-world-map__fallback{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#6b7280;
  font-weight:700;
  font-size:14px;
  background:transparent;
  pointer-events:none;
}

/* =========================================================
   Overlay țară (responsive)
   ========================================================= */
.af-romania-overlay,
.af-country-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  /* Must sit above sticky site header */
  z-index: 2000000;
  transition: opacity 0.2s ease;
  padding: 12px;
}
.af-romania-overlay--visible,
.af-country-overlay--visible{ opacity: 1; pointer-events: auto; }

/* Panel: se adaptează la viewport */
.af-romania-panel,
.af-country-panel{
  width: min(980px, 100%);
  height: min(92vh, 820px);
  max-height: min(92vh, 820px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

/* Header */
.af-romania-header,
.af-country-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.af-romania-header h3,
.af-country-header h3{
  margin:0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.2;
}
.af-country-subtitle{
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
}

.af-romania-actions,
.af-country-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.af-romania-all,
.af-country-all{
  background:#2f3542;
  border:none;
  color:#fff;
  border-radius:10px;
  padding:8px 10px;
  font-size:0.9rem;
  cursor:pointer;
  white-space:nowrap;
}
.af-country-back{
  background:#ffffff;
  border:1px solid rgba(15,23,42,0.18);
  color:#0f172a;
  border-radius:10px;
  padding:8px 10px;
  font-size:0.9rem;
  cursor:pointer;
  min-width:44px;
}
.af-romania-all:disabled,
.af-country-all:disabled{ opacity:0.6; cursor:not-allowed; }

.af-romania-close,
.af-country-close{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

/* Conținut */
.af-romania-map-wrap,
.af-country-map-wrap{
  padding: 10px;
  background: #fff;
  height: 100%;
}

.af-romania-leaflet,
.af-country-leaflet{
  width: 100%;
  height: 100%;
  min-height: 280px;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f6fb;
}
.af-country-body{
  display:grid;
  grid-template-columns: minmax(260px, 2fr) minmax(220px, 1fr);
  min-height: 320px;
}
.af-country-list-wrap{
  border-left: 1px solid rgba(0,0,0,0.08);
  padding: 10px;
  background: #fff;
  overflow: auto;
}
.af-country-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.af-country-search-wrap{
  position: sticky;
  top: -2px;
  z-index: 3;
  background: #fff;
  padding-bottom: 6px;
}
.af-country-locality-search{
  width: 100%;
  border: 1px solid rgba(239,68,68,0.65);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}
.af-country-locality-search:focus{
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15);
}
.af-country-list-empty{
  border:1px dashed rgba(100,116,139,0.4);
  border-radius:10px;
  background:#f8fafc;
  color:#64748b;
  padding:12px;
  font-size:13px;
  text-align:center;
}
.af-country-list-item{
  border:1px solid rgba(15,23,42,0.12);
  border-radius:10px;
  background:#f8fafc;
  padding:10px 12px;
  font-weight:700;
  text-align:left;
  cursor:pointer;
}
.af-country-list-item:hover{
  background:#e2e8f0;
}
.af-country-list-item.is-hovered{
  background:#fee2e2;
  border-color:#f87171;
}
.af-country-sublist{
  margin: -4px 0 8px 16px;
  padding-left: 10px;
  border-left: 1px solid rgba(148,163,184,0.35);
  display:flex;
  flex-direction:column;
  gap:6px;
}
.af-country-subgroup{
  border:1px solid rgba(15,23,42,0.08);
  border-radius:10px;
  background:#f8fafc;
  padding:8px;
  margin-bottom:8px;
}
.af-country-subgroup-title{
  font-size:12px;
  font-weight:800;
  color:#334155;
  margin:2px 2px 8px;
}
.af-country-sublist-item{
  border:1px dashed rgba(148,163,184,0.5);
  border-radius:8px;
  background:#ffffff;
  padding:8px 10px;
  font-weight:600;
  font-size:12px;
  text-align:left;
  cursor:pointer;
  color:#334155;
}
.af-country-sublist-item:hover{
  background:#f8fafc;
  border-color:#94a3b8;
}
.af-country-sublist-item.is-hovered{
  background:#dcfce7;
  border-color:#22c55e;
  color:#14532d;
}
.af-country-map-fallback{
  min-height: 280px;
  height: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:8px;
  color:#334155;
  padding:16px;
  background:#f8fafc;
}
.af-country-map-fallback strong{
  font-size:15px;
  line-height:1.35;
}
.af-country-map-fallback span{
  font-size:13px;
  color:#64748b;
}
.af-country-map-fallback__hint{
  margin-top:4px;
  font-size:12px;
  color:#94a3b8;
  max-width: 520px;
  word-break: break-word;
}

/* Leaflet: tooltips/controls responsive */
.leaflet-tooltip{
  font-weight: 700;
  border-radius: 10px;
}

/* =========================================================
   Breakpoints
   ========================================================= */

/* Tablet */
@media (max-width: 1024px){
  .af-romania-panel,
  .af-country-panel{
    width: min(920px, 100%);
    max-height: 92vh;
  }
  .af-country-body{
    grid-template-columns: 1fr;
  }
  .af-country-list-wrap{
    border-left: 0;
    border-top: 1px solid rgba(0,0,0,0.08);
    max-height: 40vh;
  }
}

/* Mobile */
@media (max-width: 640px){
  .af-world-map{
    border-radius: 10px;
    min-height: 240px;
  }

  .af-romania-overlay,
  .af-country-overlay{
    padding: 8px;
  }

  .af-romania-panel,
  .af-country-panel{
    border-radius: 12px;
    max-height: 95vh;
  }

  .af-romania-header,
  .af-country-header{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .af-romania-actions,
  .af-country-actions{
    justify-content: space-between;
  }

  .af-romania-all,
  .af-country-all{
    flex: 1;
    text-align:center;
  }
}
