/* ARPOZ Selecta V2.1 — cartes géographiques
   Feuille consolidée : une seule règle par composant et par thème. */

/* Carte intégrée à la colonne latérale */
.arpoz-geography-map {
  box-sizing: border-box;
  margin: 0 0 22px;
  padding: 0 14px 14px;
  color: #f5f7f8;
  background: #15191d;
  border: 1px solid #343b42;
  border-radius: 8px;
}

/* Têtière */
.arpoz-geography-map .arpoz-geography-map__heading {
  box-sizing: border-box;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
  height: auto;
  margin: 0 -14px 18px;
  padding: 12px 14px 12px 32px;
  background: #292b2f;
  border: 0;
  border-bottom: 1px solid #3b3d40;
  border-radius: 7px 7px 0 0;
}

.arpoz-geography-map .arpoz-geography-map__heading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  width: 4px;
  height: 18px;
  margin: 0;
  transform: translateY(-50%);
  background: #289dcc;
}

.arpoz-geography-map .arpoz-geography-map__heading h3 {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #f5f7f8;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.arpoz-geography-map .arpoz-geography-map__expand {
  flex: 0 0 auto;
  margin: 0 0 0 8px;
}

/* Boutons de carte et de modal */
.arpoz-geography-map__expand,
.arpoz-geography-map__control,
.arpoz-geography-map__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  color: #fff;
  background: #222a31;
  border: 1px solid #5b6670;
  border-radius: 5px;
  cursor: pointer;
}

.arpoz-geography-map__expand:hover,
.arpoz-geography-map__control:hover,
.arpoz-geography-map__close:hover {
  color: #fff;
  background: #289dcc;
}

/* Vue SVG dans la carte */
.arpoz-geography-map__viewport {
  width: 100%;
  overflow: hidden;
  background: #343a3f;
  border-radius: 4px;
  line-height: 0;
}

.arpoz-geography-map__viewport svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 270px;
}

.arpoz-geography-map__viewport svg path[data-arpoz-zone],
.arpoz-map-modal__viewport svg path[data-arpoz-zone] {
  fill: #d7dce0;
  stroke: #59636c;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  transition: fill .15s ease, opacity .15s ease;
}

.arpoz-geography-map__viewport svg path[data-arpoz-zone].is-clickable {
  cursor: pointer;
  pointer-events: all;
}

.arpoz-geography-map__viewport svg path[data-arpoz-zone].is-clickable:hover,
.arpoz-map-modal__viewport svg path[data-arpoz-zone].is-clickable:hover {
  fill: #7bc6e2;
}

.arpoz-geography-map__viewport svg path[data-arpoz-zone].is-active,
.arpoz-map-modal__viewport svg path[data-arpoz-zone].is-active {
  fill: #289dcc !important;
  stroke: #fff;
  stroke-width: 1.8;
}

.arpoz-geography-map__hint {
  margin: 8px 0 0;
  color: #b8c0c7;
  font-size: 11px;
  line-height: 1.4;
}

/* Modal de carte agrandie */
.arpoz-map-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 12, .88);
}

.arpoz-map-modal.is-open {
  display: flex;
}

.arpoz-map-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1200px, 96vw);
  height: min(900px, 92vh);
  padding: 16px;
  background: #15191d;
  border: 1px solid #4b555e;
  border-radius: 10px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .45);
}

.arpoz-map-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: #f5f7f8;
}

.arpoz-map-modal__header h2 {
  margin: 0;
  color: inherit;
  font-size: 20px;
}

.arpoz-map-modal__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.arpoz-map-modal__viewport {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  background: #343a3f;
  border-radius: 5px;
  touch-action: none;
  cursor: grab;
}

.arpoz-map-modal__viewport.is-dragging,
.arpoz-map-modal__viewport.is-dragging svg path[data-arpoz-zone].is-clickable {
  cursor: grabbing !important;
}

.arpoz-map-modal__viewport svg {
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
}

.arpoz-map-modal__viewport svg path[data-arpoz-zone].is-clickable {
  cursor: pointer;
}

.arpoz-map-modal__footer {
  margin: 10px 0 0;
  color: #c2c9cf;
  font-size: 12px;
}

/* Thème clair */
html[data-arpoz-theme="light"] .arpoz-geography-map {
  color: #111;
  background: #f7f7f7;
  border-color: #d0d0d0;
}

html[data-arpoz-theme="light"] .arpoz-geography-map .arpoz-geography-map__heading {
  background: #ededed;
  border-bottom-color: #d0d0d0;
}

html[data-arpoz-theme="light"] .arpoz-geography-map .arpoz-geography-map__heading h3 {
  color: #111;
}

html[data-arpoz-theme="light"] .arpoz-geography-map__viewport,
html[data-arpoz-theme="light"] .arpoz-map-modal__viewport {
  background: #fdfdfd;
}

html[data-arpoz-theme="light"] .arpoz-geography-map__viewport svg > rect,
html[data-arpoz-theme="light"] .arpoz-map-modal__viewport svg > rect {
  fill: #fdfdfd !important;
}

html[data-arpoz-theme="light"] .arpoz-geography-map__hint,
html[data-arpoz-theme="light"] .arpoz-map-modal__footer {
  color: #59636c;
}

html[data-arpoz-theme="light"] .arpoz-map-modal__dialog {
  background: #f1f3f5;
  border-color: #d3d9de;
}

html[data-arpoz-theme="light"] .arpoz-map-modal__header,
html[data-arpoz-theme="light"] .arpoz-map-modal__header h2 {
  color: #20262b;
}

html[data-arpoz-theme="light"] .arpoz-geography-map__expand,
html[data-arpoz-theme="light"] .arpoz-map-modal__control,
html[data-arpoz-theme="light"] .arpoz-map-modal__close {
  color: #20262b;
  background: #e5e8eb;
  border-color: #cbd2d8;
}

html[data-arpoz-theme="light"] .arpoz-geography-map__expand:hover,
html[data-arpoz-theme="light"] .arpoz-map-modal__control:hover,
html[data-arpoz-theme="light"] .arpoz-map-modal__close:hover {
  color: #fff;
  background: #289dcc;
}

/* Thème sombre : la têtière doit affleurer le haut de la carte, comme en clair. */
html[data-arpoz-theme="dark"] .arpoz-geography-map {
  padding-top: 0;
  color: #f5f5f5;
  background: #202124;
  border-color: #3b3d40;
}

html[data-arpoz-theme="dark"] .arpoz-geography-map .arpoz-geography-map__heading {
  background: #292b2f;
  border-bottom-color: #3b3d40;
}

html[data-arpoz-theme="dark"] .arpoz-geography-map .arpoz-geography-map__heading h3 {
  color: #f5f5f5;
}

html[data-arpoz-theme="dark"] .arpoz-geography-map__viewport,
html[data-arpoz-theme="dark"] .arpoz-map-modal__viewport {
  background: #343a3f;
}

html[data-arpoz-theme="dark"] .arpoz-geography-map__viewport svg > rect,
html[data-arpoz-theme="dark"] .arpoz-map-modal__viewport svg > rect {
  fill: #343a3f !important;
}

html[data-arpoz-theme="dark"] .arpoz-geography-map__hint {
  color: #b8c0c7;
}

html[data-arpoz-theme="dark"] .arpoz-map-modal__dialog {
  background: #15191d;
  border-color: #4b555e;
}

html[data-arpoz-theme="dark"] .arpoz-map-modal__header,
html[data-arpoz-theme="dark"] .arpoz-map-modal__header h2 {
  color: #f5f7f8;
}

html[data-arpoz-theme="dark"] .arpoz-map-modal__footer {
  color: #c2c9cf;
}

/* Responsive */
@media (max-width: 767px) {
  .arpoz-geography-map {
    padding-right: 11px;
    padding-bottom: 11px;
    padding-left: 11px;
  }

  .arpoz-geography-map .arpoz-geography-map__heading {
    margin-right: -11px;
    margin-left: -11px;
  }

  .arpoz-map-modal {
    padding: 8px;
  }

  .arpoz-map-modal__dialog {
    width: 100%;
    height: 94vh;
    padding: 10px;
  }

  .arpoz-map-modal__header h2 {
    font-size: 17px;
  }
}
