/* =========================================================================
   Pagina "Trova un Al Volo Point": hero, barra di ricerca, elenco a card e mappa con cluster
   ========================================================================= */

/* ---------- Hero ---------- */
.pt-hero {
  position: relative; overflow: hidden; color: #fff; padding: 88px 0 150px;
  background: linear-gradient(125deg, #6E2F77 0%, var(--color-primary) 45%, var(--color-secondary) 100%);
  clip-path: ellipse(120% 100% at 50% 0%);
}
html[data-theme="dark"] .pt-hero { background: linear-gradient(125deg, #3E1A44 0%, #7A4381 55%, #9A6DA0 100%); }
.pt-hero .container { position: relative; z-index: 1; }
.pt-hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.7rem); line-height: 1.08; margin-bottom: .45em; }
.pt-hero .lead { color: rgba(255, 255, 255, .92); font-size: 1.15rem; max-width: 58ch; margin: 0; }
.pt-shape { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09); pointer-events: none; }
.pt-shape.s1 { width: 420px; height: 420px; top: -170px; left: -120px; }
.pt-shape.s2 { width: 280px; height: 280px; bottom: -120px; right: 6%; background: rgba(255, 255, 255, .07); }
.pt-chip {
  display: inline-block; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
  padding: 6px 16px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 22px;
}

/* ---------- Barra di ricerca ---------- */
.pt-main { padding-top: 0; position: relative; z-index: 2; }
.pt-searchcard {
  margin-top: -92px; background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: 26px;
  padding: 22px 24px 16px; box-shadow: 0 22px 50px rgba(45, 20, 55, .16);
}
.pt-searchrow { display: flex; gap: 14px; flex-wrap: wrap; }
.pt-field {
  position: relative; flex: 1; min-width: 240px; display: flex; align-items: center;
  background: var(--color-bg); border: 2px solid var(--color-divider); border-radius: 999px; transition: border-color .2s, box-shadow .2s;
}
.pt-field:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 5px color-mix(in srgb, var(--color-primary) 18%, transparent); }
.pt-field svg { position: absolute; left: 20px; width: 22px; height: 22px; color: var(--color-text-muted); }
.pt-field input[type="text"] {
  width: 100%; border: 0 !important; background: transparent !important; box-shadow: none; padding: 15px 20px 15px 54px; font-size: 1.05rem; color: var(--color-text);
}
.pt-field input:focus { outline: none; }
.pt-geo {
  display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer; font: inherit; font-weight: 700; color: #fff;
  padding: 14px 28px; border-radius: 999px; background: linear-gradient(135deg, var(--color-primary), #7B1FA2);
  transition: transform .15s, box-shadow .15s, opacity .2s;
}
.pt-geo svg { width: 20px; height: 20px; }
.pt-geo:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(123, 31, 162, .38); }
.pt-geo:disabled { opacity: .7; cursor: progress; }
.pt-geo.loading svg { animation: pt-pulse 1s ease-in-out infinite; }
.pt-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: .9rem; color: var(--color-text-muted); }
.pt-meta strong { color: var(--color-primary); font-size: 1rem; }
.pt-geo-msg { color: var(--color-primary); font-weight: 600; }

/* ---------- Elenco e mappa ---------- */
.pt-layout { display: grid; grid-template-columns: 400px 1fr; gap: 28px; margin-top: 28px; align-items: start; }
.pt-list {
  list-style: none; margin: 0; padding: 4px 8px 4px 2px; display: flex; flex-direction: column; gap: 12px;
  max-height: 640px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--color-secondary) transparent;
}
.pt-item {
  width: 100%; text-align: left; font: inherit; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 20px; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-divider); box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pt-item:hover { transform: translateX(4px); box-shadow: 0 14px 30px rgba(45, 20, 55, .16); border-color: var(--color-primary); }
.pt-item.selected { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)); }
.pt-pin {
  flex: none; width: 44px; height: 54px; display: flex; align-items: center; justify-content: center;
}
.pt-pin svg { width: 34px; height: 42px; filter: drop-shadow(0 4px 6px rgba(146, 82, 152, .35)); }
.pt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pt-name { color: var(--color-primary); font-size: 1.05rem; line-height: 1.25; font-weight: 700; }
.pt-addr { font-size: .93rem; color: var(--color-text); }
.pt-city { font-size: .85rem; color: var(--color-text-muted); }
.pt-dist {
  flex: none; font-size: .8rem; font-weight: 700; color: var(--color-primary); white-space: nowrap;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent); padding: 5px 11px; border-radius: 999px;
}
.pt-go { flex: none; color: var(--color-primary); font-weight: 700; font-size: 1.3rem; transition: transform .2s; }
.pt-item:hover .pt-go { transform: translateX(5px); }
.point-nessuno { color: var(--color-text-muted); padding: 14px 6px; }

.pt-mapwrap { position: sticky; top: 96px; }
.pt-map { height: 640px; border-radius: 26px; box-shadow: 0 22px 50px rgba(45, 20, 55, .16); border: 1px solid var(--color-divider); }

/* Segnaposto e cluster nei colori del portale */
.pt-marker { background: transparent; border: 0; filter: drop-shadow(0 5px 6px rgba(45, 20, 55, .35)); transition: transform .15s; }
.pt-marker:hover { transform: scale(1.12) translateY(-2px); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: rgba(146, 82, 152, .28); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background-color: #925298; color: #fff; font-weight: 700; font-family: inherit; box-shadow: 0 4px 10px rgba(45, 20, 55, .35);
}
.pt-popup { display: flex; flex-direction: column; gap: 3px; min-width: 190px; font-family: inherit; }
.pt-popup strong { color: #925298; font-size: 1rem; }
.pt-popup span { color: #444; }
.pt-popup a { margin-top: 6px; font-weight: 700; color: #7B1FA2; }

/* ---------- Invito finale ---------- */
.pt-cta {
  margin-top: 56px; border-radius: 26px; padding: 32px 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(120deg, #6E2F77, var(--color-primary) 55%, var(--color-secondary)); color: #fff;
  box-shadow: 0 22px 50px rgba(45, 20, 55, .2);
}
.pt-cta h3 { font-size: 1.4rem; margin-bottom: 4px; }
.pt-cta p { margin: 0; color: rgba(255, 255, 255, .92); max-width: 56ch; }
.pt-cta .btn-primary { background: #fff; color: var(--color-primary); }

@keyframes pt-pulse { 50% { transform: scale(1.25); } }

@media (max-width: 960px) {
  .pt-layout { grid-template-columns: 1fr; }
  .pt-mapwrap { position: static; order: -1; }
  .pt-map { height: 420px; }
  .pt-list { max-height: 460px; }
  .pt-hero { padding-bottom: 130px; }
}
@media (max-width: 520px) {
  .pt-searchcard { padding: 16px 14px 12px; }
  .pt-geo { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-item, .pt-marker, .pt-go, .pt-geo { transition: none; }
  .pt-geo.loading svg { animation: none; }
}
