/* Catálogo — mapa fullscreen premium (Leaflet + pin central) */

#mapaFullscreen {
  width: 100%;
  height: 100%;
  background: #e8edf2;
}

.pf-map-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  background: #e8edf2;
  z-index: 9999;
  display: none;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: border-box;
}

.pf-map-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.pf-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ─── Pin fijo al centro (el mapa se mueve debajo) ─── */
.pf-map-center-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 600;
  width: 0;
  height: 0;
  pointer-events: none;
  transform: translate(-50%, -100%);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.pf-map-center-pin.is-lift {
  transform: translate(-50%, calc(-100% - 10px));
}

.pf-map-center-pin__pulse {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  border-radius: 50%;
  background: rgba(225, 48, 48, 0.18);
  animation: pf-map-pulse 2s ease-out infinite;
}

.pf-map-center-pin__dot {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: var(--pf-primary, #e13030);
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(225, 48, 48, 0.45);
  z-index: 2;
}

.pf-map-center-pin__stick {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 10px;
  margin-left: -1.5px;
  background: var(--pf-primary, #e13030);
  border-radius: 2px;
  z-index: 1;
}

.pf-map-center-pin__shadow {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 14px;
  height: 4px;
  margin-left: -7px;
  background: rgba(15, 23, 42, 0.22);
  border-radius: 50%;
  filter: blur(1px);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.pf-map-center-pin.is-lift .pf-map-center-pin__shadow {
  transform: scale(0.75);
  opacity: 0.45;
}

@keyframes pf-map-pulse {
  0% { transform: scale(0.65); opacity: 0.7; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ─── Barra superior flotante (glass) ─── */
.pf-map-top {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 1001;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
  pointer-events: none;
}

.pf-map-top > * {
  pointer-events: auto;
}

.pf-map-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #0f172a;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-map-search-float {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 4px 4px 4px 12px;
}

.pf-map-search-float__icon {
  color: #94a3b8;
  font-size: 14px;
  flex-shrink: 0;
}

.pf-map-search-float input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 10px;
  font-size: 15px;
  color: #0f172a;
}

.pf-map-search-float input::placeholder {
  color: #94a3b8;
}

.pf-map-search-gps {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: rgba(225, 48, 48, 0.08);
  color: var(--pf-primary, #e13030);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pf-map-search-gps:hover,
.pf-map-search-gps:focus-visible {
  background: rgba(225, 48, 48, 0.14);
}

.pf-map-search-gps.is-loading {
  animation: pf-map-gps-spin 0.8s linear infinite;
}

@keyframes pf-map-gps-spin {
  to { transform: rotate(360deg); }
}

/* Autocompletado */
.pf-map-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(226, 232, 240, 0.9);
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
}

.pf-map-suggest[hidden] {
  display: none !important;
}

.pf-map-suggest__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.35;
  color: #0f172a;
  cursor: pointer;
}

.pf-map-suggest__item:hover,
.pf-map-suggest__item.is-active {
  background: rgba(225, 48, 48, 0.06);
}

.pf-map-suggest__item i {
  color: var(--pf-primary, #e13030);
  margin-top: 2px;
  flex-shrink: 0;
}

/* ─── Bottom sheet ─── */
.pf-map-bottom-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(248, 250, 252, 0.98) 78%, rgba(248, 250, 252, 0));
  pointer-events: none;
}

.pf-map-bottom-sheet > * {
  pointer-events: auto;
}

.pf-map-bottom-sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  margin: 0 auto 10px;
}

.pf-map-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  margin-bottom: 10px;
}

.pf-map-card__label {
  font-size: 11px;
  font-weight: 800;
  color: var(--pf-primary, #e13030);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pf-map-card__text {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
  min-height: 2.9em;
}

.pf-map-card.is-loading .pf-map-card__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.pf-map-skeleton {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
  background-size: 200% 100%;
  animation: pf-map-shimmer 1.2s ease-in-out infinite;
}

.pf-map-skeleton--short {
  width: 72%;
}

@keyframes pf-map-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.pf-map-footer {
  position: static;
}

.pf-map-confirm {
  width: 100%;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff1a3d, var(--pf-primary, #e13030));
  color: #fff;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(225, 48, 48, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
}

.pf-map-confirm:active {
  transform: scale(0.98);
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12) !important;
  border-radius: 12px !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  border: none !important;
  color: #0f172a !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
}

@media (min-width: 769px) {
  .pf-map-bottom-sheet {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(480px, calc(100% - 32px));
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .pf-map-bottom-sheet__handle {
    display: none;
  }
}

@media (max-width: 768px) {
  .pf-map-top {
    flex-direction: column;
    align-items: stretch;
  }

  .pf-map-close {
    align-self: flex-start;
  }

  .pf-map-card__text {
    font-size: 16px;
  }

  .pf-map-confirm {
    min-height: 54px;
    font-size: 17px;
  }
}
