/* Países: globo WebGL (cobe) + banderas. Azul marino para que el globo brille. */
.world { position: relative; overflow: hidden; isolation: isolate; color: #C9D6EE; background: var(--navy); padding: clamp(80px, 10vw, 128px) 0; }
.world__bg { position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(45% 60% at 78% 50%, rgba(0,104,232,.42), transparent 70%),
  radial-gradient(35% 50% at 8% 0%, rgba(0,104,232,.22), transparent 70%),
  linear-gradient(180deg, #06173E 0%, var(--navy) 50%, #061536 100%); }
.world__bg::after { /* rejilla muy tenue */
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 70% at 70% 50%, #000, transparent); mask-image: radial-gradient(70% 70% at 70% 50%, #000, transparent); }
.world__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.world h2 { color: #fff; font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
.world__lead { font-size: 1.1rem; max-width: 460px; margin-bottom: 28px; }

/* banderas */
.countries { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.country {
  position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 10px 12px; text-align: left; font: inherit; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.10); border-radius: 12px;
  transition: background-color .2s, border-color .2s, transform .25s var(--ease), box-shadow .25s;
}
.country:hover { background: rgba(255,255,255,.09); border-color: rgba(142,196,255,.45); transform: translateY(-2px); }
.country:focus-visible { outline: 3px solid #8EC4FF; outline-offset: 2px; }
.country[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--navy); box-shadow: 0 12px 30px -12px rgba(0,104,232,.9), 0 0 0 4px rgba(0,104,232,.35); }
.country__flag { grid-row: 1 / 3; position: relative; display: block; width: 36px; height: 24px; border-radius: 5px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 4px 10px -4px rgba(0,0,0,.6); transform: perspective(120px) rotateY(0); transition: transform .45s var(--ease); }
.country__flag svg { display: block; width: 100%; height: 100%; }
.country__flag::after { /* brillo que barre la bandera */
  content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%);
  transform: translateX(-120%); transition: transform .7s var(--ease); }
.country:hover .country__flag, .country[aria-pressed="true"] .country__flag { transform: perspective(120px) rotateY(-14deg) scale(1.06); }
.country:hover .country__flag::after, .country[aria-pressed="true"] .country__flag::after { transform: translateX(120%); }
.country__name { font-weight: 650; font-size: .98rem; line-height: 1.2; }
.country__status { font-size: .76rem; color: #9FB2D3; line-height: 1.3; }
.country.is-active .country__status { color: #7EE2A8; }
.country.is-active .country__status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 3px rgba(61,220,132,.2); vertical-align: 1px; }
.country[aria-pressed="true"] .country__status { color: var(--ink-2); }
.country.is-active[aria-pressed="true"] .country__status { color: var(--green-ink); }

/* escenario del globo */
.world__stage { position: relative; }
.globe { position: relative; width: 100%; max-width: 620px; aspect-ratio: 1; margin: 0 auto; opacity: 0; transform: scale(.92); transition: opacity 1.1s var(--ease), transform 1.4s var(--ease); cursor: grab; touch-action: pan-y; }
.globe.is-ready { opacity: 1; transform: none; }
.globe.is-dragging { cursor: grabbing; }
.globe__canvas { width: 100%; height: 100%; display: block; contain: layout paint size; }
/* pin con la bandera en el punto que mira al frente */
.globe__pin { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.globe__flag { position: absolute; left: 0; top: -52px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50% 50% 50% 6px; transform: translateY(-6px) rotate(-45deg) scale(0); transform-origin: 0% 100%;
  background: #fff; box-shadow: 0 14px 30px -8px rgba(0,0,0,.55), 0 0 0 4px rgba(255,255,255,.18); transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.globe__flag svg { width: 30px; height: 20px; border-radius: 3px; transform: rotate(45deg); box-shadow: 0 0 0 1px rgba(7,27,72,.12); }
.globe__pin.is-landed .globe__flag { transform: translateY(-6px) rotate(-45deg) scale(1); }
.globe__pulse { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #8EC4FF; opacity: 0; }
.globe__pin.is-landed .globe__pulse { animation: globe-pulse 2.4s ease-out infinite; }
.globe__pin.is-landed .globe__pulse--2 { animation-delay: 1.2s; }
@keyframes globe-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(4.2); opacity: 0; } }

/* ficha del país */
.world__card { position: relative; z-index: 2; display: flex; gap: 16px; align-items: center; max-width: 440px; margin: -40px auto 0; padding: 16px 20px;
  border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); box-shadow: 0 20px 40px -24px rgba(0,0,0,.6); }
.world__card.is-swapping > * { animation: card-in .45s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.world__card-flag { flex: none; width: 54px; height: 36px; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.2); }
.world__card-flag svg { width: 100%; height: 100%; display: block; }
.world__card h3 { color: #fff; font-size: 1.2rem; margin: 0 0 2px; }
.world__card-status { margin: 0 0 2px; font-size: .78rem; font-weight: 700; color: #9FB2D3; }
.world__card-status.is-active { color: #7EE2A8; }
.world__card-partner { margin: 0; font-size: .95rem; color: #DCE6F7; }
.world__card-tel { display: inline-block; margin-top: 4px; font-weight: 650; color: #8EC4FF; }
.world__card-tel:hover { color: #fff; }
.world__card-tel:focus-visible { outline-color: #8EC4FF; }

/* sin WebGL: banderas y ficha, sin globo */
.world.no-globe .globe { display: none; }
.world.no-globe .world__card { margin-top: 0; }

@media (max-width: 960px) {
  .world__grid { grid-template-columns: 1fr; }
  .world__stage { order: -1; }
  .globe { max-width: 480px; }
}
@media (max-width: 760px) {
  /* globo y ficha arriba; banderas en una tira deslizable debajo, todo en una pantalla */
  .world__copy { display: contents; }
  .world__grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .world__grid > * { min-width: 0; }
  .world h2 { order: 1; }
  .world__lead { order: 2; margin-bottom: 8px; }
  .world__stage { order: 3; }
  .countries { order: 4; min-width: 0; display: flex; gap: 8px; margin: 18px calc(var(--gutter) * -1) 0; padding: 4px var(--gutter) 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
            mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent); }
  .countries::-webkit-scrollbar { display: none; }
  .countries li { flex: 0 0 auto; scroll-snap-align: start; }
  .country { width: auto; min-width: 148px; padding: 9px 12px; column-gap: 10px; }
  .country:hover { transform: none; }
  .country__flag { width: 30px; height: 20px; }
  .country__name { font-size: .92rem; white-space: nowrap; }
  .country__status { white-space: nowrap; }
  .globe { max-width: 340px; }
  .world__card { margin-top: -18px; }
}
@media (prefers-reduced-motion: reduce) {
  .globe { transition: none; transform: none; }
  .globe__pin.is-landed .globe__pulse { animation: none; opacity: .5; transform: scale(2); }
  .country, .country__flag, .country__flag::after { transition: none; }
}

/* ver más países */
.world.is-collapsed .country-more { display: none; }
.world.is-open .country-more { animation: country-in .4s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes country-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.countries-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.countries-foot[hidden] { display: none; }
.countries-foot__sum { margin: 0; font-size: .85rem; color: #9FB2D3; }
.countries-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 999px; font: inherit; font-size: .92rem; font-weight: 650; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(142,196,255,.4); transition: background-color .2s, border-color .2s; }
.countries-toggle:hover { background: rgba(255,255,255,.14); border-color: #8EC4FF; }
.countries-toggle:focus-visible { outline: 3px solid #8EC4FF; outline-offset: 2px; }
.countries-toggle > svg { width: 12px; height: 12px; fill: none; stroke: #8EC4FF; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.countries-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
.countries-toggle__flags { display: inline-flex; }
.countries-toggle__flags i { display: block; width: 26px; height: 18px; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 2px var(--navy); }
.countries-toggle__flags i + i { margin-left: -8px; }
.countries-toggle__flags svg { display: block; width: 100%; height: 100%; }
.countries-toggle[aria-expanded="true"] .countries-toggle__flags { display: none; }
@media (max-width: 760px) {
  .world.is-collapsed .country-more { display: list-item; list-style: none; }
  .countries-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .world.is-open .country-more { animation: none; }
  .countries-toggle > svg { transition: none; }
}
