/* ═══ CERAMISPOT MAP — Leaflet Integration ═══ */

/* ── Map Container ── */
#ceramispot-map {
  display: none;
  width: 100%;
  height: 65vh;
  min-height: 400px;
  max-height: 700px;
  border-radius: 12px;
  border: 1px solid var(--cs-bg3, #e8ddd2);
  overflow: hidden;
  margin: 0 auto;
  max-width: 1200px;
}

/* ── Toggle Buttons ── */
.cs-view-toggle {
  display: inline-flex;
  gap: 0;
  border: 1.5px solid var(--cs-bg3, #e8ddd2);
  border-radius: 8px;
  overflow: hidden;
  background: var(--cs-white, #fff);
}
.cs-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: var(--cs-stone, #9a8070);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.cs-view-toggle-btn:not(:last-child) {
  border-right: 1.5px solid var(--cs-bg3, #e8ddd2);
}
.cs-view-toggle-btn:hover {
  color: var(--cs-brown, #3d2510);
  background: var(--cs-bg, #faf7f4);
}
.cs-view-toggle-btn.active {
  color: var(--cs-terracotta, #c96a3a);
  background: var(--cs-cream, #fdf6f0);
}
.cs-view-toggle-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Geolocation Button ── */
#cs-geolocate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: var(--cs-terracotta, #c96a3a);
  background: var(--cs-cream, #fdf6f0);
  border: 1.5px solid var(--cs-terracotta, #c96a3a);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
#cs-geolocate-btn:hover {
  background: var(--cs-terracotta, #c96a3a);
  color: #fff;
}
#cs-geolocate-btn.loading {
  opacity: .6;
  pointer-events: none;
}
#cs-geolocate-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* ── Custom Markers ── */
.cs-map-marker {
  background: none !important;
  border: none !important;
}
.cs-marker-dot {
  width: 28px;
  height: 28px;
  background: var(--cs-terracotta, #c96a3a);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(201,106,58,.4);
  transition: all .2s;
}
.cs-marker-dot.active,
.cs-map-marker-active .cs-marker-dot {
  background: #3d2510;
  width: 32px;
  height: 32px;
  box-shadow: 0 4px 16px rgba(61,37,16,.5);
}

/* ── User Location Marker ── */
.cs-user-marker {
  background: none !important;
  border: none !important;
}
.cs-user-dot {
  width: 16px;
  height: 16px;
  background: #4285F4;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(66,133,244,.2), 0 2px 8px rgba(0,0,0,.15);
  animation: cs-pulse 2s infinite;
}
@keyframes cs-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(66,133,244,.2), 0 2px 8px rgba(0,0,0,.15); }
  50% { box-shadow: 0 0 0 12px rgba(66,133,244,.1), 0 2px 8px rgba(0,0,0,.15); }
}

/* ── Popup Override ── */
.cs-map-popup .leaflet-popup-content-wrapper {
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,.15);
}
.cs-map-popup .leaflet-popup-content {
  margin: 0;
  min-width: 200px;
}
.cs-map-popup .leaflet-popup-tip {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

/* ── Card Highlight ── */
.cs-lcard.cs-lcard-highlight {
  border-color: var(--cs-terracotta, #c96a3a) !important;
  box-shadow: 0 0 0 2px rgba(201,106,58,.2), 0 10px 40px rgba(61,37,16,.12) !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #ceramispot-map {
    height: 50vh;
    min-height: 300px;
    border-radius: 0;
  }
  .cs-view-toggle-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
}
