/**
 * Block : Reglementations Map
 * ===========================
 */

.reglementations-map,
.reglementations-map * {
  box-sizing: border-box;
}

.reglementations-map {
  width: 100%;
  height: 500px;          /* hauteur FIXE */
  overflow: hidden;       /* empêche tout dépassement */
}

/* =========================
   Layout global
   ========================= */

.reglementations-map__inner {
  max-width: 1300px;
  margin: 0 auto;
  height: 100%;           /* prend les 500px du bloc */
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  overflow: hidden;
  align-items: stretch;
}

/* IMPORTANT pour éviter les débordements dans grid/flex */
.reglementations-map__map,
.reglementations-map__content {
  min-height: 0;
}

.reglementations-map__continent-filter {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--wp--preset--color--secondary);
  border-radius: 6px;
  background-color: #ffffff;
  font-size: 14px;
  font-family: var(--wp--preset--font-family--mulish);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding-right: 2.5rem;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23f28d27'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 24px;
}

input.reglementations-map__search-input {
  border: 1px solid var(--wp--preset--color--secondary);
  border-radius: 6px;
  background-color: #ffffff;
  font-size: 14px;
  font-family: var(--wp--preset--font-family--mulish);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reglementations-map__continent-filter:focus {
  outline: none;
  border-color: #f28d27;
  box-shadow: 0 0 0 2px rgba(242, 141, 39, 0.2);
}

.reglementations-map__continent-filter:hover {
  border-color: #f28d27;
}

/* =========================
   Colonne gauche : Map
   ========================= */

.reglementations-map__map {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

.reglementations-map__map .world-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.reglementations-map__map svg path {
  cursor: pointer;
}

/* =========================
   Colonne droite : Contenu
   ========================= */

.reglementations-map__content {
  height: 100%;
  min-height: 0; /* essentiel pour que le scroll interne marche */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =========================
   Recherche (sticky)
   ========================= */

.reglementations-map__search {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  padding-bottom: 10px;
}

.reglementations-map__search-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
}

/* =========================
   Bouton reset
   ========================= */

.reglementations-map__reset {
  display: none; /* caché par défaut */
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.reglementations-map__reset.is-visible {
  display: inline-block;
}

.reglementations-map__reset:hover {
  color:rgb(242,141,39);
}


/* =========================
   Liste des pays (scroll)
   ========================= */

.reglementations-map__countries {
  flex: 1;
  min-height: 0;          /* essentiel (sinon ça déborde au lieu de scroller) */
  overflow-y: auto;
  padding-right: 10px;
}

/* =========================
   Scrollbar – Liste des pays
   ========================= */

/* Firefox */
.reglementations-map__countries {
  scrollbar-width: thin;
  scrollbar-color: rgba(242,141,39, 1) transparent;
}

/* Chrome, Edge, Safari */
.reglementations-map__countries::-webkit-scrollbar {
  width: 6px;
}

.reglementations-map__countries::-webkit-scrollbar-track {
  background: transparent;
}

.reglementations-map__countries::-webkit-scrollbar-thumb {
  background-color: rgba(242,141,39, 1);
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.reglementations-map__countries::-webkit-scrollbar-thumb:hover {
  background-color: rgba(242,141,39, 0.55);
}


/* =========================
   Accordéons pays
   ========================= */

.country-accordion {
  border-bottom: 1px solid #ddd;
}

.country-accordion__title {
  width: 100%;
  padding: 12px 30px 12px 0;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}

.country-accordion__title::after {
  content: "⌄"; /* fermé = bas */
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

.country-accordion.is-open .country-accordion__title::after {
  content: "⌃"; /* ouvert = haut */
}

.country-accordion__content {
  display: none;
  padding-bottom: 16px;
}

/* =========================
   Sous-accordéons
   ========================= */

.sub-accordion {
  margin-top: 10px;
}

.sub-accordion__title {
  width: 100%;
  padding: 8px 30px 8px 0;
  font-weight: 600;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}

.sub-accordion__title::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

.sub-accordion.is-open .sub-accordion__title::after {
  content: "-";
}

.sub-accordion__content {
  display: none;
  padding: 8px 0 12px;
}

/* =========================
   Contenu prérequis
   ========================= */

.prerequis-list {
  margin: 0;
  padding-left: 18px;
}

.prerequis-list li {
  margin-bottom: 6px;
}

/* =========================
   Responsive
   ========================= */

@media screen and (max-width: 1024px) {
  .reglementations-map {
    height: auto;
    overflow: visible;
  }

  .reglementations-map__inner {
    height: auto;
    grid-template-columns: 1fr;
  }

  .reglementations-map__map {
    height: 240px; /* pour garder une map lisible en mobile */
  }

  .reglementations-map__countries {
    max-height: 400px;
  }
}
