:root {
  --map-latam: hsl(210, 70%, 55%);
  --map-europe: hsl(30, 100%, 60%);
  --map-northam: hsl(345, 85%, 60%);
  --map-med-oriente: hsl(185, 65%, 45%);
  --map-stroke: var(--linea-color, #ccc);
}

.map-wrapper {
  width: 100%;
  background: #fff;
  border-top: 1px solid var(--linea-color);
  padding: 0;
  margin: 0;
}

.map-container {
  position: relative;
  display: flex;
  width: 100%;
  /* min-height: 500px; */
  height: 100dvh;
  overflow: hidden;
  background-image: url(../../media/img/comunes/loading_imagenes.gif) center center no-repeat;
}

/* Estado cuando un país está enfocado */
.map-zoomed {
  cursor: zoom-out;
}

#world-map {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1); /* Movimiento no lineal */
  transform-origin: 0 0;
}

/* FILTROS */
#seccion_filtros {
  border-top: 1px dashed #ccc;
  padding: 18px 0 0;
}

.tri_state_toggle {
  display: flex;
  position: relative;
  background: #e9e9ea;
  border-radius: 30px;
  padding: 2px;
  width: 100%;
  margin: 10px 0 20px;
}

.tri_state_toggle input {
  display: none; /* Ocultamos los radios reales */
}

.tri_state_toggle label {
  flex: 1;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 5px 0;
  cursor: pointer;
  z-index: 2;
  transition: color 0.3s;
  color: #999;
}

/* Color del texto cuando está activo */
.tri_state_toggle input:checked + label {
  color: #fff;
}

/* El Slider (la pastilla) */
.toggle-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 5px 0;
  width: 33.34%;
  width: calc(33% - 1px);
  background: var(--sistema-color);
  border-radius: 18px;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Posiciones del Slider */
#ambos:checked ~ .toggle-slider {
  transform: translateX(0);
}
#solo-arte:checked ~ .toggle-slider {
  transform: translateX(100%);
}
#solo-otros:checked ~ .toggle-slider {
  transform: translateX(203%);
}

.menu_linea_opcion {
  display: flex;
  padding-left: 0;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  text-transform: initial;
}

.menu_linea_opcion::before {
  content: "";
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid #ccc;
  transition: all 0.2s ease;
}

.filter-region {
  position: absolute;
  opacity: 0;
}

/* ---PAISES VISITADOS ---- */

path {
  fill: #aaa;
  opacity: 0.3;
  transition:
    opacity 0.5s ease,
    fill 0.3s ease;
}
/* NO visitados */
path:not([class*="visited"]) {
  opacity: 0.3;
}

/* ---PAISES VISITADOS ---- */

path.reg-latam {
  fill: var(--map-latam);
}

path.reg-europe {
  fill: var(--map-europe);
}

path.reg-northam {
  fill: var(--map-northam);
}

path.reg-middleeast {
  fill: var(--map-med-oriente);
}

path.visited {
  cursor: pointer;
  transition:
    fill 0.4s ease,
    opacity 0.4s ease,
    stroke 0.4s ease;
  stroke: var(--map-stroke);
  stroke-width: 0.5px;
}
/* Hover con tu color de sistema */
path.visited:hover {
  opacity: 1 !important;
  cursor: pointer;
}

/* Cuando un país tiene el foco, los demás se apagan */
path.dimmed-zoom {
  filter: grayscale(1);
  fill: #aaa;
}

path.active-focus {
  opacity: 1 !important;
  stroke: var(--sistema-color);
  stroke-width: 1px;
}

/* INFO */
/* Contenedor de info que aparece al interactuar */

#info-box {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 280px;
  background: rgba(255, 255, 255, 0.9); /* Opacidad que pediste */
  backdrop-filter: blur(8px); /* Efecto moderno de desenfoque */
  border: 1px solid var(--linea-color);
  padding: 20px;
  box-shadow: 8px 8px 0px var(--sistema-color); /* Sombra sólida estilo Diego */
  z-index: 100;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Noto Sans", sans-serif;
}

.info-box-hidden {
  opacity: 0;
  transform: translateX(50px);
  pointer-events: none;
}

#info-box h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--texto-principal);
  border-bottom: 1px solid var(--linea-color);
  padding-bottom: 10px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 0.9rem;
}

.btn_cerrar {
  position: absolute;
  top: 5px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--linea-color);
}

/* Tooltip minimalista Diego Baigorri */
.map-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  background: #1a1a1a; /* Fondo oscuro Chiaroscuro */
  color: #fff;
  padding: 6px 12px;
  font-family: "Noto Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 1000;
  border-left: 3px solid var(--sistema-color); /* Acento de color */
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

.map-tooltip span {
  margin-left: 8px;
  color: var(--sistema-color);
  font-weight: 900;
}

/* Estilo para simular radio button con tu estética */
.menu_linea_radio {
  position: absolute;
  top: 0;
  left: 0;
  height: 1.2em;
  width: 1.2em;
  background-color: #eee;
  border-radius: 50%; /* Círculo para radio */
  border: 1px solid #ccc;
}

.menu_linea_opcion input:checked ~ .menu_linea_radio {
  background-color: var(--sistema-color);
  border-color: var(--sistema-color);
}

/* Punto blanco central del radio activo */
.menu_linea_radio:after {
  content: "";
  position: absolute;
  display: none;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}

.menu_linea_opcion input:checked ~ .menu_linea_radio:after {
  display: block;
}

/* 3. Colores por región usando value */

/* LATAM */
.menu_linea_opcion:has(.filter-region[value="latam"]:checked)::before {
  background: var(--map-latam);
  border-color: var(--map-latam);
}

/* EUROPE */
.menu_linea_opcion:has(.filter-region[value="europe"]:checked)::before {
  background: var(--map-europe);
  border-color: var(--map-europe);
}

/* NORTHAM */
.menu_linea_opcion:has(.filter-region[value="northam"]:checked)::before {
  background: var(--map-northam);
  border-color: var(--map-northam);
}

/* MIDDLE EAST */
.menu_linea_opcion:has(.filter-region[value="middleeast"]:checked)::before {
  background: var(--map-med-oriente);
  border-color: var(--map-med-oriente);
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */

@media only screen and (max-device-width: 480px) {
  body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
  }
  .contenido {
    padding: 0;
  }
  .mvl_titulo {
    top: 0;
    position: sticky;
  }
  #info-box {
    top: 15px;
  }
  .menu_linea .enlace_idioma {
    top: 0;
  }
  .menu_linea {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 40dvh;
    margin-bottom: 5dvh;
    max-height: none;
    padding: 25px;
    visibility: visible;
    overflow: scroll;
    box-shadow: 0 -7px 15px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }
  #svg-wrapper,
  .map-container {
    min-height: 350px;
    height: 50dvh;
  }
}
