/* BustoBus V22s — marker posizione con orientamento.
   Additivo: non modifica il layout Leaflet né l'anchor geografico esistente. */
.posizione-utente-marker {
  background: transparent !important;
  border: 0 !important;
  overflow: visible !important;
}

.posizione-utente-visual {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 34px !important;
  height: 34px !important;
  transform: translate(-50%, -50%) !important;
  display: grid !important;
  place-items: center !important;
  overflow: visible !important;
  filter: drop-shadow(0 5px 10px rgba(15, 23, 42, 0.12));
  isolation: isolate;
  --bb-user-heading: 0deg;
}

/* Cono direzionale: compare solo quando il browser fornisce un nord affidabile. */
.posizione-utente-visual::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 28px;
  height: 38px;
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(var(--bb-user-heading));
  clip-path: polygon(50% 0%, 92% 100%, 8% 100%);
  background: linear-gradient(
    180deg,
    rgba(37, 99, 235, 0.27) 0%,
    rgba(59, 130, 246, 0.16) 58%,
    rgba(96, 165, 250, 0.04) 100%
  );
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

.posizione-utente-visual[data-bb-heading-active='true']::before {
  opacity: 1;
}

.posizione-utente-alone,
.posizione-utente-core {
  position: absolute !important;
  border-radius: 999px !important;
  z-index: 2;
}

.posizione-utente-alone-esterno {
  width: 32px !important;
  height: 32px !important;
  background: rgba(37, 99, 235, 0.10) !important;
  border: 1px solid rgba(37, 99, 235, 0.15) !important;
  animation: bbUserLocationPulse 2.6s cubic-bezier(.4, 0, .2, 1) infinite !important;
}

.posizione-utente-alone-interno {
  width: 23px !important;
  height: 23px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 2px solid rgba(37, 99, 235, 0.72) !important;
  box-shadow:
    0 2px 7px rgba(15, 23, 42, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78) !important;
}

.posizione-utente-core {
  width: 13px !important;
  height: 13px !important;
  background: #2563eb !important;
  border: 3px solid #ffffff !important;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.15),
    0 3px 8px rgba(37, 99, 235, 0.32) !important;
}

@keyframes bbUserLocationPulse {
  0%, 100% { opacity: .66; transform: scale(.88); }
  50% { opacity: .16; transform: scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  .posizione-utente-alone-esterno {
    animation: none !important;
  }
}
