/* =====================================================================
   UBICACLICK v2 · Añadidos al mapa (cuenta, guardar, reseñas, cookies).
   Se carga después de app.css sin modificarlo y usa sus mismos tokens.
   ===================================================================== */

/* Botón de cuenta: misma familia visual que «Filtrar» */
.btn-account {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: var(--line);
  border-radius: 50%;
  box-shadow: var(--pop);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.btn-account[hidden] { display: none; }
.btn-account:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
@media (hover: hover) { .btn-account:hover { transform: translateY(-1px); } }
.btn-account__avatar { display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; }
.btn-account__avatar svg { width: 24px; height: 24px; }
.btn-account__avatar img { width: 100%; height: 100%; object-fit: cover; }
.btn-account__avatar.is-initial { font-weight: 800; font-size: 20px; color: #fff; background: var(--violet); }
.btn-account__badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 11px; font-weight: 800; line-height: 16px; text-align: center; color: #fff; background: var(--coral); border: 2px solid var(--ink); border-radius: 999px; }
.btn-account__badge[hidden] { display: none; }

.account-menu {
  position: absolute;
  z-index: 5;
  top: 64px;
  right: 0;
  width: min(300px, calc(100vw - 24px));
  padding: 8px;
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--pop-lg), var(--float);
  animation: uc-drop .22s var(--ease-out);
}
.account-menu[hidden] { display: none; }
.topbar__row { position: relative; }
.account-menu__head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 2px solid var(--mist); margin-bottom: 4px; }
.account-menu__head span { font-size: 14px; color: var(--ink-soft); }
.account-menu__warn { margin: 6px 4px; padding: 6px 8px; font-size: 13px; background: #FFF6D1; border-radius: 10px; }
.account-menu > a, .account-menu form button {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 10px; font-weight: 600; color: var(--ink); text-decoration: none; text-align: left;
  background: none; border: 0; border-radius: var(--r-sm); cursor: pointer;
}
.account-menu > a:hover, .account-menu form button:hover { background: var(--mist); }
.account-menu__cta { justify-content: center !important; margin: 6px 0; background: var(--turq) !important; color: #fff !important; border: var(--line) !important; border-radius: 999px !important; box-shadow: var(--pop); }
.account-menu__cta--sun { background: var(--sun) !important; color: var(--ink) !important; }
.account-menu__legal { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 10px 4px; margin-top: 4px; border-top: 2px solid var(--mist); font-size: 13px; }
.account-menu__legal a, .account-menu__legal button { padding: 0; color: var(--ink-soft); background: none; border: 0; font-size: 13px; text-decoration: underline; cursor: pointer; }
.pill-count { min-width: 22px; padding: 0 6px; font-size: 12px; font-weight: 800; color: #fff; background: var(--coral); border-radius: 999px; text-align: center; }

/* Ventana «Regístrate gratis» */
.gate { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; padding: 16px; background: rgba(29, 27, 58, .35); opacity: 0; transition: opacity .2s; }
.gate.is-open { opacity: 1; }
.gate[hidden] { display: none; }
.gate__card { width: min(420px, 100%); padding: 24px 22px 20px; text-align: center; background: var(--paper); border: var(--line); border-radius: var(--r-lg); box-shadow: 0 6px 0 var(--ink), var(--float); transform: translateY(16px) scale(.95); transition: transform .35s var(--ease-spring); }
.gate.is-open .gate__card { transform: none; }
.gate__emoji { margin: 0; font-size: 34px; }
.gate h2 { margin: 6px 0 8px; font-size: 21px; font-weight: 800; line-height: 1.2; }
.gate__reason { margin: 0 0 6px; color: var(--ink-soft); }
.gate__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.gate__btn { display: flex; align-items: center; justify-content: center; min-height: 50px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; font-size: 15px; color: var(--ink); text-decoration: none; background: var(--paper); border: var(--line); border-radius: 999px; box-shadow: var(--pop); cursor: pointer; }
.gate__btn--primary { background: var(--turq); color: #fff; }
.gate__btn--sun { background: var(--sun); }

/* Ficha: guardar junto a VISITAR */
.sheet__foot--v2 { display: flex; gap: 10px; align-items: stretch; }
.sheet__foot--v2 .btn--visit { flex: 1; }
.btn-save { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 74px; font-size: 12px; font-weight: 800; color: var(--ink); background: var(--paper); border: var(--line); border-radius: 18px; box-shadow: var(--pop); cursor: pointer; }
.btn-save svg { width: 24px; height: 24px; }
.btn-save.is-on { background: #FFE3E2; color: #C72D2A; }
.btn-save.is-on svg { fill: var(--coral); }
.btn-save.is-pop svg { animation: uc-pop .4s var(--ease-spring); }
.btn-save:disabled { opacity: .6; }
.chip-delivery { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; font-size: 12.5px; font-weight: 800; background: #E7FBF8; border: 2px solid var(--turq-deep); border-radius: 999px; }

/* Promociones: imagen, horario y condiciones */
.offer__img { display: block; width: 100%; height: 110px; margin-bottom: 8px; object-fit: cover; border: 2px solid var(--ink); border-radius: 12px; }
.offer__sched { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.offer__lock { margin: 6px 0 0; font-size: 13px; font-weight: 700; }
.offer__more { margin-top: 8px; padding: 0; font-weight: 700; font-size: 14px; color: var(--ink); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.offer__conditions { margin-top: 6px; padding: 8px 10px; font-size: 14px; background: rgba(255, 255, 255, .7); border-radius: 10px; }
.offer__conditions p { margin: 0 0 6px; }
.offer__go { font-weight: 800; color: var(--ink); }

/* Reseñas temporales */
.reviews { margin: 18px 20px 0; padding-top: 14px; border-top: 2px solid #E7E9F5; }
.reviews__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reviews__head h3 { margin: 0; font-size: 17px; }
.reviews__add { flex: none; padding: 7px 14px; font-weight: 800; font-size: 14px; background: var(--sun); border: var(--line); border-radius: 999px; box-shadow: 0 2px 0 var(--ink); cursor: pointer; }
.reviews__list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.reviews__empty { font-size: 14px; color: var(--ink-soft); }
.review { padding: 10px 12px; background: var(--mist); border-radius: 14px; }
.review p { margin: 4px 0 0; font-size: 15px; }
.review__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.review__stars { display: inline-flex; gap: 1px; }
.review__stars span { width: 16px; height: 16px; color: #C9CDE0; }
.review__stars span.on { color: #F5A400; }
.review__stars svg { width: 100%; height: 100%; fill: currentColor; }
.review__meta { font-size: 12.5px; color: var(--ink-soft); }
.reviews__form { margin-top: 10px; }
.review-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: #FFFBEA; border: 2px solid var(--ink); border-radius: 16px; }
.review-form__stars { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; border: 0; }
.review-form__stars legend { width: 100%; margin-bottom: 4px; font-weight: 700; font-size: 14px; }
.review-form__stars label { cursor: pointer; }
.review-form__stars input { position: absolute; opacity: 0; }
.review-form__stars span[aria-hidden] { display: block; width: 32px; height: 32px; color: #C9CDE0; transition: transform .15s; }
.review-form__stars svg { width: 100%; height: 100%; fill: currentColor; }
.review-form__stars label.on span[aria-hidden] { color: #F5A400; }
.review-form__stars input:focus-visible + span { outline: 3px solid var(--violet); border-radius: 6px; }
.review-form textarea { width: 100%; padding: 10px; font: inherit; border: 2px solid #B9BED6; border-radius: 12px; resize: vertical; }
.review-form__note { margin: 0; font-size: 13px; color: var(--ink-soft); }
.review-form__error { margin: 0; font-size: 14px; font-weight: 600; color: #B42318; }
.review-form__error[hidden] { display: none; }
.review-form__send { min-height: 46px; font-weight: 800; color: #fff; background: var(--turq); border: var(--line); border-radius: 999px; box-shadow: var(--pop); cursor: pointer; }
.review-form__send:disabled { opacity: .7; }

/* Banner de cookies en el mapa (mismo componente que en las páginas) */
.cookie-banner {
  position: fixed; z-index: 3000; left: 12px; right: 12px; bottom: 12px;
  display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
  max-width: 980px; margin: 0 auto; padding: 16px 18px;
  background: var(--paper); border: var(--line); border-radius: 22px;
  box-shadow: 0 5px 0 var(--ink), 0 20px 50px -20px rgba(29, 27, 58, .5);
  font-family: var(--font); color: var(--ink);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__main { flex: 1 1 360px; }
.cookie-banner h2 { margin: 0 0 4px; font-size: 18px; }
.cookie-banner p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.cookie-banner a { color: var(--turq-deep); }
.cookie-banner__prefs { margin-top: 10px; }
.cookie-banner__prefs[hidden] { display: none; }
.cookie-banner .check { display: flex; align-items: center; gap: 8px; min-height: 32px; font-weight: 600; font-size: 14px; }
.cookie-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-banner .btn { min-height: 42px; padding: 0 16px; font-size: 14.5px; font-weight: 700; color: var(--ink); background: var(--paper); border: var(--line); border-radius: 999px; box-shadow: var(--pop); cursor: pointer; }
.cookie-banner .btn[hidden] { display: none; }

/* En el mapa el banner no tapa la ficha (izquierda), los avisos ni los controles (abajo a la derecha) */
@media (min-width: 761px) {
  .cookie-banner { left: auto; right: 12px; bottom: calc(240px + var(--safe-bottom)); width: min(400px, calc(100% - 440px)); margin: 0; padding: 14px 16px; gap: 10px; }
  .cookie-banner__main { flex-basis: 100%; }
  .cookie-banner p { font-size: 13.5px; }
  .cookie-banner .btn { min-height: 38px; padding: 0 12px; font-size: 13.5px; }
}
@media (max-width: 760px) {
  .btn-account { width: 50px; height: 50px; }
  .account-menu { top: 58px; }
  .reviews { margin: 16px 16px 0; }
  .cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 12px 14px; gap: 8px; border-radius: 18px; }
  .cookie-banner h2 { font-size: 16px; }
  .cookie-banner p { font-size: 13px; }
  .cookie-banner__actions { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .cookie-banner__actions .btn { flex: 1 1 0; min-height: 40px; padding: 0 6px; font-size: 13px; }
  body.sheet-open .cookie-banner, body.filters-open .cookie-banner { display: none; }
}

/* v3 · Chat del local y valoración permanente en la ficha */
.sheet-chat { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 0; padding: 12px 14px; background: #F1EDFF; border: 2px solid var(--ink); border-radius: var(--r-md); }
.sheet-chat h3 { margin: 0; font-size: 16px; }
.sheet-chat p { margin: 2px 0 0; font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.sheet-chat .btn-chat { flex: none; }
.reviews__rating { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; }
.reviews__rating .review__stars svg { width: 16px; height: 16px; }
.review__meta a { color: inherit; }
.review__report { margin-top: 4px; padding: 0; font: inherit; font-size: 12px; color: var(--ink-soft); text-decoration: underline; background: none; border: 0; cursor: pointer; }
body.ucc-open .cookie-banner, body.ucc-open .sponsor-strip { display: none; }

/* ---------------------------------------------------------------------
   v3.1 · Acceso «Mensajes» en el mapa (icono de conversación + contador)
   Ordenador: en la barra superior, junto a «Filtrar» y la cuenta.
   Móvil: botón redondo encima de «Mi ubicación», fuera de la barra para
   no estrechar el buscador; se oculta con la ficha, los filtros o el chat.
   --------------------------------------------------------------------- */
.btn-messages {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 18px 0 15px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: var(--line);
  border-radius: 999px;
  box-shadow: var(--pop);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.btn-messages svg { width: 22px; height: 22px; flex: none; }
.btn-messages:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
@media (hover: hover) { .btn-messages:hover { transform: translateY(-1px); } }
.btn-messages__badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 11px; font-weight: 800; line-height: 16px; text-align: center; color: #fff; background: var(--coral); border: 2px solid var(--ink); border-radius: 999px; }
.btn-messages__badge[hidden] { display: none; }
@media (min-width: 761px) and (max-width: 900px) {
  .btn-messages { width: 54px; padding: 0; justify-content: center; }
  .btn-messages__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 760px) {
  .btn-messages {
    position: fixed; z-index: 1000;
    right: 10px; bottom: calc(24px + 54px + 12px + var(--safe-bottom));
    width: 54px; height: 54px; padding: 0; justify-content: center;
    transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), opacity .2s;
  }
  .btn-messages__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.sheet-open .btn-messages, body.filters-open .btn-messages, body.ucc-open .btn-messages { opacity: 0; pointer-events: none; }
}

/* Aviso discreto dentro de la app (nunca muestra el contenido del mensaje) */
.uc-dm-toast {
  position: fixed; z-index: 4500; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 10px; max-width: min(92vw, 380px);
  padding: 10px 14px; font-weight: 700; font-size: 14.5px; color: var(--ink, #1D1B3A); text-decoration: none;
  background: var(--paper, #fff); border: 2px solid var(--ink, #1D1B3A); border-radius: 999px; box-shadow: 0 3px 0 var(--ink, #1D1B3A);
  transform: translate(-50%, -12px); opacity: 0; transition: opacity .2s, transform .2s;
}
.uc-dm-toast.is-in { transform: translate(-50%, 0); opacity: 1; }
.uc-dm-toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .uc-dm-toast { transition: none; } }
/* En el mapa el aviso aparece abajo para no tapar el buscador ni los filtros */
body.uc-app .uc-dm-toast { top: auto; bottom: calc(28px + var(--safe-bottom)); transform: translate(-50%, 12px); }
body.uc-app .uc-dm-toast.is-in { transform: translate(-50%, 0); }
@media (max-width: 760px) {
  body.uc-app .uc-dm-toast { left: 10px; bottom: calc(24px + var(--safe-bottom)); max-width: calc(100% - 84px); transform: translateY(12px); }
  body.uc-app .uc-dm-toast.is-in { transform: none; }
}

/* v3.4 · Próximos festivos y horarios especiales en la ficha del mapa */
.sheet__hours-special-title { margin: 10px 0 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft, #55537A); }
.sheet__hours-special { width: 100%; font-size: 14px; border-collapse: collapse; }
.sheet__hours-special th, .sheet__hours-special td { padding: 3px 0; text-align: left; }
.sheet__hours-special th { font-weight: 600; padding-right: 10px; white-space: nowrap; }

/* ---------------------------------------------------------------------
   v3.4 · Accesos directos de la ficha, distancia y «Cerca ahora»
   --------------------------------------------------------------------- */
.sheet__acts { margin: 14px 20px 0; }
.sheet__distance { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink-soft, #55537A); }
.sheet__distance svg { width: 18px; height: 18px; color: var(--turq-deep, #0A8F86); }
.sheet__acts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; }
.sheet-act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 62px; padding: 8px 6px; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.1; text-align: center;
  color: var(--ink, #1D1B3A); text-decoration: none; cursor: pointer;
  background: var(--paper, #fff); border: 2px solid var(--ink, #1D1B3A); border-radius: 14px; box-shadow: 0 3px 0 var(--ink, #1D1B3A);
  transition: transform .15s, box-shadow .15s;
}
.sheet-act svg { width: 22px; height: 22px; color: var(--turq-deep, #0A8F86); }
.sheet-act--wa svg { color: #128C4A; }
.sheet-act:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink, #1D1B3A); }
@media (hover: hover) { .sheet-act:hover { transform: translateY(-1px); } }
.result__dist { font-weight: 700; color: var(--ink, #1D1B3A); }

.ctrl--near {
  display: flex; align-items: center; gap: 8px; width: auto; padding: 0 16px 0 13px;
  font-weight: 700; color: var(--ink, #1D1B3A); background: var(--sun, #FFD23F); border-radius: 999px;
}
.ctrl--near > span:first-child { width: 24px; height: 24px; }
.nearnow__origin { margin: 2px 0 10px; font-size: 14px; color: var(--ink-soft, #55537A); }
.nearnow__origin .link { padding: 0; font: inherit; font-weight: 700; color: var(--ink, #1D1B3A); text-decoration: underline; background: none; border: 0; cursor: pointer; }
.nearnow__h { margin: 14px 0 8px; font-size: 16px; font-weight: 800; }
.nearnow__h span { font-weight: 600; color: var(--ink-soft, #55537A); }
.nearnow__list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.nearnow__empty { margin: 0; padding: 12px; font-size: 14px; color: var(--ink-soft, #55537A); background: var(--mist, #F3F6FF); border-radius: 12px; }
.near-item {
  display: flex; gap: 12px; width: 100%; padding: 10px 12px; font: inherit; text-align: left; color: inherit; cursor: pointer;
  background: var(--paper, #fff); border: 2px solid #E1E4F2; border-radius: 14px;
}
.near-item:hover, .near-item:focus-visible { border-color: var(--ink, #1D1B3A); }
.near-item .result__icon { flex: none; }
.near-item__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.near-item__name { font-weight: 800; }
.near-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-soft, #55537A); }
.near-item__dist { font-weight: 800; color: var(--ink, #1D1B3A); }
.near-item__detail { font-size: 13px; color: var(--ink-soft, #55537A); }
.near-item__tag { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .ctrl--near { width: 54px; height: 54px; padding: 0; justify-content: center; }
  .ctrl--near .ctrl__text { display: none; }
  /* «Mensajes» sube un hueco para dejar sitio a «Cerca ahora» */
  .btn-messages { bottom: calc(24px + 54px + 12px + 54px + 12px + var(--safe-bottom)); }
  body.sheet-open .map-controls .ctrl--near { opacity: 0; pointer-events: none; }
  .sheet__acts { margin: 12px 16px 0; }
}
