/* ==========================================================================
   Home · Presencia regional + mapa
   Framer: sección 100/72/50 con fondo rgb(10 10 12); fila con gap 60;
   teléfono 70/20 en columna. Mapa: 560px de alto, radio 24px.
   ========================================================================== */

@layer sections {
  .presence {
    position: relative;
    z-index: 3;
    max-width: 1920px;
    margin-inline: auto;
    padding: 70px 20px;
    background-color: rgb(10 10 12);
  }

  .presence__container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 1400px;
    margin-inline: auto;
  }

  .presence__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 24px;
  }

  .presence__badge {
    align-self: flex-start;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid rgb(255 229 0 / 30%);
    border-radius: var(--radius-pill);
    background-color: rgb(255 229 0 / 6%);
    color: var(--color-accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
  }

  .presence__heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .presence__title {
    color: var(--color-text);
    font-size: 26px;
    font-weight: 600;
    line-height: 32px;
    letter-spacing: -1.92px;
  }

  .presence__accent {
    color: var(--color-accent);
    font-family: var(--font-serif);
    font-size: 22px;
    font-style: italic;
    font-weight: 400;
    line-height: 28px;
    letter-spacing: -1.92px;
  }

  .presence__text {
    max-width: 580px;
    color: rgb(255 255 255 / 78%);
    font-size: 15px;
    line-height: 24px;
  }

  .presence__metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .presence__metric {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 12px;
    background-color: rgb(255 255 255 / 2%);
  }

  .presence__metric-value {
    color: var(--color-text);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
  }

  /* La primera cifra va en amarillo, como en Framer */
  .presence__metric:first-child .presence__metric-value {
    color: var(--color-accent);
  }

  .presence__metric-label {
    color: rgb(255 255 255 / 60%);
    font-size: 12px;
    line-height: 1.4;
  }

  .presence__map {
    flex: 1;
    width: 100%;
    max-width: 100%;
  }

  /* --- Mapa --- */
  .regional-map {
    position: relative;
    width: 100%;
    height: 560px;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at 50% 50%, #16161d 0%, #0b0b0e 85%);
    box-shadow: 0 24px 48px -12px rgb(0 0 0 / 70%), inset 0 1px 0 rgb(255 255 255 / 6%);
    user-select: none;
  }

  .regional-map__tiles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .regional-map__tile {
    position: absolute;
    max-width: none;
    opacity: 0.95;
    filter: brightness(0.95) contrast(1.15);
  }

  .regional-map__vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgb(11 11 14 / 0%) 30%, rgb(11 11 14 / 65%) 75%, rgb(11 11 14 / 95%) 100%);
  }

  .regional-map__hubs {
    position: absolute;
    inset: 0;
  }

  .regional-map__hub {
    position: absolute;
    z-index: 10;
    translate: -50% -50%;

    &.is-active {
      z-index: 20;
    }
  }

  .regional-map__marker {
    position: relative;
    display: block;
    width: 10px;
    height: 10px;
    cursor: pointer;
  }

  /* Offsets idénticos al componente original (centrados en la esquina del núcleo) */
  .regional-map__ripple {
    position: absolute;
    top: -18px;
    left: -18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ffc83b;
    opacity: 0.15;
    animation: map-radar 2.8s ease-out infinite;
  }

  .regional-map__ring {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 20px;
    height: 20px;
    border: 1.5px solid #ffc83b;
    border-radius: 50%;
    opacity: 0.5;
    transition: opacity 0.25s ease;
  }

  .regional-map__core {
    position: absolute;
    inset: 0;
    border: 2px solid #0a0a0c;
    border-radius: 50%;
    background-color: #ffc83b;
    box-shadow: 0 0 12px #ffc83b;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .regional-map__label {
    position: absolute;
    top: -14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 100px;
    background-color: rgb(14 14 18 / 80%);
    box-shadow: 0 4px 12px rgb(0 0 0 / 40%);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    transition: all 0.25s ease;
  }

  .regional-map__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ffc83b;
    box-shadow: 0 0 6px #ffc83b;
  }

  .regional-map__name {
    color: rgb(255 255 255 / 80%);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  .regional-map__code {
    color: rgb(255 255 255 / 40%);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .regional-map__hub.is-active {
    .regional-map__ripple {
      opacity: 0.35;
    }

    .regional-map__ring {
      opacity: 0.9;
    }

    .regional-map__core {
      transform: scale(1.25);
    }

    .regional-map__label {
      border-color: #ffc83b;
      background-color: rgb(18 18 24 / 95%);
      box-shadow: 0 8px 20px rgb(0 0 0 / 60%);
      transform: translateY(-2px);
    }

    .regional-map__name {
      color: var(--color-text);
    }

    .regional-map__code {
      color: #ffc83b;
    }
  }

  @keyframes map-radar {
    0%,
    100% {
      transform: scale(0.85);
      opacity: 0.9;
    }

    50% {
      transform: scale(2.2);
      opacity: 0.15;
    }
  }

  .regional-map__controls {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .regional-map__control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 10px;
    background-color: rgb(24 24 30 / 85%);
    color: var(--color-text);
    font-size: 18px;
    font-weight: 700;
    backdrop-filter: blur(8px);
    transition: all 0.15s ease;

    &:hover {
      border-color: rgb(255 255 255 / 30%);
    }
  }

  .regional-map__control--reset {
    color: #ffc83b;
    font-size: 14px;
  }

  .regional-map__credit {
    position: absolute;
    bottom: 10px;
    left: 16px;
    color: rgb(255 255 255 / 35%);
    font-size: 10px;
    letter-spacing: 0.02em;
    pointer-events: none;
  }

  /* --- Tablet --- */
  @media (min-width: 810px) {
    .presence {
      padding: 100px 72px 50px;
    }

    .presence__container {
      flex-direction: row;
      align-items: flex-start;
      gap: 60px;
    }

    .presence__heading {
      gap: 8px;
    }

    .presence__badge {
      padding: 6px 14px;
      font-size: 11px;
      letter-spacing: 0.08em;
    }

    .presence__title {
      font-size: 32px;
      line-height: 38px;
    }

    .presence__accent {
      font-size: 28px;
      line-height: 34px;
    }

    .presence__text {
      font-size: 16px;
      line-height: 26px;
    }

    .presence__metrics {
      flex-direction: row;
      gap: 16px;
    }

    .presence__map {
      max-width: 650px;
    }
  }

  /* --- Desktop --- */
  @media (min-width: 1440px) {
    .presence__title {
      font-size: 48px;
      line-height: 72px;
    }

    .presence__accent {
      font-size: 42px;
      line-height: 50px;
    }
  }
}
