/**
 * SpisaSmart — pagina «Intorno a me» (mappa full-screen Leaflet).
 */

.page-around-me {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

.page-around-me .around-me-map-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: 100%;
}

.page-around-me #around-me-map {
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #0b1120;
}

html.light .page-around-me #around-me-map {
  background: #e2e8f0;
}

/* Leaflet — tema scuro/chiaro */
.page-around-me .leaflet-container {
  font-family: Inter, sans-serif;
  outline: none;
}

.page-around-me .leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35) !important;
}

.page-around-me .leaflet-control-zoom a {
  background-color: #111827 !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html.light .page-around-me .leaflet-control-zoom a {
  background-color: #fff !important;
  color: #0b1120 !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

.page-around-me .leaflet-control-zoom a:hover {
  background-color: #00d2ff !important;
  color: #0b1120 !important;
}

.page-around-me .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(11, 17, 32, 0.75) !important;
  color: rgba(148, 163, 184, 0.9) !important;
  border-radius: 8px 0 0 0;
}

html.light .page-around-me .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.85) !important;
  color: #64748b !important;
}

/* Marker utente — ping */
.around-me-user-ping {
  animation: around-me-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes around-me-ping {
  75%,
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Pin supermercato — dimensioni fisse, logo contenuto */
.around-me-store-icon {
  background: transparent !important;
  border: none !important;
}

.around-me-marker-root {
  position: relative;
  width: 28px;
  height: 34px;
}

.around-me-sm-pin {
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 8px;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.around-me-sm-pin__logo {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.around-me-sm-pin__initials {
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.around-me-sm-pin-arrow {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #fff;
  transition: border-top-color 0.18s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.around-me-sm-pin:hover,
.around-me-sm-pin.around-me-sm-pin--active {
  transform: scale(1.15);
  border-color: #00d2ff !important;
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.5) !important;
  z-index: 10;
}

.around-me-sm-pin.around-me-sm-pin--picked {
  border-color: #f97316 !important;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.55) !important;
}

.around-me-sm-pin.around-me-sm-pin--picked.around-me-sm-pin--active {
  border-color: #00d2ff !important;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.55), 0 0 0 2px rgba(249, 115, 22, 0.45) !important;
}

.around-me-sm-pin.around-me-sm-pin--picked + .around-me-sm-pin-arrow,
.around-me-sm-pin.around-me-sm-pin--picked.around-me-sm-pin--active + .around-me-sm-pin-arrow {
  border-top-color: #f97316 !important;
}

.around-me-sm-pin:hover + .around-me-sm-pin-arrow,
.around-me-sm-pin.around-me-sm-pin--active + .around-me-sm-pin-arrow {
  border-top-color: #00d2ff !important;
}

/* Cluster */
.around-me-cluster-wrap {
  background: transparent !important;
  border: none !important;
}

.around-me-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  color: #0b1120;
  background: linear-gradient(135deg, #00d2ff, #00b8e0);
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 210, 255, 0.45);
}

.around-me-cluster--sm {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.around-me-cluster--md {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.around-me-cluster--lg {
  width: 40px;
  height: 40px;
  font-size: 13px;
  background: linear-gradient(135deg, #f97316, #00d2ff);
}

html.light .around-me-cluster {
  border-color: rgba(15, 23, 42, 0.12);
}

/* Marker utente */
.around-me-user-icon {
  background: transparent !important;
  border: none !important;
}

.around-me-user-dot {
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.around-me-user-dot__ping {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #00d2ff;
  opacity: 0.45;
  animation: around-me-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.around-me-user-dot__core {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #00d2ff;
  border: 2px solid #0b1120;
  box-shadow: 0 0 12px #00d2ff;
}

html.light .around-me-user-dot__core {
  border-color: #fff;
}

/* Lista selezione negozi */
.around-me-selection-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.around-me-selection-item {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  background: rgba(11, 17, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.85rem;
  overflow: hidden;
}

html.light .around-me-selection-item {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(15, 23, 42, 0.08);
}

.around-me-selection-item__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  text-align: left;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
}

.around-me-selection-item__body:hover {
  background: rgba(0, 210, 255, 0.06);
}

.around-me-selection-item__logo {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.around-me-selection-item__logo img {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
}

.around-me-selection-item__logo span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 0.5rem;
}

.around-me-selection-item__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.around-me-selection-item__name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.light .around-me-selection-item__name {
  color: #0f172a;
}

.around-me-selection-item__dist {
  font-size: 0.68rem;
  color: #94a3b8;
}

.around-me-selection-item__remove {
  width: 2.25rem;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.around-me-selection-item__remove:hover {
  color: #f97316;
  background: rgba(249, 115, 22, 0.08);
}

#around-me-sm-cta[aria-disabled='true'] {
  opacity: 0.45;
  pointer-events: none;
}

/* Neutralizza stili default MarkerCluster (usiamo iconCreateFunction custom) */
.page-around-me .marker-cluster-small,
.page-around-me .marker-cluster-medium,
.page-around-me .marker-cluster-large {
  background: transparent !important;
}

.page-around-me .marker-cluster-small div,
.page-around-me .marker-cluster-medium div,
.page-around-me .marker-cluster-large div {
  background: transparent !important;
}

/* Floating UI */
.around-me-float {
  pointer-events: none;
}

.around-me-float > * {
  pointer-events: auto;
}

.around-me-search:focus-within {
  transform: translateY(-2px);
}

.around-me-pill {
  transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.15s;
}

.around-me-pill--active {
  background: #fff !important;
  color: #0b1120 !important;
  border-color: #fff !important;
  font-weight: 700;
}

html.light .around-me-pill--active {
  background: #0b1120 !important;
  color: #fff !important;
  border-color: #0b1120 !important;
}

.around-me-pill:not(.around-me-pill--active):hover {
  border-color: rgba(0, 210, 255, 0.55);
}

/* Pannello dettagli */
#around-me-details {
  transition:
    transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.45s ease;
}

#around-me-details.around-me-panel--hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  #around-me-details.around-me-panel--hidden {
    transform: translateY(150%);
  }

  #around-me-details.around-me-panel--visible {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 768px) {
  #around-me-details.around-me-panel--hidden {
    transform: translateX(-150%);
  }

  #around-me-details.around-me-panel--visible {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Banner stato / geocoding */
.around-me-status {
  backdrop-filter: blur(12px);
}

.around-me-status__bar {
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

html.light .around-me-status__bar {
  background: rgba(15, 23, 42, 0.08);
}

.around-me-status__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d2ff, #f97316);
  transition: width 0.35s ease;
}

/* Scrollbar nascosta nei filtri */
.around-me-hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.around-me-hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Navbar compatta su mobile per più spazio mappa */
@media (max-width: 639px) {
  .page-around-me .around-me-float-top {
    top: 0.65rem;
    left: 0.65rem;
    right: 0.65rem;
  }

  .page-around-me .around-me-geo-btn {
    width: 3rem;
    height: 3rem;
    bottom: 1rem;
    right: 0.65rem;
  }

  #around-me-details {
    max-height: 82vh;
  }

  /* Pulsante posizione sopra la bottom nav mobile */
  body.spisa-has-mobile-bottom-nav.page-around-me #around-me-geo-btn {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px) + 0.5rem);
  }
}
