/* Raíces: barra lateral de los 5 grandes territorios (de norte a sur) */
body.pagina-raices { height: auto; overflow-x: hidden; overflow-y: visible; justify-content: flex-start; }
.raices {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  padding: clamp(18px, 3vh, 32px) clamp(16px, 3vw, 40px) 0;
  min-height: 0;
}
.raices main { flex: 1; min-width: 0; align-self: stretch; }
.raices .rueda { position: relative; display: block; width: min(100%, 820px, calc(100vh - 220px)); width: min(100%, 820px, calc(100dvh - 220px)); }
.raices .rueda .territorios { width: 100%; height: auto; }
.raices .pronto { margin-top: clamp(10px, 2vh, 20px); }

.territorios-nav {
  flex: none;
  width: 310px;
  box-sizing: border-box;
  padding: 22px 18px 18px;
  border-radius: 22px;
  background: rgba(251, 244, 230, 0.62);
  box-shadow: inset 0 0 0 1px rgba(201, 138, 34, 0.55), inset 0 0 0 5px rgba(251, 244, 230, 0.7), inset 0 0 0 6px rgba(201, 138, 34, 0.3), 0 14px 30px -14px rgba(62, 33, 23, 0.45);
  animation: aparecer 1.6s ease-out 0.3s both;
}
.territorios-nav h2 {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  color: #A8432A;
}
.territorios-nav h2::before, .territorios-nav h2::after {
  content: "";
  width: 7px;
  height: 7px;
  background: #C98A22;
  transform: rotate(45deg);
}
.territorios-lista {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.territorios-lista a {
  --c: #A8432A;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  box-sizing: border-box;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: #FBF4E6;
  color: #3E2117;
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(110, 81, 65, 0.16), 0 4px 10px -6px rgba(62, 33, 23, 0.4);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.territorios-lista .nombre { flex: 1; text-wrap: balance; }
.territorios-lista .insignia {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c);
  color: #FBF4E6;
  box-shadow: inset 0 0 0 2px rgba(251, 244, 230, 0.3), 0 3px 8px -3px rgba(62, 33, 23, 0.5);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.territorios-lista svg { width: 28px; height: 28px; fill: currentColor; }
.territorios-lista svg .collar { fill: currentColor; stroke: var(--c); stroke-width: 0.5; }
.territorios-lista a:hover, .territorios-lista a:focus-visible {
  transform: translateX(3px);
  box-shadow: inset 0 0 0 1px rgba(110, 81, 65, 0.22), 0 8px 16px -8px rgba(62, 33, 23, 0.5);
}
.territorios-lista a:focus-visible { outline: 2px solid #3E2117; outline-offset: 3px; }
.territorios-lista a[aria-current="true"] { background: var(--c); color: #FBF4E6; }
.territorios-lista a[aria-current="true"] .insignia { background: #FBF4E6; color: var(--c); }
.territorios-lista a[aria-current="true"] svg .collar { stroke: #FBF4E6; }
.territorios-lista .t-norte { --c: #6E4A2E; }
.territorios-lista .t-meso { --c: #1F6F5C; }
.territorios-lista .t-andes { --c: #A8432A; }
.territorios-lista .t-amazonia { --c: #4F6B2A; }
.territorios-lista .t-patagonia { --c: #3D5A6C; }

/* Animación de los territorios en la imagen */
.rueda-capa { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.rueda-capa .area { fill: transparent; pointer-events: all; cursor: pointer; }
.rueda-capa .velo { fill: #2A160E; opacity: 0; transition: opacity 0.35s ease; }
.rueda[data-activo] .rueda-capa .velo { opacity: 0.42; }
.rueda-capa .zona { opacity: 0; transform-box: view-box; transform-origin: 627px 627px; transform: scale(1); transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.2,.8,.2,1.2), filter 0.35s ease; }
.rueda-capa .zona.activa { opacity: 1; transform: scale(1.045); filter: drop-shadow(0 10px 18px rgba(42, 22, 14, 0.55)) saturate(1.15) brightness(1.06); }
.rueda-capa .fx { display: none; }
.rueda-capa .zona.activa .fx { display: inline; }
.copo { fill: #FFFFFF; opacity: 0.95; filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)); animation: caer linear infinite; }
@keyframes caer { from { transform: translate(0, 0); } to { transform: translate(var(--dx), var(--dy)); } }
.sol .rayos polygon { fill: #FFD36B; opacity: 0.55; }
.sol .rayos { animation: girar 14s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.halo { transform-box: fill-box; transform-origin: center; animation: latir-sol 2.6s ease-in-out infinite; }
@keyframes latir-sol { 0%, 100% { opacity: 0.55; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.12); } }
.brillo { mix-blend-mode: screen; animation: recorrer 3.2s ease-in-out infinite; }
@keyframes recorrer { 0% { transform: translateX(0); } 70%, 100% { transform: translateX(1100px); } }
.luciernaga { fill: #FAF89A; filter: drop-shadow(0 0 10px #E6F25A) drop-shadow(0 0 4px #FFFFFF); animation: flotar ease-in-out infinite alternate; }
@keyframes flotar { 0% { transform: translate(0, 0); opacity: 0.1; } 50% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0.2; } }
.llamarada { mix-blend-mode: screen; animation: titilar 1.3s steps(1) infinite; }
@keyframes titilar { 0% { opacity: 0.55; } 18% { opacity: 0.9; } 32% { opacity: 0.6; } 51% { opacity: 1; } 67% { opacity: 0.7; } 83% { opacity: 0.95; } }
.brasa { fill: #FFF1C2; filter: drop-shadow(0 0 6px #FF5A00) drop-shadow(0 0 12px #FF8A00); animation: subir ease-out infinite; }
@keyframes subir { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

@media (max-width: 900px) {
  .raices { flex: none; flex-direction: column; align-items: center; gap: 18px; }
  .raices main { flex: none; min-height: auto; justify-content: flex-start; align-self: center; width: 100%; }
  .territorios-nav { width: 100%; max-width: 440px; }
  .raices .rueda { width: min(100%, 520px); }
}
@media (prefers-reduced-motion: reduce) {
  .territorios-nav { animation: none; }
  .territorios-lista a, .territorios-lista .insignia, .rueda-capa .zona, .rueda-capa .velo { transition: none; }
  .territorios-lista a:hover, .territorios-lista a:focus-visible { transform: none; }
}
