/* =============================================
   CHOCONATH — MAPA DE RESTAURANTES
   Estilos principais
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Base ──────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink: #b5005b;
  --pink-light: #e8004f;
  --pink-dark: #7a003d;
  --choco: #3b1a08;
  --choco-mid: #6b3a1f;
  --cream: #fff5f0;
  --white: #ffffff;
  --gray-100: #f8f0ed;
  --gray-200: #ecddd8;
  --shadow-sm: 0 2px 8px rgba(59, 26, 8, .12);
  --shadow-md: 0 6px 24px rgba(59, 26, 8, .18);
  --shadow-lg: 0 12px 40px rgba(59, 26, 8, .25);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: .22s cubic-bezier(.4, 0, .2, 1);
}

html,
body {
  height: 100%;
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--choco);
  color: var(--choco);
  overflow: hidden;
}

/* ── Header ─────────────────────────────────── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--choco) 0%, var(--choco-mid) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
}

#header .logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

#header .logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(181, 0, 91, .45);
  flex-shrink: 0;
}

#header .logo-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -.3px;
}

#header .logo-text p {
  font-size: .78rem;
  font-weight: 400;
  color: rgba(255, 255, 255, .6);
  margin-top: 1px;
}

#header .pill-count {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-light) 100%);
  color: white;
  font-size: .78rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 50px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(181, 0, 91, .4);
}

/* ── Map container ───────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  top: 74px;
  /* header height */
  bottom: 35px;
  /* footer height */
  z-index: 1;
}

/* ── Custom Leaflet Marker ───────────────────── */
.custom-pin {
  position: relative;
  width: 44px;
  height: 44px;
}

.pin-body {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--pink-dark) 0%, var(--pink) 60%, var(--pink-light) 100%);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(181, 0, 91, .55), 0 0 0 3px rgba(255, 255, 255, .85);
  transition: transform var(--transition), box-shadow var(--transition);
}

.pin-body:hover {
  transform: rotate(-45deg) scale(1.1);
  box-shadow: 0 6px 22px rgba(181, 0, 91, .7), 0 0 0 3px white;
}

.pin-body span {
  transform: rotate(45deg);
  font-size: 18px;
  display: block;
  line-height: 1;
}

.pin-pulse {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(181, 0, 91, .25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: translateX(-50%) scale(1);
    opacity: .8;
  }

  70% {
    transform: translateX(-50%) scale(2.2);
    opacity: 0;
  }

  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0;
  }
}

/* ── Leaflet overrides ───────────────────────── */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-shadow: var(--shadow-lg) !important;
  border: none !important;
  min-width: 290px;
  max-width: 320px;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: auto !important;
}

.leaflet-popup-tip-container {
  margin-top: -1px;
}

.leaflet-popup-tip {
  background: var(--white) !important;
}

.leaflet-popup-close-button {
  color: var(--choco) !important;
  font-size: 20px !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 26px !important;
  right: 10px !important;
  top: 10px !important;
  background: rgba(255, 255, 255, .8) !important;
  border-radius: 50% !important;
  z-index: 10;
}

/* ── Popup card ──────────────────────────────────────── */
.popup-card {
  font-family: 'Outfit', sans-serif;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── Popup photo banner ──────────────────────────────── */
.popup-foto {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: var(--gray-200);
}

.popup-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .35s ease;
}

.popup-foto img:hover {
  transform: scale(1.04);
}

.popup-header {
  background: linear-gradient(135deg, var(--choco) 0%, var(--choco-mid) 100%);
  padding: 18px 20px 14px;
  position: relative;
}

.popup-header .popup-emoji {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
  display: block;
}

.popup-header h2 {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  padding-right: 24px;
}

.popup-header .popup-tag {
  display: inline-block;
  margin-top: 6px;
  background: rgba(181, 0, 91, .75);
  color: rgba(255, 255, 255, .95);
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 50px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.popup-body {
  padding: 16px 20px 6px;
}

.popup-info-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 10px;
  font-size: .85rem;
  color: var(--choco-mid);
  line-height: 1.4;
}

.popup-info-row .pi-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.popup-info-row span {
  color: var(--choco);
  font-weight: 500;
}

.popup-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 0 14px;
}

/* ── Popup Buttons ───────────────────────────── */
.popup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 20px 18px;
}

/* Quando não há WhatsApp, o botão de GPS ocupa a linha inteira */
.popup-actions.single-btn {
  grid-template-columns: 1fr;
}

.btn-popup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  padding: 12px 8px;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  letter-spacing: .2px;
}

.btn-popup:active {
  transform: scale(.96);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #1db954 0%, #128c3e 100%);
  color: white;
  box-shadow: 0 3px 12px rgba(19, 185, 84, .35);
}

.btn-whatsapp:hover {
  filter: brightness(1.1);
  box-shadow: 0 5px 18px rgba(19, 185, 84, .5);
  transform: translateY(-1px);
}

.btn-maps {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: white;
  box-shadow: 0 3px 12px rgba(181, 0, 91, .35);
}

.btn-maps:hover {
  filter: brightness(1.1);
  box-shadow: 0 5px 18px rgba(181, 0, 91, .5);
  transform: translateY(-1px);
}

.btn-popup .btn-icon {
  font-size: 20px;
  line-height: 1;
}

.btn-popup .btn-label {
  line-height: 1;
}

/* ── Instagram row (optional) ────────────────── */
.popup-instagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--gray-100);
  padding: 9px 20px;
  font-size: .8rem;
  color: var(--choco-mid);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition);
}

.popup-instagram:hover {
  background: var(--gray-200);
}

.popup-instagram .ig-icon {
  font-size: 16px;
}

/* ── Attribution override ────────────────────── */
.leaflet-control-attribution {
  font-size: .65rem !important;
  background: rgba(255, 255, 255, .7) !important;
}

/* ── Loader ──────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, var(--choco) 0%, var(--choco-mid) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity .5s, visibility .5s;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-icon {
  font-size: 56px;
  animation: bounce 1.2s ease-in-out infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-12px) scale(1.08);
  }
}

.loader-text {
  color: rgba(255, 255, 255, .85);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .5px;
}

.loader-bar {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, .15);
  border-radius: 99px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--pink-light));
  border-radius: 99px;
  animation: loadbar 1.5s ease-in-out forwards;
}

@keyframes loadbar {
  0% {
    width: 0%;
  }

  100% {
    width: 100%;
  }
}

/* ── Leaflet zoom controls ───────────────────── */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: white !important;
  color: var(--choco) !important;
  font-size: 18px !important;
  line-height: 30px !important;
  width: 34px !important;
  height: 34px !important;
  border: none !important;
  font-weight: 600 !important;
}

.leaflet-control-zoom a:hover {
  background: var(--gray-100) !important;
}

/* ── User location dot ───────────────────────── */
.user-dot {
  position: relative;
  width: 22px;
  height: 22px;
}

.user-dot-inner {
  position: absolute;
  inset: 4px;
  background: #1a73e8;
  border-radius: 50%;
  border: 2.5px solid white;
  box-shadow: 0 2px 8px rgba(26, 115, 232, .5);
  z-index: 2;
}

.user-dot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(26, 115, 232, .25);
  animation: user-pulse 2s ease-out infinite;
  z-index: 1;
}

@keyframes user-pulse {
  0% {
    transform: scale(1);
    opacity: .8;
  }

  70% {
    transform: scale(2.4);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* ── Locate button (header) ──────────────────── */
.btn-locate {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .1);
  border: 1.5px solid rgba(255, 255, 255, .25);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.btn-locate:hover {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .5);
  transform: translateY(-1px);
}

.btn-locate:active {
  transform: scale(.96);
}

/* ── Footer CTA ─────────────────────────────── */
#footer-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--choco) 0%, var(--choco-mid) 100%);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .3);
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.footer-text {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.footer-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}

.footer-text strong {
  display: block;
  color: var(--white);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.footer-text p {
  color: rgba(255, 255, 255, .55);
  font-size: .75rem;
  font-weight: 400;
  margin-top: 2px;
  white-space: nowrap;
}

.btn-revenda {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1db954 0%, #128c3e 100%);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  padding: 4px 20px;
  border-radius: 50px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(19, 185, 84, .4);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.btn-revenda::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
  transform: skewX(-20deg);
  animation: shimmer 2.8s infinite;
}

@keyframes shimmer {
  0% {
    left: -75%;
  }

  60% {
    left: 125%;
  }

  100% {
    left: 125%;
  }
}

.btn-revenda:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 22px rgba(19, 185, 84, .55);
  transform: translateY(-1px);
}

.btn-revenda:active {
  transform: scale(.96);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 480px) {
  #header {
    padding: 10px 16px;
  }

  #header .logo-text h1 {
    font-size: 1.05rem;
  }

  .leaflet-popup-content-wrapper {
    max-width: 280px !important;
    min-width: 260px !important;
  }

  .popup-actions {
    padding: 0 14px 14px;
    gap: 8px;
  }

  .popup-body {
    padding: 12px 14px 4px;
  }

  .popup-header {
    padding: 14px 14px 10px;
  }

  #footer-cta {
    padding: 0 14px;
    gap: 10px;
  }

  .footer-text p {
    display: none;
    /* Oculta subtítulo em telas pequenas */
  }

  .footer-text strong {
    font-size: .8rem;
  }

  .btn-revenda {
    font-size: .78rem;
    padding: 4px 14px;
  }
}