/* ============================================================
   Eventado — Pedidos no mapa
   Same token system as entrega.eventado.com.br for consistency.
   ============================================================ */

:root {
  --acai: #3D1F47;
  --berry: #E84591;
  --berry-dark: #C22E73;
  --cream: #FFF6ED;
  --mint: #6FD9A6;
  --ink-soft: #6B4E74;
  --shadow-lg: 0 12px 32px rgba(61, 31, 71, 0.18);
  --shadow-sm: 0 4px 12px rgba(61, 31, 71, 0.14);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--acai);
  background: var(--cream);
  overscroll-behavior: none;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #EAE3DD;
}

.leaflet-control-attribution {
  font-size: 10px;
  border-radius: 6px 0 0 0;
}

/* ---------------- Top card ---------------- */

.top-card {
  position: absolute;
  top: calc(16px + var(--safe-top));
  left: 16px;
  right: 16px;
  z-index: 500;
  background: rgba(255, 246, 237, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.brand-mark {
  font-size: 20px;
  line-height: 1;
}

.brand-name {
  font-family: 'Fredoka', 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--acai);
}

.count-text {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------------- Refresh button ---------------- */

.refresh-btn {
  position: absolute;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  z-index: 500;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--berry);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.refresh-btn:hover { background: var(--berry-dark); }
.refresh-btn:active { transform: scale(0.94); }

.refresh-btn.is-spinning svg { animation: spin 0.7s linear infinite; }
.refresh-btn:disabled { cursor: default; opacity: 0.85; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------- Empty state ---------------- */

.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 400;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--ink-soft);
  pointer-events: none;
}

.empty-state.is-visible { display: flex; }

.empty-mark { font-size: 34px; }

.empty-state p {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 14.5px;
}

/* ---------------- Order pins ---------------- */

.order-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-pin span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--acai);
  color: var(--cream);
  border: 3px solid var(--cream);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}

/* ---------------- Pin popup ---------------- */

.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: 12px 14px;
}

.pin-popup-title {
  margin: 0 0 8px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--acai);
}

.pin-popup-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--berry);
  color: var(--cream);
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pin-popup-btn:hover { background: var(--berry-dark); }

/* ---------------- Responsive ---------------- */

@media (min-width: 640px) {
  .top-card { left: 24px; }
  .refresh-btn { right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .refresh-btn.is-spinning svg { animation: none; }
}
