/* ONE PLUS — right-side section scroll spy (desktop + mobile) */

.op-scroll-spy {
  --op-spy-grad: linear-gradient(91.91deg, #092b96 0%, #086cdc 100%);
  --op-spy-blue: #086cdc;
  --op-spy-navy: #092b96;
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 7px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(8, 108, 220, 0.16);
  box-shadow: 0 8px 28px rgba(9, 43, 150, 0.1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.op-scroll-spy.is-hidden {
  opacity: 0;
  transform: translateY(-50%) translateX(14px);
  pointer-events: none;
}

.op-scroll-spy__dot {
  position: relative;
  width: 10px;
  height: 10px;
  border: none;
  padding: 0;
  border-radius: 50%;
  background: rgba(9, 43, 150, 0.18);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.op-scroll-spy__dot.is-active {
  background: var(--op-spy-grad);
  transform: scale(1.2);
  box-shadow: 0 0 0 3px rgba(8, 108, 220, 0.22);
}

.op-scroll-spy__dot::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  font-family: Gilroy, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: #131313;
  background: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(8, 108, 220, 0.14);
  box-shadow: 0 8px 22px rgba(9, 43, 150, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.op-scroll-spy__dot:hover::after,
.op-scroll-spy__dot:focus-visible::after,
.op-scroll-spy__dot.is-active::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.op-scroll-spy__dot:focus-visible {
  outline: 2px solid var(--op-spy-blue);
  outline-offset: 3px;
}

/* Anchor offset under sticky header */
[data-op-scroll-section] {
  scroll-margin-top: 96px;
}

@media (max-width: 1024px) {
  .op-scroll-spy {
    right: max(8px, env(safe-area-inset-right, 0px));
    gap: 8px;
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.9);
  }

  .op-scroll-spy__dot {
    width: 9px;
    height: 9px;
  }

  .op-scroll-spy__dot.is-active {
    transform: scale(1.15);
  }

  /* Touch: only the active section label (no hover). Keep it short. */
  .op-scroll-spy__dot::after {
    right: calc(100% + 8px);
    max-width: min(46vw, 148px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    padding: 5px 9px;
    border-radius: 8px;
  }

  .op-scroll-spy__dot:hover::after {
    opacity: 0;
    transform: translateY(-50%) translateX(6px);
  }

  .op-scroll-spy__dot.is-active::after,
  .op-scroll-spy__dot:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  [data-op-scroll-section] {
    scroll-margin-top: 72px;
  }
}

@media (max-width: 480px) {
  .op-scroll-spy {
    right: max(6px, env(safe-area-inset-right, 0px));
    gap: 7px;
    padding: 9px 5px;
  }

  .op-scroll-spy__dot::after {
    max-width: min(42vw, 128px);
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .op-scroll-spy,
  .op-scroll-spy__dot,
  .op-scroll-spy__dot::after {
    transition: none;
  }
}
