/* =====================================================================
   map.css — Mapa a pantalla grande con panel de filtros y resultados.
   CSS PURO, estética "clay". Tokens de home-preview.css / ph-skin.
   Los marcadores reutilizan .phmk / .phmk-rate (home-preview.css).
   ===================================================================== */

.mp-main { padding: clamp(14px, 2vw, 24px); min-width: 0; }

/* Alto útil: viewport menos chrome (topbar + tabbar) y el padding del main.
   Con dvh el alto no salta cuando el navegador móvil colapsa su barra. */
.mp-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 14px;
  height: calc(100dvh - var(--topbar-h, 64px) - var(--tabbar-h, 50px) - clamp(28px, 4vw, 48px));
  min-height: 520px;
}

/* ---- Panel lateral ---- */
.mp-side {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface, #fff); border: 1px solid var(--line, #e4e0d6);
  border-radius: 16px; overflow: hidden;
}
.mp-side-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line, #e4e0d6); }
.mp-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 6px;
  color: var(--accent, #b05f44); font: 700 10px/1 "Work Sans", sans-serif;
  text-transform: uppercase; letter-spacing: .14em;
}
.mp-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px var(--accent-soft, #f4e7df); }
.mp-title { margin: 0; font: 800 1.3rem "Outfit", sans-serif; letter-spacing: -.03em; color: var(--ink, #16150f); }

/* Filtros */
.mp-filters {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line, #e4e0d6);
}
.mp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mp-field-label { font: 600 9.5px/1 "Work Sans", sans-serif; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-mute, #9a968b); }
.mp-select {
  appearance: none; -webkit-appearance: none;
  min-height: 38px; width: 100%; padding: 0 30px 0 12px; box-sizing: border-box;
  border: 1px solid var(--line, #e4e0d6); border-radius: 999px;
  background: var(--surface, #fff); color: var(--ink, #16150f);
  font: 600 13px "Work Sans", sans-serif; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f6b60' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  text-overflow: ellipsis;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mp-select:hover { border-color: var(--accent, #b05f44); }
.mp-select:focus { outline: none; border-color: var(--accent, #b05f44); box-shadow: 0 0 0 3px var(--accent-soft, #f4e7df); }

.mp-filters-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.mp-apply, .mp-clear {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 15px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font: 700 12.5px "Work Sans", sans-serif;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.mp-apply { flex: 1; border: 1px solid var(--accent, #b05f44); background: var(--accent, #b05f44); color: #fff; }
.mp-apply:hover { background: var(--accent-press, #974c33); }
.mp-clear { border: 1px solid var(--line, #e4e0d6); background: var(--surface, #fff); color: var(--ink-soft, #6f6b60); }
.mp-clear:hover { color: var(--ink, #16150f); border-color: var(--line-strong, #d6d1c4); }
.mp-apply [data-lucide], .mp-clear [data-lucide] { width: 14px; height: 14px; }

/* Contador + encuadrar */
.mp-count {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 18px; border-bottom: 1px solid var(--line, #e4e0d6);
  font: 500 12.5px "Work Sans", sans-serif; color: var(--ink-soft, #6f6b60);
}
.mp-count b { color: var(--ink, #16150f); font-weight: 700; }
.mp-fit {
  display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto;
  border: 1px solid var(--line, #e4e0d6); border-radius: 50%;
  background: var(--surface, #fff); color: var(--ink-soft, #6f6b60); cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.mp-fit:hover { color: var(--accent, #b05f44); border-color: var(--accent, #b05f44); }
.mp-fit [data-lucide] { width: 15px; height: 15px; }

/* ---- Lista de resultados (el panel scrollea, no la página) ---- */
.mp-results { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.mp-item {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) 26px;
  align-items: center; gap: 11px;
  padding: 10px 14px 10px 12px; cursor: pointer;
  border-bottom: 1px solid var(--line, #e4e0d6);
  border-left: 3px solid transparent;
  transition: background .15s ease, border-left-color .15s ease;
}
.mp-item:last-child { border-bottom: 0; }
.mp-item:hover { background: var(--bg, #f6f4ef); }
.mp-item:focus-visible { outline: 2px solid var(--accent, #b05f44); outline-offset: -2px; }
/* Resultado enfocado en el mapa */
.mp-item.is-active { background: var(--accent-soft, #f4e7df); border-left-color: var(--accent, #b05f44); }
.mp-item-thumb { width: 54px; height: 54px; border-radius: 11px; overflow: hidden; background: var(--skeleton, #eeebe5); border: 1px solid var(--line, #e4e0d6); }
.mp-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-item-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-item-name { font: 700 13.5px "Outfit", sans-serif; color: var(--ink, #16150f); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-item-sub {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font: 500 11.5px "Work Sans", sans-serif; color: var(--ink-mute, #9a968b);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-item-cat {
  flex: 0 0 auto; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft, #f4e7df); color: var(--accent-press, #974c33);
  font: 700 9.5px "Work Sans", sans-serif; text-transform: uppercase; letter-spacing: .05em;
}
.mp-item-facts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.mp-item-rate { display: inline-flex; align-items: center; gap: 4px; font: 700 12px "Outfit", sans-serif; color: var(--ink, #16150f); }
.mp-item-price { font: 700 11.5px "Outfit", sans-serif; color: var(--accent, #b05f44); }
.mp-item-city { display: inline-flex; align-items: center; gap: 3px; font: 500 11px "Work Sans", sans-serif; color: var(--ink-mute, #9a968b); }
.mp-item-city [data-lucide] { width: 11px; height: 11px; }
.mp-item-go {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  color: var(--ink-mute, #9a968b); text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.mp-item-go:hover { background: var(--accent, #b05f44); color: #fff; }
.mp-item-go [data-lucide] { width: 14px; height: 14px; }

/* ---- Mapa ---- */
.mp-map-wrap {
  position: relative; min-width: 0; min-height: 0;
  border: 1px solid var(--line, #e4e0d6); border-radius: 16px; overflow: hidden;
  background: var(--skeleton, #eeebe5);
}
.mp-map { width: 100%; height: 100%; z-index: 0; }
/* Popup del marcador en lenguaje clay */
.mp-map .leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 14px 30px -16px rgba(22,21,15,.5); }
.mp-map .leaflet-popup-content { margin: 11px 14px; font: 500 13px "Work Sans", sans-serif; color: var(--ink, #16150f); }
.mp-pop strong { font: 800 14px "Outfit", sans-serif; letter-spacing: -.02em; }
.mp-pop-link {
  display: inline-block; margin-top: 8px; padding: 5px 12px; border-radius: 999px;
  background: var(--accent, #b05f44); color: #fff !important;
  font: 700 11.5px "Work Sans", sans-serif; text-decoration: none;
}
.mp-pop-link:hover { background: var(--accent-press, #974c33); }

/* ---- Estado vacío ---- */
.mp-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 22px; }
.mp-empty-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft, #f4e7df); color: var(--accent, #b05f44); }
.mp-empty-ic [data-lucide] { width: 24px; height: 24px; }
.mp-empty p { margin: 0; font: 400 13.5px/1.6 "Work Sans", sans-serif; color: var(--ink-soft, #6f6b60); max-width: 32ch; }
.mp-btn {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--accent, #b05f44); color: #fff; text-decoration: none;
  font: 700 12.5px "Work Sans", sans-serif;
}
.mp-btn:hover { background: var(--accent-press, #974c33); }

/* ---- Responsive: el mapa arriba y la lista debajo ---- */
@media (max-width: 1000px) {
  .mp-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 320px auto;
    height: auto; min-height: 0;
  }
  /* El mapa primero: es el motivo de la página */
  .mp-map-wrap { order: -1; }
  .mp-results { max-height: 60vh; }
}
@media (max-width: 560px) {
  .mp-filters { grid-template-columns: 1fr; }
  .mp-layout { grid-template-rows: 260px auto; }
}

/* ---- Dropdown custom en los filtros del sidebar (.ph-select) ----
   Misma pastilla que tenían los <select> nativos de esta columna. */
.mp-field .ph-select { width: 100%; }
.mp-field .ph-select-trigger {
  height: 38px; border-radius: 999px; padding: 0 12px;
  font: 600 13px "Work Sans", sans-serif;
}
.mp-field .ph-select-value { overflow: hidden; text-overflow: ellipsis; }

/* ---- Marcador de restaurante con varios platos ---- */
.phmk-count {
  position: absolute; top: -4px; left: -4px; z-index: 3;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--ink, #16150f); color: #fff; border: 2px solid #fff;
  font: 700 10.5px/1 "Work Sans", sans-serif;
}

/* ---- Globo: ficha completa del plato ---- */
.mp-pop-wrap .leaflet-popup-content-wrapper { border-radius: 16px; padding: 0; overflow: hidden; }
.mp-pop-wrap .leaflet-popup-content { margin: 0; width: auto !important; }
.mp-pop { display: block; }
.mp-pop-photo { display: block; width: 100%; height: 132px; object-fit: cover; }
.mp-pop-body { padding: 12px 14px 14px; }
.mp-pop-rest {
  display: block; font: 700 10.5px "Work Sans", sans-serif; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent, #b05f44); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-pop-rest:hover { color: var(--accent-press, #974c33); text-decoration: underline; }
.mp-pop-dish {
  display: block; margin-top: 3px;
  font: 800 16px/1.15 "Outfit", sans-serif; letter-spacing: -.02em; color: var(--ink, #16150f);
}
.mp-pop-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mp-pop-facts span {
  padding: 3px 8px; border-radius: 999px; background: var(--bg, #f6f4ef);
  font: 600 11px "Work Sans", sans-serif; color: var(--ink-soft, #6f6b60);
}
.mp-pop-facts .mp-pop-rate { background: var(--accent-soft, #f4e7df); color: var(--accent-press, #974c33); }
.mp-pop-facts .mp-pop-price { color: var(--ink, #16150f); font-weight: 700; }
.mp-pop-desc {
  margin: 9px 0 0; font: 400 12px/1.45 "Work Sans", sans-serif; color: var(--ink-soft, #6f6b60);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mp-pop-link {
  display: block; margin-top: 11px; text-align: center;
  min-height: 36px; line-height: 36px; border-radius: 999px;
  background: var(--accent, #b05f44); color: #fff !important;
  font: 700 13px "Work Sans", sans-serif; text-decoration: none;
}
.mp-pop-link:hover { background: var(--accent-press, #974c33); }

/* Los otros platos del mismo restaurante */
.mp-pop-more { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line, #e4e0d6); }
.mp-pop-more-lbl {
  display: block; margin-bottom: 7px;
  font: 600 10px "Work Sans", sans-serif; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-mute, #9a968b);
}
.mp-pop-alt {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 6px;
  border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left;
  font: 600 12.5px "Work Sans", sans-serif; color: var(--ink, #16150f);
  transition: background .14s ease;
}
.mp-pop-alt:hover { background: var(--bg, #f6f4ef); }
.mp-pop-alt img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.mp-pop-alt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Buscador de texto del mapa ---- */
/* Fila entera: es el filtro que más se usa y el que necesita sitio para leer. */
.mp-field-wide { grid-column: 1 / -1; }
.mp-search {
  position: relative; display: flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 10px 0 12px;
  border: 1px solid var(--line, #e4e0d6); border-radius: 12px;
  background: var(--surface, #fff);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mp-search:focus-within { border-color: var(--accent, #b05f44); box-shadow: 0 0 0 3px rgba(176,95,68,.12); }
.mp-search > [data-lucide], .mp-search > svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--ink-mute, #9a968b); }
.mp-search input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 0;
  font: 500 13.5px "Work Sans", sans-serif; color: var(--ink, #16150f);
}
.mp-search input::placeholder { color: var(--ink-mute, #9a968b); font-weight: 400; }
/* El aspa nativa del type=search estorba: se quita y se usa el enlace, que
   además limpia el parámetro de la URL en vez de solo vaciar la caja. */
.mp-search input::-webkit-search-cancel-button { display: none; }
.mp-search-x {
  display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto;
  border-radius: 50%; color: var(--ink-mute, #9a968b); text-decoration: none;
  transition: background .14s ease, color .14s ease;
}
.mp-search-x:hover { background: var(--bg, #f6f4ef); color: var(--ink, #16150f); }
.mp-search-x [data-lucide], .mp-search-x svg { width: 13px; height: 13px; }

/* ══════════════════════════════════════════════════════════════════════
   MÓVIL · MAPA A PANTALLA COMPLETA (diseño de la app)
   El mapa deja de ser una franja de 260px arriba con un formulario largo
   debajo: pasa a ocupar todo el hueco entre la cabecera y la barra inferior,
   con los filtros flotando arriba y los resultados en una hoja inferior con
   carrusel horizontal. Mismo markup, misma lista: solo cambia dónde vive.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .mp-main { padding: 0; }
  /* Alto exacto del hueco libre: sin scroll de página, el mapa manda. */
  .mp-layout {
    display: block; position: relative; gap: 0;
    height: calc(100dvh - var(--topbar-h, 56px) - var(--mnav-h, 58px) - var(--sab, 0px));
    min-height: 0;
  }
  .mp-map-wrap { position: absolute; inset: 0; border: 0; border-radius: 0; }

  /* ---- Filtros flotando sobre el mapa ----
     position:FIXED, no absolute: .mp-side es la hoja inferior y ya está
     posicionada, así que un absolute se anclaría a la hoja en vez de al mapa.
     Como esta pantalla mide justo un viewport y no scrollea, fixed se comporta
     igual que absolute pero tomando como referencia la pantalla. */
  .mp-filters {
    position: fixed; left: 0; right: 0; z-index: 40;
    top: calc(var(--topbar-h, 56px) + var(--sat, 0px));
    display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
    padding: 12px 14px; border-bottom: 0;
    overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .mp-filters::-webkit-scrollbar { width: 0; height: 0; }
  /* Cada filtro es una pastilla flotante: etiqueta y control en la misma línea
     (en vertical robarían el doble de alto sobre el mapa). */
  .mp-field {
    flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px;
    min-height: 40px; padding: 0 6px 0 13px;
    background: var(--surface, #fff); border: 1px solid var(--line, #e4e0d6);
    border-radius: 999px; box-shadow: 0 2px 10px rgba(22, 21, 15, .12);
  }
  .mp-field-label { flex: 0 0 auto; }
  /* El control ya va dentro de la pastilla: pierde su propio borde. */
  .mp-select,
  .mp-field .ph-select-trigger {
    border: 0; background-color: transparent; box-shadow: none;
    min-height: 38px; padding-left: 0; width: auto; min-width: 0;
  }
  .mp-select:focus, .mp-field .ph-select-trigger:focus { box-shadow: none; }
  .mp-field-wide { flex: 0 0 auto; width: min(62vw, 260px); }
  .mp-field-wide .mp-search { border: 0; background: none; box-shadow: none; min-height: 38px; padding: 0; }
  .mp-filters-actions { grid-column: auto; flex: 0 0 auto; }
  .mp-apply, .mp-clear { box-shadow: 0 2px 10px rgba(22, 21, 15, .12); min-height: 40px; }

  /* ---- Hoja inferior con los resultados ---- */
  .mp-side {
    position: absolute; left: 0; right: 0; bottom: 0; top: auto; z-index: 7;
    max-height: 46%;
    border: 0; border-top: 1px solid var(--line, #e4e0d6);
    border-radius: 22px 22px 0 0; padding-top: 12px;
    box-shadow: 0 -16px 48px -20px rgba(22, 21, 15, .45);
  }
  .mp-side::before {
    content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 999px; background: var(--line-strong, #d6d1c4);
  }
  /* El título de la página lo sustituye el propio contador: en una hoja de
     16 líneas de alto, "Mapa de platos" solo gasta sitio. */
  .mp-side-head { display: none; }
  .mp-count { border-bottom: 0; padding: 6px 16px 10px; }

  /* Resultados en carrusel horizontal, como las fichas del diseño. */
  .mp-results {
    flex: 0 0 auto; display: flex; gap: 12px;
    overflow-x: auto; overflow-y: hidden;
    padding: 0 16px calc(14px + var(--sab, 0px));
  }
  .mp-item {
    flex: 0 0 auto; width: 200px;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px; padding: 9px;
    background: var(--bg, #f6f4ef); border: 1px solid var(--line, #e4e0d6);
    border-radius: 14px; border-left-width: 1px;
  }
  .mp-item:last-child { border-bottom: 1px solid var(--line, #e4e0d6); }
  .mp-item.is-active { background: var(--accent-soft, #f4e7df); border-color: var(--accent, #b05f44); }
  .mp-item-thumb { width: 52px; height: 52px; }
  /* La flecha de "abrir" se cae: en la ficha corta manda el nombre, y el plato
     se abre igual desde el globo del marcador. */
  .mp-item-go { display: none; }
  .mp-item-facts { gap: 8px; flex-wrap: nowrap; overflow: hidden; }
  .mp-item-city { display: none; }
  /* Sin resultados no hay carrusel: el aviso ocupa la hoja entera. */
  .mp-empty { flex: 0 0 100%; padding: 22px 20px; }
}

@media (max-width: 768px) {
  /* Los controles de Leaflet viven en las esquinas del mapa y ahí ahora hay
     cosas: arriba los filtros flotantes y abajo la hoja de resultados. El zoom
     baja hasta debajo de los filtros y la atribución de OpenStreetMap sube a su
     lado — tiene que seguir VISIBLE (lo exige la licencia de los mosaicos), y
     detrás de la hoja no lo estaría. */
  .mp-map .leaflet-top { top: 70px; }
  .mp-map .leaflet-bottom.leaflet-right { top: 70px; bottom: auto; }
  .mp-map .leaflet-control-attribution { font-size: 9px; border-radius: 8px 0 0 8px; }
}

/* Recorte de la lista a lo que se ve en el mapa (lo hace el JS). El atributo
   hidden no gana a un display explícito, así que hay que decirlo aquí. */
.mp-results .mp-item[hidden],
.mp-results .mp-zona-vacia[hidden] { display: none; }

/* ======================================================================
   El mapa como la app (php/pages/map.php + js/mapa.js), 21-10-2026.
   Clases .ymp-. Lo de arriba (.mp-*) es de la página anterior,
   php/pages/map_antes.php, y se queda para poder volver a ella.
   ====================================================================== */

.ymp-main { padding: 16px var(--gutter); min-width: 0; }
.ymp {
  position: relative; isolation: isolate; overflow: hidden;
  height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - 32px);
  height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - 32px);
  min-height: 520px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface-dim, #efece4);
}
.ymp-mapa { position: absolute; inset: 0; z-index: 0; }
.ymp .leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, 0.75); }
.ymp .leaflet-top.leaflet-right { top: 6px; right: 6px; }

/* ---------- Arriba: buscador, filtros y estado ---------- */
.ymp-arriba {
  position: absolute; top: 14px; left: 14px; right: 14px; z-index: 1100; max-width: 560px;
  display: grid; gap: 10px; pointer-events: none;
}
.ymp-arriba > * { pointer-events: auto; }
.ymp-buscar {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 20px -8px rgba(22, 21, 15, 0.3); cursor: text;
}
.ymp-buscar > [data-lucide] { width: 19px; height: 19px; color: var(--ink-soft); flex: none; }
.ymp-buscar input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font: 500 16px "Work Sans", sans-serif; }
.ymp-buscar input::-webkit-search-cancel-button { display: none; }
.ymp-buscar:focus-within { border-color: var(--accent); }
.ymp-buscar-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-dim, #efece4); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.ymp-buscar-x[hidden] { display: none; }
.ymp-buscar-x [data-lucide] { width: 16px; height: 16px; }
.ymp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ymp-desplegable { position: relative; }
.ymp-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 16px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: 0 4px 14px -8px rgba(22, 21, 15, 0.35);
  font: 600 15px "Work Sans", sans-serif; max-width: 70vw;
}
.ymp-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ymp-chip [data-lucide] { width: 16px; height: 16px; flex: none; }
.ymp-chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-press); }
.ymp-chip.is-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.ymp-chip[hidden] { display: none; }
.ymp-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 2; min-width: 240px; max-height: min(60vh, 460px); overflow-y: auto;
  padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px -14px rgba(22, 21, 15, 0.4);
}
.ymp-menu[hidden] { display: none; }
.ymp-op {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--ink); text-align: left; cursor: pointer; font: 500 14.5px "Work Sans", sans-serif;
}
.ymp-op:hover { background: var(--surface-dim, #efece4); }
.ymp-op.is-on { background: var(--accent-soft); color: var(--accent-press); font-weight: 700; }
.ymp-op.is-vacio { opacity: 0.55; }
.ymp-op b { flex: 1; font-weight: inherit; }
.ymp-op em { font-style: normal; color: var(--ink-mute); font-size: 12.5px; }
.ymp-op [data-lucide] { width: 15px; height: 15px; color: var(--ink-soft); transition: transform 0.2s ease; }
.ymp-grupo-op.is-abierto > .ymp-op [data-lucide] { transform: rotate(180deg); }
.ymp-hojas { margin: 2px 0 6px 18px; padding-left: 8px; border-left: 2px solid var(--line); }
.ymp-hojas .ymp-op { padding: 8px 10px; font-size: 14px; }
.ymp-estado {
  justify-self: start; padding: 9px 16px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 14px -8px rgba(22, 21, 15, 0.35); font: 600 14px "Work Sans", sans-serif; cursor: default;
}
.ymp-estado[hidden] { display: none; }
.ymp-estado.is-error { color: var(--danger); cursor: pointer; }

/* ---------- Botones flotantes ---------- */
.ymp-flotantes { position: absolute; right: 14px; bottom: 100px; z-index: 1100; display: grid; gap: 10px; transition: bottom 0.25s ease, right 0.25s ease; }
.ymp-redondo {
  width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.ymp-redondo:first-child { color: var(--accent); }
.ymp-redondo [data-lucide] { width: 21px; height: 21px; }
.ymp.con-carrusel .ymp-flotantes { bottom: 296px; }
.ymp.con-lista .ymp-flotantes { right: calc(min(380px, 42%) + 28px); }

/* ---------- Barra de reposo ---------- */
.ymp-barra {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 1100; max-width: 560px;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px -10px rgba(22, 21, 15, 0.35);
}
.ymp-barra-txt { flex: 1; min-width: 0; display: grid; }
.ymp-barra-txt strong { font: 700 16px/1.25 "Outfit", sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ymp-barra-txt small { color: var(--ink-soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ymp-barra-btn { height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent); cursor: pointer; font: 700 14.5px "Work Sans", sans-serif; white-space: nowrap; }
.ymp-barra-btn:hover { background: var(--accent-soft); }
.ymp.con-carrusel .ymp-barra { display: none; }

/* ---------- Carrusel de un restaurante ---------- */
.ymp-carrusel { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 1150; }
.ymp-carrusel[hidden] { display: none; }
.ymp.con-lista .ymp-carrusel { right: calc(min(380px, 42%) + 14px); }
.ymp-carrusel-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; }
.ymp-sitio {
  display: inline-flex; align-items: center; gap: 7px; max-width: 70%; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 4px 14px -8px rgba(22, 21, 15, 0.4); font: 700 15px "Work Sans", sans-serif;
}
.ymp-sitio span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ymp-sitio [data-lucide] { width: 15px; height: 15px; color: var(--accent); flex: none; }
.ymp-cerrar { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--surface); color: var(--ink); box-shadow: 0 4px 14px -8px rgba(22, 21, 15, 0.4); }
.ymp-cerrar [data-lucide] { width: 18px; height: 18px; }
.ymp-tira {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px 4px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-left: 14px; scrollbar-width: none;
}
.ymp-tira::-webkit-scrollbar { display: none; }
.ymp-tarjeta {
  flex: 0 0 300px; scroll-snap-align: start; display: grid; gap: 8px; padding: 8px; border-radius: 20px;
  border: 1px solid transparent; transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.ymp-tarjeta.is-activa { background: var(--surface); border-color: var(--line); box-shadow: 0 12px 30px -14px rgba(22, 21, 15, 0.45); }
.ymp-tarjeta-foto, .ymp-publicar {
  position: relative; display: block; height: 150px; border-radius: 14px; overflow: hidden; isolation: isolate; text-decoration: none;
  transform: scale(0.88); transform-origin: bottom center; transition: transform 0.25s ease;
}
.ymp-tarjeta.is-activa .ymp-tarjeta-foto, .ymp-tarjeta.is-activa .ymp-publicar { transform: none; }
.ymp-tarjeta-foto { background: #2a261f; color: #fff; }
.ymp-tarjeta-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.ymp-tarjeta-foto::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(0, 0, 0, 0.05) 30%, rgba(0, 0, 0, 0.78) 100%); }
.ymp-tarjeta-foto .y-nota { position: absolute; top: 10px; right: 10px; }
.ymp-tarjeta-pie { position: absolute; left: 12px; right: 12px; bottom: 10px; display: grid; gap: 2px; }
.ymp-tarjeta-pie .y-ceja { font-size: 10.5px; letter-spacing: 0.16em; }
.ymp-tarjeta-pie strong { font: 800 19px/1.15 "Outfit", sans-serif; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ymp-tarjeta-pie small { font-size: 13px; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ymp-tarjeta-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.ymp-tarjeta.is-activa .ymp-tarjeta-botones { opacity: 1; pointer-events: auto; }
.ymp-tarjeta-botones .y-btn { min-height: 44px; padding: 0 12px; font-size: 15px; }
.ymp-publicar { display: grid; place-content: center; justify-items: center; gap: 4px; padding: 12px; text-align: center; color: var(--ink); background: var(--surface); border: 1.5px dashed var(--line-strong); }
.ymp-publicar-mas { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; margin-bottom: 4px; }
.ymp-publicar-mas [data-lucide] { width: 20px; height: 20px; }
.ymp-publicar strong { font: 700 15px "Outfit", sans-serif; }
.ymp-publicar small { color: var(--ink-soft); font-size: 12.5px; }

/* ---------- El listado ---------- */
.ymp-lista {
  position: absolute; top: 14px; right: 14px; bottom: 14px; z-index: 1200; width: min(380px, 42%);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px -14px rgba(22, 21, 15, 0.45);
}
.ymp-lista[hidden] { display: none; }
.ymp-lista-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.ymp-lista-cab > div { display: grid; gap: 8px; min-width: 0; }
.ymp-lista-cab strong { font: 700 16px/1.3 "Outfit", sans-serif; }
.ymp-lista-cab .ymp-cerrar { box-shadow: none; background: var(--surface-dim, #efece4); flex: none; }
.ymp-orden { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font: 600 13px "Work Sans", sans-serif; }
.ymp-orden select { height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 13.5px "Work Sans", sans-serif; }
.ymp-lista-cuerpo { flex: 1; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.ymp-fila { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: 14px; background: none; text-align: left; cursor: pointer; color: var(--ink); }
.ymp-fila:hover { background: var(--surface-dim, #efece4); }
.ymp-fila-foto { width: 58px; height: 58px; flex: none; border-radius: 12px; overflow: hidden; background: var(--surface-dim, #efece4); }
.ymp-fila-foto img { width: 100%; height: 100%; object-fit: cover; }
.ymp-fila-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ymp-fila-txt strong { font: 700 15px/1.25 "Outfit", sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ymp-fila-txt small, .ymp-fila-txt em { color: var(--ink-soft); font-size: 13px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ymp-fila-txt em { color: var(--ink-mute); font-size: 12.5px; }
.ymp-lista-vacia { display: grid; justify-items: center; gap: 10px; padding: 36px 20px; text-align: center; color: var(--ink-soft); }
.ymp-lista-vacia p { margin: 0; }

/* ---------- Chinchetas y grupos ---------- */
.ymp-pin-caja, .ymp-grupo-caja { background: none; border: 0; }
.ymp-pin { position: relative; width: var(--lado); height: calc(var(--lado) + 8px); cursor: pointer; }
.ymp-pin-foto {
  position: absolute; top: 0; left: 0; width: var(--lado); height: var(--lado); border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: #fff; color: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--accent), 0 4px 12px rgba(0, 0, 0, 0.3); transition: box-shadow 0.2s ease;
}
/* Con el peso de la regla de Leaflet (.leaflet-container .leaflet-marker-pane img
   pone width:auto): sin esto la foto sale a su tamaño real, recortada. */
.leaflet-marker-pane .ymp-pin-foto img, .ymp-pin-foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ymp-pin-foto svg { width: 50%; height: 50%; }
.ymp-pin-punta { position: absolute; left: 50%; bottom: 0; width: 0; height: 0; transform: translateX(-50%); border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--accent); }
.ymp-pin-nota {
  position: absolute; top: -9px; right: -18px; padding: 2px 7px; border-radius: 999px; background: #fff; color: #16150f;
  font: 800 12px/1.3 "Outfit", sans-serif; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); white-space: nowrap;
}
.ymp-pin-nota.is-oro { background: var(--gold); }
.ymp-pin-mas {
  position: absolute; left: -12px; bottom: 6px; padding: 1px 6px; border-radius: 999px; background: #16150f; color: #fff;
  border: 2px solid #fff; font: 700 11px/1.3 "Work Sans", sans-serif;
}
.ymp-pin.is-sel .ymp-pin-foto { border-width: 3px; box-shadow: 0 0 0 3px var(--accent), 0 0 0 11px rgba(196, 80, 49, 0.25), 0 6px 16px rgba(0, 0, 0, 0.32); }
.ymp-grupo {
  width: var(--lado); height: var(--lado); border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: #fff; border: 3px solid #fff; font: 800 15px "Outfit", sans-serif;
  box-shadow: 0 0 0 7px rgba(196, 80, 49, 0.22), 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ---------- Móvil: el mapa a sangre, como la app ---------- */
@media (max-width: 768px) {
  body.ymp-cuerpo { padding-bottom: 0; }
  .ymp-main { padding: 0; }
  .ymp { height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); min-height: 0; border-radius: 0; border: 0; }
  .ymp .leaflet-control-zoom { display: none; }
  .ymp-arriba { top: 10px; left: 10px; right: 10px; max-width: none; }
  .ymp-buscar { height: 48px; }
  .ymp-barra { left: 10px; right: 10px; max-width: none; bottom: calc(var(--mnav-h) + var(--sab) + 8px); }
  .ymp-flotantes { right: 10px; bottom: calc(var(--mnav-h) + var(--sab) + 92px); }
  .ymp.con-carrusel .ymp-flotantes { bottom: calc(var(--mnav-h) + var(--sab) + 268px); }
  .ymp.con-lista .ymp-flotantes { display: none; }
  .ymp-carrusel { bottom: calc(var(--mnav-h) + var(--sab) + 2px); }
  .ymp.con-lista .ymp-carrusel { right: 0; }
  .ymp-tarjeta { flex-basis: min(300px, 80vw); }
  .ymp-lista {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 62%;
    border-radius: 22px 22px 0 0; padding-bottom: calc(var(--mnav-h) + var(--sab));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ymp-tarjeta, .ymp-tarjeta-foto, .ymp-publicar, .ymp-tarjeta-botones, .ymp-flotantes { transition: none; }
}
