/* ==========================================================================
   Free Tours Free · Modo guía (pantalla completa, pensado para el móvil)
   ========================================================================== */

html, body.page-guide { height: 100%; overflow: hidden; }
body.page-guide { background: var(--night); }

.guide {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.guide-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--paper-deep);
}

/* --- Barra superior ---------------------------------------------------- */

.guide-top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 12px 12px;
  background: linear-gradient(180deg, rgba(21, 26, 46, 0.92) 0%, rgba(21, 26, 46, 0.6) 70%, transparent);
  color: #fff;
  pointer-events: none;
}

.guide-top > * { pointer-events: auto; }
.guide-title { flex: 1; min-width: 0; text-align: center; }
.guide-title small { display: block; font-size: 0.75rem; opacity: 0.75; }
.guide-title strong { display: block; overflow: hidden; font-family: var(--serif); font-size: 1.05rem; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }

.guide-round {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px; height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.45);
}

.guide-round .icon { width: 20px; height: 20px; }
.guide-round[hidden] { display: none; }

.guide-hint-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 14px 8px 12px;
  border: 1.5px solid var(--accent-tint);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-deep);
}

.guide-hint-toggle[hidden] { display: none; }
.guide-hint-toggle .icon { width: 18px; height: 18px; }
.guide-hint-toggle .chevron { width: 15px; height: 15px; transition: transform 0.2s; }
.guide-hint-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.guide-tools {
  position: absolute;
  right: 12px;
  bottom: calc(var(--sheet-h, 300px) + 16px);
  z-index: 10;
  display: grid;
  gap: 10px;
}

/* --- Hoja inferior ----------------------------------------------------- */

.guide-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  max-height: 72vh;
  overflow-y: auto;
  padding: 0 12px calc(env(safe-area-inset-bottom) + 12px);
}

.guide-locate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
}

.guide-locate .icon { color: var(--sun); }
.guide-locate[hidden] { display: none; }

.guide-status {
  margin-bottom: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff6dd;
  color: #6b4d12;
  font-size: 0.92rem;
  line-height: 1.45;
}

.guide-card {
  padding: 18px 18px 14px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 -10px 40px -14px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.3s;
}

.guide-card.is-arrived { box-shadow: 0 0 0 3px var(--accent), 0 -10px 40px -14px rgba(0, 0, 0, 0.45); }

.guide-card-head { display: flex; gap: 14px; align-items: flex-start; }

.guide-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.guide-num.is-visited { background: #2f6a2a; }
.guide-card-head small { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-mute); }
.guide-card-head h1 { margin-top: 2px; font-size: 1.45rem; line-height: 1.15; }
.guide-distance { margin-top: 6px; font-weight: 700; color: var(--accent-deep); }
.guide-distance:empty { display: none; }

.guide-arrived-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #e3f1dc;
  color: #2f6a2a;
  font-weight: 700;
}

.guide-arrived-title .icon { width: 22px; height: 22px; }

.guide-recognize {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  margin-top: 14px;
  padding: 10px;
  border-radius: 18px;
  background: var(--paper);
}

.guide-recognize img { width: 112px; height: 112px; border-radius: 12px; object-fit: cover; }
.guide-recognize[hidden], .guide-recognize img[hidden] { display: none; }
.guide-recognize:has(img[hidden]) { grid-template-columns: 1fr; }
.guide-recognize p { font-size: 0.92rem; line-height: 1.45; color: var(--ink-soft); }

.guide-recognize p.guide-recognize-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.guide-recognize-label .icon { width: 16px; height: 16px; }

.guide-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.guide-actions .btn { min-height: 48px; padding: 0 10px; gap: 6px; font-size: 0.9rem; }
.guide-actions .btn .icon { width: 18px; height: 18px; }
.guide-actions .btn[aria-disabled="true"], .guide-actions .btn:disabled { opacity: 0.4; pointer-events: none; }
.guide-listen.is-playing { background: var(--ink); }

.guide-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.guide-step-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border: 0;
  background: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.guide-step-btn:disabled { opacity: 0.3; }
.guide-step-btn .arrow { width: 18px; height: 18px; }
.arrow-back { transform: rotate(180deg); }

.guide-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.guide-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.guide-dots .is-visited { background: #2f6a2a; }
.guide-dots .is-current { width: 20px; border-radius: 4px; background: var(--accent); }

/* --- Lista de paradas -------------------------------------------------- */

.guide-list {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  background: rgba(10, 12, 24, 0.5);
}

.guide-list[hidden] { display: none; }

.guide-list-panel {
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 18px 14px calc(env(safe-area-inset-bottom) + 18px);
  border-radius: 26px 26px 0 0;
  background: var(--card);
}

.guide-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.guide-list-head h2 { font-size: 1.5rem; }
.guide-list-head .guide-round { box-shadow: none; background: var(--paper); }

.guide-list li button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  background: none;
  text-align: left;
}

.guide-list li button.is-current { background: var(--accent-tint); }
.guide-list li .guide-num { width: 38px; height: 38px; font-size: 1rem; }
.guide-list strong { display: block; font-family: var(--serif); font-size: 1.1rem; font-weight: 500; }
.guide-list small { display: block; font-size: 0.86rem; color: var(--ink-mute); line-height: 1.35; }

/* --- Marcadores -------------------------------------------------------- */

.user-dot {
  display: block;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #2b7cff;
  border: 4px solid #fff;
  box-shadow: 0 0 0 6px rgba(43, 124, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.35);
  animation: user-pulse 2s ease-out infinite;
}

@keyframes user-pulse {
  0% { box-shadow: 0 0 0 0 rgba(43, 124, 255, 0.45), 0 4px 10px rgba(0, 0, 0, 0.35); }
  100% { box-shadow: 0 0 0 18px rgba(43, 124, 255, 0), 0 4px 10px rgba(0, 0, 0, 0.35); }
}

.pin.is-visited { background: #2f6a2a; }

.leaflet-control-attribution { font-size: 9px; }
.leaflet-bottom.leaflet-right { bottom: var(--sheet-h, 300px); }

/* --- Escritorio: hoja a la izquierda ----------------------------------- */

@media (min-width: 900px) {
  .guide-sheet {
    top: 90px;
    right: auto;
    bottom: 20px;
    width: 420px;
    max-height: none;
    padding: 0 0 0 20px;
  }

  .guide-tools { bottom: 24px; right: 24px; }
  .leaflet-bottom.leaflet-right { bottom: 0; }

  .guide-list { align-items: stretch; justify-content: flex-end; }
  .guide-list-panel { width: 420px; max-height: none; border-radius: 0; }
}
