/* Casimiro Map — Mappe Custom (Leaflet) */

.casimiro-map {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border-radius: 0;
  overflow: hidden;
  z-index: 1;
}

/* Leaflet divIcon reset */
.casimiro-marker-icon {
  background: none !important;
  border: none !important;
  overflow: visible !important;
}

/* Pin dot al lat/lng esatto — sempre visibile */
.casimiro-pin-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(30, 20, 10, 0.45), 0 0 0 1.5px rgba(30, 20, 10, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.casimiro-pin-dot:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 12px rgba(30, 20, 10, 0.55), 0 0 0 2px rgba(30, 20, 10, 0.5);
}

/* Marker card tooltip */
.casimiro-marker {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Allineamento card dentro il container iconSize in base alla direzione
   (così il triangolo tocca il pin anche se la card è max-content e più stretta del container) */
.casimiro-marker--right {
  justify-content: flex-start;
}

.casimiro-marker--left {
  justify-content: flex-end;
}

.casimiro-marker--down {
  justify-content: center;
  align-items: flex-start;
}

.casimiro-marker__card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  border: 2px solid #6B5440;
  box-shadow: 0 5px 18px rgba(30, 20, 10, 0.32);
  white-space: normal;
  width: max-content;
  max-width: 260px;
}

.casimiro-marker:hover .casimiro-marker__card {
  box-shadow: 0 7px 24px rgba(30, 20, 10, 0.42);
  border-color: #4A3A2B;
}

/* Compact variant — no focus (Location & Servizi) */
.casimiro-marker--compact .casimiro-marker__card {
  padding: 8px 12px;
  gap: 8px;
  max-width: 200px;
}

.casimiro-marker--compact .casimiro-marker__logo-wrap,
.casimiro-marker--compact .casimiro-marker__logo {
  width: 30px;
  height: 30px;
  max-width: 30px;
  max-height: 30px;
}

.casimiro-marker--compact .casimiro-marker__address,
.casimiro-marker--compact .casimiro-marker__directions {
  display: none;
}

/* Direction variants — sideways/down use dedicated wedges, hide default down-arrow */
.casimiro-marker--right .casimiro-marker__arrow,
.casimiro-marker--left .casimiro-marker__arrow,
.casimiro-marker--down .casimiro-marker__arrow {
  display: none;
}

/* Down variant: card below pin, arrow on top pointing up */
.casimiro-marker--down .casimiro-marker__card {
  position: relative;
}

.casimiro-marker--down .casimiro-marker__card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #fff;
  z-index: 2;
}

.casimiro-marker--down .casimiro-marker__card::after {
  content: '';
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 13px solid #6B5440;
  z-index: 1;
}

.casimiro-marker--right .casimiro-marker__card {
  position: relative;
}

.casimiro-marker--right .casimiro-marker__card::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #fff;
  z-index: 2;
}

.casimiro-marker--right .casimiro-marker__card::after {
  content: '';
  position: absolute;
  left: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 13px solid #6B5440;
  z-index: 1;
}

.casimiro-marker--left .casimiro-marker__card {
  position: relative;
}

.casimiro-marker--left .casimiro-marker__card::before {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid #fff;
  z-index: 2;
}

.casimiro-marker--left .casimiro-marker__card::after {
  content: '';
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 13px solid #6B5440;
  z-index: 1;
}

/* Logo wrapper — constrains SVG to fixed box */
.casimiro-marker__logo-wrap {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.casimiro-marker__logo {
  display: block;
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
}

.casimiro-marker__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.casimiro-marker__name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.casimiro-marker__address {
  font-family: 'Inconsolata', monospace;
  font-size: 9px;
  color: #888;
  margin-top: 2px;
  line-height: 1.3;
}

.casimiro-marker__directions {
  font-family: 'Inconsolata', monospace;
  font-size: 9px;
  font-weight: 500;
  color: #5C1A2A;
  text-decoration: none;
  margin-top: 3px;
  line-height: 1.3;
}

.casimiro-marker__directions:hover {
  text-decoration: underline;
}

/* Dot marker for non-focused structures */
.casimiro-marker__dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.casimiro-marker--dot:hover .casimiro-marker__dot {
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.casimiro-marker__dot-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: none;
}

/* Arrow pointing down */
.casimiro-marker__arrow {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #fff;
  margin: -1px auto 0;
  filter: drop-shadow(0 2px 3px rgba(30, 20, 10, 0.35));
  position: relative;
}

.casimiro-marker__arrow::before {
  content: '';
  position: absolute;
  top: -11px;
  left: -9px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 11px solid #6B5440;
  z-index: -1;
}

/* Dot marker tooltip */
.casimiro-dot-tooltip {
  font-family: 'Inconsolata', monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  line-height: 1.4;
}

.casimiro-dot-tooltip__link {
  font-size: 11px;
  font-weight: 600;
  color: #5C1A2A;
}

/* Parking markers — pill con cerchio P + nome breve */
.casimiro-parking-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #5C1A2A;
  border-radius: 20px;
  padding: 3px 12px 3px 3px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #F4F0EB;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.casimiro-parking-marker:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.casimiro-parking-marker__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #F4F0EB;
  color: #5C1A2A;
  font-family: 'Inconsolata', monospace;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.casimiro-parking-marker__name {
  font-family: 'Inconsolata', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #F4F0EB;
  line-height: 1;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

/* Parking tooltip */
.casimiro-parking-tooltip {
  font-family: 'Inconsolata', monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 4px;
  background: #F4F0EB;
  color: #1E1E1E;
  border: 1px solid rgba(92, 26, 42, 0.25);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.casimiro-parking-tooltip::before {
  border-top-color: rgba(92, 26, 42, 0.25) !important;
}

/* POI markers (station, etc.) */
.casimiro-poi-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 2px solid #E0DCD7;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.casimiro-poi-marker:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.casimiro-poi-marker__label {
  font-size: 16px;
  line-height: 1;
}

/* Responsive */
@media (max-width: 1024px) {
  .casimiro-map {
    min-height: 400px;
  }
}

@media (max-width: 767px) {
  .casimiro-map {
    min-height: 350px;
    border-radius: 0;
  }

  .casimiro-marker__card {
    padding: 8px 10px;
    gap: 8px;
    max-width: 180px;
  }

  /* Compact card (Location): più stretta per stare in mobile senza accavallamenti */
  .casimiro-marker--compact .casimiro-marker__card {
    padding: 7px 11px;
    gap: 7px;
    max-width: 155px;
  }

  .casimiro-marker__logo-wrap {
    width: 28px;
    height: 28px;
  }

  .casimiro-marker__logo {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
  }

  .casimiro-marker--compact .casimiro-marker__logo-wrap,
  .casimiro-marker--compact .casimiro-marker__logo {
    width: 26px;
    height: 26px;
    max-width: 26px;
    max-height: 26px;
  }

  .casimiro-marker__name {
    font-size: 11px;
  }

  .casimiro-marker--compact .casimiro-marker__name {
    font-size: 12px;
    letter-spacing: 0.4px;
  }

  .casimiro-marker__address {
    font-size: 8px;
  }

  .casimiro-marker__directions {
    font-size: 8px;
  }

  /* Su mobile i parcheggi sono solo il pallino P, il nome appare nel tooltip */
  .casimiro-parking-marker {
    padding: 2px;
    border-radius: 50%;
  }

  .casimiro-parking-marker__name {
    display: none;
  }
}
