/* ==========================================================================
   LOCALBOX EVENTI & PROLOCO (MODULO 2) • ECOSISTEMA RIVIERA LIGURE
   Allineamento 1:1 rigoroso con 'LocalBox Sentieri'
   Layout 100% Viewport, Header Dropdown Sentieri e Splashscreen Privacy
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABILI CSS :root ESTRATTE DA SENTIERI
   -------------------------------------------------------------------------- */
:root {
  --brand-header: #8d9a63;    /* Verde oliva dell'header "I NOSTRI SENTIERI" */
  --brand-border: #84c4a2;    /* Verde salvia della cornice perimetrale e dei bordi */
  --bg-app: #f4f4f0;          /* Sfondo sabbia / crema naturale */
  --card-bg: #ffffff;         /* Bianco pulito con bordo 1px solid var(--brand-border) */
  --text-primary: #2b3a2a;    /* Verde scuro / grafite ad alto contrasto */
  --text-muted: #4b5563;      /* Grigio ardesia per metadati */
  --btn-active: #8d9a63;      /* Stato selezionato dei blocchi */

  /* Codici Allerta Protezione Civile (Arpal / LibraRisk) */
  --alert-green: #22c55e;
  --alert-yellow: #eab308;
  --alert-orange: #f97316;
  --alert-red: #ef4444;

  --header-height: 52px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   2. RESET MINIMALE E STRUTTURA BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   3. 1. CORNICE ESTERNA CARATTERISTICA SENTIERI (4px #84c4a2 al perimetro)
   -------------------------------------------------------------------------- */
.app-frame {
  width: 100vw;
  margin: 0;
  padding: 0;
  border: 4px solid var(--brand-border);
  box-sizing: border-box;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* --------------------------------------------------------------------------
   4. HEADER VERDE OLIVA (#8d9a63) IDENTICO A SENTIERI CON DROPDOWN
   -------------------------------------------------------------------------- */
.app-header {
  height: var(--header-height);
  background-color: var(--brand-header) !important;
  color: #ffffff;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1500;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.header-left:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

#header-logo {
  height: 28px;
  width: 28px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.app-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  white-space: nowrap;
}

.header-toggle-arrow {
  display: inline-block;
  font-size: 0.8rem;
  margin-left: 8px;
  color: #ffffff;
  transition: transform 0.2s ease;
}

.header-toggle-arrow.open {
  transform: rotate(180deg);
}

/* Spia compatta stato Allerta Protezione Civile nell'Header */
.header-alert-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.header-alert-wrapper:hover {
  transform: scale(1.03);
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.55);
}

.header-alert-wrapper:active {
  transform: scale(0.97);
}

.alert-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--alert-green);
  box-shadow: 0 0 6px var(--alert-green);
  display: inline-block;
  flex-shrink: 0;
}

.alert-pulse-dot.gialla {
  background-color: var(--alert-yellow);
  box-shadow: 0 0 6px var(--alert-yellow);
  animation: pulse-alert 1.2s infinite;
}

.alert-pulse-dot.arancione {
  background-color: var(--alert-orange);
  box-shadow: 0 0 6px var(--alert-orange);
  animation: pulse-alert 1.2s infinite;
}

.alert-pulse-dot.rossa {
  background-color: var(--alert-red);
  box-shadow: 0 0 6px var(--alert-red);
  animation: pulse-alert 0.8s infinite;
}

@keyframes pulse-alert {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* --------------------------------------------------------------------------
   MENÙ A TENDINA DEI 6 COMUNI
   -------------------------------------------------------------------------- */
.towns-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 320px;
  max-width: 100vw;
  background-color: #ffffff;
  border: 2px solid var(--brand-border);
  border-top: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 2000;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  overflow: hidden;
  animation: dropdown-slide 0.2s ease-out;
}

@keyframes dropdown-slide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 14px;
  background-color: #f7f9f6;
  border-bottom: 1px solid #e5ede0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid #edf2ea;
  background-color: #ffffff;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}

.dropdown-item:hover {
  background-color: #eef3eb;
  color: var(--brand-header);
}

.dropdown-item.active {
  background-color: var(--brand-header);
  color: #ffffff;
  font-weight: 700;
}

.dropdown-item .item-arrow,
.dropdown-item .item-check {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-item.active .item-arrow,
.dropdown-item.active .item-check {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   5. COMANDI E FILTRI RAPIDI
   -------------------------------------------------------------------------- */
.controls-toolbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--brand-border);
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.controls-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-switch {
  display: flex;
  background-color: #ffffff;
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  padding: 3px;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.switch-btn {
  flex: 1;
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 9px 12px;
  min-height: 40px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.switch-btn .switch-icon {
  font-size: 0.9em;
  pointer-events: none;
  flex-shrink: 0;
}

.switch-btn:hover:not(.active) {
  background-color: #f4f6f0;
  color: var(--brand-header);
}

.switch-btn.active {
  background-color: var(--btn-active);
  border-color: var(--btn-active);
  color: #ffffff;
}

/* Base Mobile (< 992px): Ribbon orizzontale scorrevole con swipe touch */
.filters-ribbon {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  gap: 8px;
  padding: 2px 2px 6px 2px;
  scrollbar-width: none;
}

.filters-ribbon::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  appearance: none;
  background-color: var(--card-bg);
  border: 1px solid var(--brand-border);
  border-radius: 5px;
  padding: 8px 12px;
  min-height: 38px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.filter-pill .pill-icon {
  font-size: 0.85em;
  opacity: 0.8;
  pointer-events: none;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.filter-pill:hover {
  background-color: #f0f4ed;
  border-color: var(--brand-header);
}

.filter-pill.active {
  background-color: var(--brand-header);
  border-color: var(--brand-header);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(141, 154, 99, 0.35);
}

.filter-pill.active .pill-icon {
  opacity: 1;
  transform: scale(1.08);
}

/* --------------------------------------------------------------------------
   6. SEZIONI FEED NELLA COLONNA SINISTRA
   -------------------------------------------------------------------------- */
.section-events-feed,
.section-associati-feed,
.section-trasporti-feed {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--brand-border);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.feed-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.feed-description {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.feed-count-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: #e5ede0;
  color: var(--brand-header);
  border: 1px solid var(--brand-border);
  padding: 2px 6px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   7. POPUP MODALE ALLERTA PROTEZIONE CIVILE (A Comparsa / Non Invasivo)
   -------------------------------------------------------------------------- */
.alert-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  box-sizing: border-box;
  animation: fadeInOverlay 0.18s ease-out;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.alert-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--brand-border);
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.22), 0 10px 15px -5px rgba(0, 0, 0, 0.1);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.alert-modal-card.gialla {
  border-left: 5px solid var(--alert-yellow);
}

.alert-modal-card.arancione {
  border-left: 5px solid var(--alert-orange);
}

.alert-modal-card.rossa {
  border-left: 5px solid var(--alert-red);
}

.alert-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f0;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.alert-modal-close:hover {
  background: #e2e8df;
  color: var(--text-primary);
}

.alert-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-right: 30px;
}

.alert-modal-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.alert-modal-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.alert-modal-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.alert-modal-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  background-color: #fef3c7;
  color: #92400e;
}

.alert-modal-badge.gialla {
  background-color: #fef3c7;
  color: #92400e;
}

.alert-modal-badge.arancione {
  background-color: #ffedd5;
  color: #9a3412;
}

.alert-modal-badge.rossa {
  background-color: #fee2e2;
  color: #991b1b;
}

.alert-modal-validity {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.alert-modal-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.alert-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-modal-prescrizioni {
  background-color: #fbfbf9;
  border: 1px solid #edf2ea;
  border-radius: 4px;
  padding: 10px 12px;
}

.alert-modal-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.alert-modal-msg {
  font-size: 0.78rem;
  line-height: 1.42;
  color: var(--text-primary);
  margin: 0;
}

.alert-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #edf2ea;
  flex-wrap: wrap;
}

.btn-modal-safety-areas {
  background-color: var(--brand-header);
  color: #ffffff;
  border: none;
  padding: 7px 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.15s ease;
}

.btn-modal-safety-areas:hover {
  background-color: #768350;
}

.link-modal-official {
  font-size: 0.74rem;
  font-weight: 700;
  color: #b45309;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.link-modal-official:hover {
  color: #92400e;
}

/* --------------------------------------------------------------------------
   8. SCHEDE EVENTO AD ALTA DENSITÀ (Gabbia Spartana)
   -------------------------------------------------------------------------- */
.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 14px; /* Aumentato respiro tra le schede */
}

.event-card {
  background-color: var(--card-bg);
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  padding: 14px 16px; /* Generoso respiro interno */
  display: flex;
  flex-direction: column;
  gap: 10px;          /* Stacco verticale equilibrato tra i blocchi */
  box-shadow: 0 2px 4px rgba(31, 41, 55, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.event-card:hover {
  border-color: var(--brand-header);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.event-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.event-category-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: #edf5ea;
  color: var(--text-primary);
  border: 1px solid var(--brand-border);
}

.event-town-tag {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--brand-header);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-card-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.event-dates-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  background-color: #edf3e9;
  border-left: 3px solid var(--brand-header);
  padding: 6px 10px;
  border-radius: 4px;
}

.event-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 0.80rem;
  line-height: 1.4;
}

.meta-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-primary);
}

.meta-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 80px;
  font-size: 0.78rem;
}

.meta-value {
  font-weight: 500;
}

.meta-value strong {
  font-weight: 700;
}

.event-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tag-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
}

.tag-pill.rain-yes {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.tag-pill.rain-no {
  background-color: #f9fafb;
  border-color: #e5e7eb;
  color: var(--text-muted);
}

.tag-pill.price {
  background-color: #fefce8;
  border-color: #fef08a;
  color: #854d0e;
}

.event-parking-box {
  background-color: #fafaf8;
  border: 1px dashed var(--brand-border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.event-parking-box strong {
  color: var(--text-primary);
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #ebebe5;
}

.event-sponsor-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.event-sponsor-label strong {
  color: var(--text-primary);
}

.btn-event-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  background-color: #f7faf5;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: 4px 10px;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  margin-left: auto;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn-event-source:hover,
.btn-event-source:active {
  background-color: var(--brand-header);
  border-color: var(--brand-header);
  color: #ffffff;
}

/* Fallback Bassa Stagione */
.winter-fallback-box {
  background-color: var(--card-bg);
  border: 1px solid var(--brand-border);
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.winter-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.winter-icon {
  font-size: 1.1rem;
}

.winter-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.winter-text {
  font-size: 0.76rem;
  color: var(--text-primary);
}

.winter-markets-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.74rem;
  background-color: var(--bg-app);
  border: 1px solid var(--brand-border);
  border-radius: 3px;
  padding: 6px 8px;
}

.winter-markets-list li {
  padding-left: 8px;
  position: relative;
}

.winter-markets-list li::before {
  content: "•";
  color: var(--brand-header);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.winter-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   9. SCHEDE ASSOCIATI E BOTTEGHE STORICHE
   -------------------------------------------------------------------------- */
.associato-card {
  background-color: var(--card-bg);
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  padding: 14px 16px; /* Stesso respiro di event-card */
  display: flex;
  flex-direction: column;
  gap: 10px;          /* Stacco verticale identico */
  box-shadow: 0 2px 4px rgba(31, 41, 55, 0.04);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.associato-card:hover {
  border-color: var(--brand-header);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.associato-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.associato-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.associato-badge-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge-365 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.70rem;
  font-weight: 800;
  color: #166534;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.associato-hours-box {
  background-color: #f7f9f6;
  border-left: 3px solid var(--brand-border);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.associato-hours-label {
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text-primary);
  text-transform: uppercase;
  display: block;
  margin-bottom: 3px;
}

.associato-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #edf2ea;
  flex-wrap: wrap;
}

.btn-action-tel,
.btn-action-wa,
.btn-tel {
  appearance: none;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-action-tel,
.btn-tel {
  background-color: var(--bg-app);
  border-color: var(--brand-border);
  color: var(--text-primary);
}

.btn-action-tel:hover,
.btn-tel:hover {
  background-color: #e5ede0;
  color: var(--brand-header);
}

.btn-action-wa {
  background-color: #ecfdf5;
  border-color: #86efac;
  color: #15803d;
}

.btn-action-wa:hover {
  background-color: #dcfce7;
  border-color: #4ade80;
  color: #166534;
}

/* --------------------------------------------------------------------------
   9.1 BANNER ALLERTE LIVE & SCHEDE TRASPORTI / MOBILITÀ TERRITORIALE
   -------------------------------------------------------------------------- */
#transport-filters .filter-pill {
  min-height: 44px;
  padding: 8px 14px;
}

.transport-alerts-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex-shrink: 0;
}

.transport-alert-banner {
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--brand-border);
  box-shadow: 0 2px 5px rgba(31, 41, 55, 0.05);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Stato Regolare: Badge compatto verde neutro */
.transport-alert-banner.alert-regolare {
  background-color: #f2f7ef;
  border-color: #bfd4b5;
  border-left: 4px solid #16a34a;
  padding: 8px 12px;
}

/* Stato Attenzione: Banner ambra/giallo di cautela */
.transport-alert-banner.alert-attenzione {
  background-color: #fffbeb;
  border-color: #fcd34d;
  border-left: 5px solid #d97706;
}

/* Stato Critico: Banner evidenziato in rosso con icona d'allerta e lista espandibile */
.transport-alert-banner.alert-critico {
  background-color: #fef2f2;
  border-color: #fca5a5;
  border-left: 5px solid #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}

.transport-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.transport-alert-status-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 200px;
  min-width: 0;
}

.transport-alert-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.alert-regolare .transport-alert-icon {
  background-color: #dcfce7;
  color: #15803d;
}

.alert-attenzione .transport-alert-icon {
  background-color: #fef3c7;
  color: #b45309;
}

.alert-critico .transport-alert-icon {
  background-color: #fee2e2;
  color: #b91c1c;
}

.transport-alert-text-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.transport-alert-title {
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.alert-regolare .transport-alert-title {
  color: #14532d;
}

.alert-attenzione .transport-alert-title {
  color: #78350f;
}

.alert-critico .transport-alert-title {
  color: #7f1d1d;
}

.transport-alert-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.transport-alert-pill.regolare {
  font-size: 0.70rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  white-space: nowrap;
}

/* Bottone touch-screen / totem (min 44px) per espandere/chiudere gli avvisi */
.transport-alert-toggle {
  appearance: none;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.alert-attenzione .transport-alert-toggle {
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  color: #78350f;
}

.alert-attenzione .transport-alert-toggle:hover,
.alert-attenzione .transport-alert-toggle:active {
  background-color: #fde68a;
}

.alert-critico .transport-alert-toggle {
  background-color: #dc2626;
  border: 1px solid #b91c1c;
  color: #ffffff;
}

.alert-critico .transport-alert-toggle:hover,
.alert-critico .transport-alert-toggle:active {
  background-color: #b91c1c;
}

/* Lista espandibile avvisi attivi */
.transport-alert-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transport-alert-list[hidden] {
  display: none !important;
}

.transport-alert-item {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.transport-alert-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.transport-alert-expiry {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.transport-alert-item-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.transport-alert-item-detail {
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.45;
  margin: 0;
}

.transport-alert-item-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.transport-alert-source-link {
  min-height: 38px;
  padding: 6px 12px;
}

/* Card Punti di Mobilità (.trasporti-card & .transport-card) */
.trasporti-card,
.transport-card {
  background-color: var(--card-bg);
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  padding: 14px 16px; /* Stesso respiro di event-card */
  display: flex;
  flex-direction: column;
  gap: 10px;          /* Stacco verticale identico */
  box-shadow: 0 2px 4px rgba(31, 41, 55, 0.04);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.trasporti-card:hover,
.transport-card:hover {
  border-color: var(--brand-header);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.trasporti-header,
.transport-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.trasporti-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trasporti-title,
.transport-card-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.trasporti-badge-tipo {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 4px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.trasporti-badge-tipo.treno {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.trasporti-badge-tipo.bus {
  background-color: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.trasporti-badge-tipo.battello {
  background-color: #e0f7fa;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.trasporti-badge-tipo.noleggio {
  background-color: #ecfdf5;
  color: #15803d;
  border: 1px solid #a7f3d0;
}

.trasporti-badge-tipo.parcheggio {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.trasporti-indirizzo,
.transport-card-address {
  font-size: 0.80rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.trasporti-box-orari,
.transport-card-hours {
  background-color: #f7f9f6;
  border-left: 3px solid var(--brand-header);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.trasporti-box-orari strong,
.transport-card-hours strong {
  color: var(--text-primary);
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.trasporti-box-note,
.transport-card-notes {
  background-color: #fafaf8;
  border: 1px dashed var(--brand-border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.trasporti-box-note strong,
.transport-card-notes strong {
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   10. MAPPA TOOLBAR E ANTEPRIMA
   -------------------------------------------------------------------------- */
.map-panel-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: none;
  background: transparent;
}

.map-toolbar {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--brand-border);
  flex-shrink: 0;
}

.map-toolbar-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--brand-header);
}

.map-title-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.map-toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-map-control {
  appearance: none;
  background-color: var(--bg-app);
  border: 1px solid var(--brand-border);
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-map-control:hover {
  background-color: #e5ede0;
}

.map-pin-preview {
  display: none !important;
}

/* Popup Leaflet Compatto a 2 Righe (Kicker Paese/Tipologia + Titolo) */
.leaflet-popup-content {
  margin: 10px 14px !important;
  line-height: 1.25 !important;
}

.proloco-compact-popup {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-width: 150px;
  max-width: 240px;
}

.proloco-popup-kicker {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 2px;
}

.proloco-popup-title {
  font-size: 13px;
  font-weight: 800;
  color: #1f2937;
  display: block;
  line-height: 1.25;
  margin: 0;
}

/* Stato Scheda Selezionata / Evidenziata da Click su Pin o Bottone Mappa */
.event-card.card-highlighted,
.associato-card.card-highlighted,
.trasporti-card.card-highlighted,
.transport-card.card-highlighted {
  border: 2px solid var(--brand-header, #8d9a63) !important;
  background-color: #eef3e6 !important;
  box-shadow: 0 6px 18px rgba(141, 154, 99, 0.28), 0 0 0 2px rgba(132, 196, 162, 0.35) !important;
  transform: translateY(-1px);
  transition: background-color 0.25s ease, border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

/* Sotto-elementi interni coordinati dentro la scheda evidenziata (#eef3e6) */
.card-highlighted .event-dates-bar,
.card-highlighted .event-parking-box,
.card-highlighted .associato-hours-box,
.card-highlighted .trasporti-box-orari,
.card-highlighted .transport-card-hours,
.card-highlighted .trasporti-box-note,
.card-highlighted .transport-card-notes {
  background-color: rgba(255, 255, 255, 0.75) !important;
}

.card-highlighted .event-card-footer,
.card-highlighted .associato-actions,
.card-highlighted .trasporti-footer {
  border-top-color: rgba(141, 154, 99, 0.35) !important;
}

/* --------------------------------------------------------------------------
   11. STATO CARICAMENTO
   -------------------------------------------------------------------------- */
.loading-placeholder {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

/* ============================================================
   SPLASHSCREEN DIRETTO (CLONE 1:1 SENTIERI)
   ============================================================ */
.splashscreen-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    background-color: #f5f5de !important; /* Beige originale Sentieri */
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding-top: 12vh !important;
    padding-bottom: 24px !important;
    overflow-y: auto !important;
    transition: opacity 0.35s ease, visibility 0.35s ease !important;
}

.splashscreen-overlay.fade-out {
    opacity: 0 !important;
    pointer-events: none !important;
}

.splashscreen-overlay.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    pointer-events: none !important;
}

/* 1. Blocco Logo Superiore (Proporzioni corrette Sentieri) */
.splash-brand-block {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    margin-bottom: 24px !important;
}

.splash-brand-block img,
#splash-logo-img {
    width: 110px !important;
    height: 110px !important;
    max-width: 110px !important;
    max-height: 110px !important;
    min-width: 110px !important;
    min-height: 110px !important;
    border-radius: 20px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto 10px auto !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Titolo sotto il logo */
.splash-title-text,
.splash-brand-block .splash-title-text {
    font-family: "Georgia", "Times New Roman", serif !important;
    font-size: 28px !important; /* Ingrandito */
    font-weight: 700 !important;
    color: #2b3a2a !important;
    margin: 0 !important;
    text-align: center !important;
    letter-spacing: 0.5px !important;
}

/* 2. Card Privacy e Benvenuto in Basso */
.splash-privacy-card {
    width: calc(100% - 32px) !important;
    max-width: 400px !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 18px 20px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
    box-sizing: border-box !important;
    text-align: left !important;
    margin: auto auto 0 auto !important;
    flex-shrink: 0 !important;
}

/* Titolo principale della card */
.splash-privacy-card h2 {
    font-family: "Georgia", "Times New Roman", serif !important;
    font-size: 1.35rem !important; /* Ingrandito */
    font-weight: 700 !important;
    color: #2b3a2a !important;
    text-align: center !important;
    margin: 0 0 16px 0 !important;
}

.splash-section-title {
    color: #8d9a63 !important; /* Verde oliva ufficiale */
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    margin-bottom: 4px !important;
}

.splash-desc {
    font-size: 13px !important;
    line-height: 1.45 !important;
    color: #4b5563 !important;
    margin: 0 0 12px 0 !important;
}

/* Box Istruzioni PWA: Sfondo pulito con leggera ombreggiatura (NO tratteggio) */
.splash-pwa-box {
    background-color: #faf9f5 !important;
    border: 1px solid #e8e5dc !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important; /* Minima ombreggiatura */
    font-size: 0.76rem !important;
    color: #4b5563 !important;
    line-height: 1.4 !important;
    margin-bottom: 16px !important;
}

.splash-privacy-content p {
    font-size: 13px !important;
    line-height: 1.45 !important;
    color: #4b5563 !important;
    margin: 0 0 10px 0 !important;
}

.splash-privacy-content p:last-child {
    margin-bottom: 0 !important;
}

.splash-privacy-content strong {
    color: #2b3a2a !important;
}

.splash-btn-start {
    width: 100% !important;
    background-color: #8d9a63 !important; /* Verde oliva ufficiale */
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 12px !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    text-align: center !important;
    display: block !important;
    margin-top: 14px !important;
}

/* --------------------------------------------------------------------------
   13. 1. RESPONSIVE LAYOUT & RIPRISTINO SCROLL VERTICALE
   -------------------------------------------------------------------------- */

/* MOBILE (< 992px): APP-SHELL SPLIT-SCREEN VERTICALE
   Blocco Superiore Fisso (Header + Tab/Filtri + Mappa) + Blocco Inferiore Scorrevole (Schede) */
@media (max-width: 991px) {
  html, body {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .app-frame {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Header fisso in cima alla App-Shell */
  .app-header {
    position: relative;
    top: 0;
    z-index: 1500;
    flex-shrink: 0;
  }

  .main-layout-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
  }

  /* content-column usa display: contents per ordinare nel flex container:
     0: controls-toolbar (fisso), 1: map-column (fisso), 2: section-*-feed (scorrevole) */
  .content-column {
    display: contents;
  }

  /* 1. Barra comandi e filtri fissa subito sotto l'header verde */
  .controls-toolbar {
    order: 0;
    flex-shrink: 0;
    position: relative;
    top: 0;
    z-index: 900;
    width: 100%;
    padding: 5px 10px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--brand-border);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
  }

  .controls-inner {
    gap: 5px;
  }

  /* 2. Mappa Leaflet fissa nel blocco superiore (35dvh, min 240px, max 290px)
     Proporzioni equilibrate e maggiore respiro verticale per il feed inferiore */
  .map-column {
    order: 1;
    flex-shrink: 0;
    width: 100%;
    height: 35vh;
    height: 35dvh;
    min-height: 240px;
    max-height: 290px;
    margin-top: 0;
    border-top: none;
    border-bottom: 2px solid var(--brand-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .map-panel-card {
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .leaflet-map-canvas {
    width: 100%;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
  }

  /* 3. Sezioni Feed (Eventi, Attività, Trasporti): Blocco inferiore scorrevole con snap rigido scheda per scheda */
  .section-events-feed,
  .section-associati-feed,
  .section-trasporti-feed {
    order: 2;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    scroll-padding-top: 8px;
    padding: 8px 12px 32px 12px;
    box-sizing: border-box;
  }

  .event-card,
  .associato-card,
  .trasporti-card,
  .transport-card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    scroll-margin-top: 8px;
  }

  .towns-dropdown-menu {
    width: 100%;
    border-radius: 0;
  }
}

/* DESKTOP (>= 992px): LAYOUT INVARIATO A DUE COLONNE (FEED SX 440px CON SCROLL INDIPENDENTE, MAPPA DX FULL-HEIGHT) */
@media (min-width: 992px) {
  html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  .app-frame {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  .app-header {
    position: sticky;
    top: 0;
  }

  .main-layout-wrapper {
    display: flex;
    flex-direction: row;
    height: calc(100vh - var(--header-height) - 8px);
    width: 100%;
    overflow: hidden;
  }

  /* 2. Sidebar Sinistra: Altezza 100% del genitore, overflow bloccato */
  .content-column {
    display: flex;
    flex-direction: column;
    width: 450px;
    min-width: 400px;
    max-width: 480px;
    height: 100%;
    overflow: hidden; /* Blocca lo scroll globale della colonna */
    border-right: 2px solid var(--brand-border);
    flex-shrink: 0;
  }

  /* 3. Testata Filtri Fissa: altezza naturale fissa, mai scorrevole */
  .controls-toolbar {
    flex-shrink: 0;
    width: 100%;
    position: static;
    z-index: 10;
    padding: 12px 14px;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  }

  /* 4. CSS Grid Filtri Desktop: Grid 2x3 per il ribbon attivo (non-hidden) */
  .filters-ribbon {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    overflow-x: visible;
    white-space: normal;
    padding: 4px 0 0 0;
  }

  .filter-pill {
    width: 100%;
    justify-content: space-between; /* Testo a sinistra, icona stabilmente a destra */
    padding: 8px 12px;
  }

  /* 6. Sezioni Feed (Eventi, Soci, Trasporti): Unico blocco con scroll interno */
  .section-events-feed,
  .section-associati-feed,
  .section-trasporti-feed {
    flex: 1 1 auto;
    min-height: 0; /* IMPERATIVO: consente al flex item di comprimersi e attivare lo scroll */
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 14px 16px 32px 16px;
    order: initial;
  }

  /* 7. Mappa Leaflet: Occupa il 100% dello spazio rimanente senza alterazioni */
  .map-column {
    order: initial;
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 0;
    border-top: none;
    border-bottom: none;
  }

  .leaflet-map-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
  }
}

/* --------------------------------------------------------------------------
   14. PERSONALIZZAZIONE BADGE LEAFLET MARKER CLUSTER & PIN SVG (STILE SENTIERI)
   -------------------------------------------------------------------------- */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large,
.marker-cluster {
  background-color: rgba(132, 196, 162, 0.45) !important; /* Alone semitrasparente #84c4a2 */
  border-radius: 50% !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(132, 196, 162, 0.35) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.marker-cluster-small {
  width: 44px !important;
  height: 44px !important;
}

.marker-cluster-medium {
  width: 48px !important;
  height: 48px !important;
}

.marker-cluster-large {
  width: 52px !important;
  height: 52px !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div,
.marker-cluster div {
  background-color: var(--brand-header, #8d9a63) !important; /* Sfondo badge #8d9a63 */
  color: #ffffff !important; /* Testo contatore bianco */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-weight: 800 !important;
  font-size: 16px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease;
}

.marker-cluster-medium div {
  width: 40px !important;
  height: 40px !important;
  font-size: 17px !important;
}

.marker-cluster-large div {
  width: 44px !important;
  height: 44px !important;
  font-size: 18px !important;
}

.marker-cluster:hover div {
  transform: scale(1.1);
  background-color: #768350 !important;
}

.marker-cluster span {
  color: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: -0.02em;
}

/* Reset nativo Leaflet per L.divIcon e Marker Vettoriali SVG Pro Loco */
.leaflet-div-icon,
.leaflet-marker-icon.proloco-svg-marker {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Wrapper interno pin a goccia (44x56px, ancorato sulla punta inferiore [22, 56]) */
.proloco-pin-teardrop .proloco-pin-wrap {
  width: 44px;
  height: 56px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: bottom center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
  will-change: transform;
}

/* L'SVG con viewBox 200x200 contiene margine laterale trasparente:
   renderizzandolo a 56x56px centrato nel box 44x56px la goccia visiva
   misura esattamente 44x55px con cerchio bianco da 31px e glifo interno da 25px */
.proloco-pin-teardrop .proloco-pin-img {
  width: 56px;
  height: 56px;
  max-width: none;
  flex-shrink: 0;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Wrapper interno pin circolare secondario (es. Foto/Pano 44x44px, ancorato al centro [22, 22]) */
.proloco-pin-circle .proloco-pin-wrap {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transform-origin: center center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
  will-change: transform;
}

.proloco-pin-circle .proloco-pin-img {
  width: 44px;
  height: 44px;
  max-width: none;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Stato Hover e Pin Attivo/Selezionato: ingrandimento 1.15x sul wrapper interno
   così da non sovrascrivere mai il transform: translate3d(...) di Leaflet */
.leaflet-marker-icon.proloco-svg-marker:hover,
.leaflet-marker-icon.proloco-svg-marker.is-active {
  z-index: 2000 !important;
}

.leaflet-marker-icon.proloco-svg-marker:hover .proloco-pin-wrap,
.leaflet-marker-icon.proloco-svg-marker.is-active .proloco-pin-wrap {
  transform: scale(1.15);
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.45));
}

