:root {
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #0ea5e9;
  --accent-fg: #ffffff;
  --success: #10b981;
  --border: rgba(148, 163, 184, 0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-subtle: #1e293b;
    --card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-fg: #0f172a;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; padding: 0; 
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  font-size: 16.5px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* HEADER */
.header {
  position: sticky; top: 0; z-index: 100;
  height: auto; 
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
@media (prefers-color-scheme: dark) { .header { background: rgba(15, 23, 42, 0.95); } }

.headerInner {
  width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

.brand { display:flex; flex-direction:column; align-items:center; justify-content:center; width:100%; text-align:center; gap:2px; }
.brandSub{display:block;font-weight:900;letter-spacing:.06em;color:#dc2626;font-size:clamp(20px,5vw,28px);line-height:1.05;margin-top:0}

.brand b { 
  font-size: 20px; font-weight: 800; letter-spacing: -0.5px; 
  text-transform: uppercase; color: var(--text);
}

.controls { 
  display: flex; flex-wrap: wrap; gap: 8px; 
  width: 100%; justify-content: center; 
}

.input {
  background: var(--bg-subtle); border: 1px solid transparent; color: var(--text);
  padding: 8px 12px; border-radius: 99px; font-size: 13px; outline: none;
  cursor: pointer; transition: 0.2s; 
  flex: 1; min-width: 100px; text-align: center;
}
.input:focus { box-shadow: 0 0 0 2px var(--accent); }

/* BOTONES */
.btn {
  border: none; border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg-subtle); color: var(--text); transition: 0.2s;
  flex: 1; white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn.primary { background: var(--accent); color: var(--accent-fg); box-shadow: 0 4px 10px -2px rgba(14, 165, 233, 0.3); }
.btn.ghost { background: transparent; color: var(--text-muted); }
.btn.full { width: 100%; }

.btn.gps {
  background: var(--success); color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  font-weight: 700; border: 1px solid rgba(255,255,255,0.1);
}
.btn.install {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); color: white;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); font-weight: 700; border: 1px solid rgba(255,255,255,0.1);
}

.btn.map-icon {
  background: #eff6ff; color: var(--accent); border: 1px solid rgba(14, 165, 233, 0.3);
  width: 48px; height: 48px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.btn.map-icon svg { width: 24px; height: 24px; stroke-width: 2; }
.btn.map-icon:hover { background: var(--accent); color: white; border-color: var(--accent); }

.btn.audio-big {
  background: #fdf2f8; border: 1px solid rgba(236, 72, 153, 0.3); color: #db2777;
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.btn.audio-big svg { width: 24px; height: 24px; fill: currentColor; }
.btn.audio-big:active { background: #db2777; color: white; }

@media (prefers-color-scheme: dark) {
  .btn.map-icon { background: rgba(14, 165, 233, 0.15); border-color: rgba(14, 165, 233, 0.4); }
  .btn.audio-big { background: rgba(236, 72, 153, 0.15); border-color: rgba(236, 72, 153, 0.4); }
}

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }
.topRow { display: flex; align-items: center; justify-content: space-between; margin: 20px 0; }

.viewToggle { background: var(--bg-subtle); padding: 4px; border-radius: 99px; display: flex; }
.tabBtn {
  border: none; background: transparent; color: var(--text-muted); padding: 8px 16px;
  font-size: 13px; font-weight: 600; border-radius: 99px; cursor: pointer; transition: 0.2s;
}
.tabBtn[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* GRID */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border);
  position: relative; transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.imgBtn { border: 0; padding: 0; width: 100%; aspect-ratio: 16/9; cursor: pointer; background: var(--bg-subtle); position: relative; }
.cardImg { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card:hover .cardImg { transform: scale(1.08); }

.cardBody { padding: 20px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.cardTitle { display: flex; justify-content: space-between; font-size: 17px; font-weight: 700; }
.badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; background: var(--bg-subtle);
  color: var(--text-muted); padding: 4px 8px; border-radius: 6px; white-space: nowrap; height: fit-content;
}
.desc { font-size: 14px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 16px; }
.cardActions { margin-top: auto; display: flex; gap: 8px; align-items: center; }

/* MAPA */
.mapSection[hidden] { display: none; }
.map { width: 100%; height: 60vh; border-radius: var(--radius); border: 1px solid var(--border); }
.mapList { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.mapItem {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); padding: 12px 16px; border-radius: 16px; border: 1px solid var(--border);
}

/* MODAL */
.modalBack {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000;
  display: none; padding: 16px; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modalBack[aria-hidden="false"] { display: flex; animation: fadeIn 0.2s ease-out; }

.modal {
  background: var(--card); width: 100%; max-width: 1000px;
  max-height: calc(100vh - 32px); border-radius: 24px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modalHeader {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; background: var(--card);
}

.modalContent { 
  overflow-y: auto; padding: 0; flex: 1; min-height: 0; 
  -webkit-overflow-scrolling: touch; 
}

.detailLayout { display: grid; grid-template-columns: 1fr; }
@media(min-width: 800px){ .detailLayout { grid-template-columns: 1fr 340px; } }

.detailMain { padding: 20px; min-width: 0; }
.detailSidebar { background: var(--bg-subtle); padding: 20px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 24px; }

.heroImg { width: 100%; height: auto; max-height: 350px; object-fit: cover; border-radius: 16px; display: block; }
.detailTitle { font-size: 24px; font-weight: 800; margin: 20px 0 12px; line-height: 1.2; }

.detailText { 
  font-size: 16px; color: var(--text); line-height: 1.7; 
  margin-bottom: 60px; word-wrap: break-word; overflow-wrap: break-word;
}

.audioContainer { margin-bottom: 24px; padding: 12px; background: var(--bg-subtle); border-radius: 16px; }
audio { width: 100%; height: 44px; border-radius: 22px; display: block; }

.miniMap { height: 180px; width: 100%; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }

/* PUBLICIDAD */
.adCard {
  display: block; position: relative; border-radius: 16px; overflow: hidden;
  text-decoration: none; box-shadow: 0 4px 15px rgba(0,0,0,0.08); margin-top: 24px;
  height: 160px; width: 100%; background: #0f172a;
}
.adImg { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; opacity: 0.9; }
.adOverlay {
  position: absolute; bottom: 0; left: 0; right: 0; top: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
  padding: 0 20px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px;
}
.adLabel { color: #fff; font-size: 18px; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,0.5); line-height: 1.2; max-width: 80%; }
.adCta {
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 8px 14px; border-radius: 99px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); display: inline-block;
}

.btn-reserva {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white; font-size: 16px; font-weight: 800; padding: 18px 24px;
  text-transform: uppercase; letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  margin-top: 24px; width: 100%; display: block;
  text-align: center; text-decoration: none; border-radius: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-reserva:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6); opacity: 1; }

/* NUEVO: NOTIFICACIÓN TOAST */
.toast {
  position: fixed; bottom: 20px; left: 20px; right: 20px; z-index: 3000;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  animation: slideUp 0.3s ease-out;
}
.toast[hidden] { display: none; }
.toast-content { display: flex; flex-direction: column; }
.toast-content span { font-size: 12px; color: var(--accent); font-weight: 700; text-transform: uppercase; }
.toast-content b { font-size: 15px; color: var(--text); }

@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.empty { padding: 40px; text-align: center; color: var(--text-muted); }

/* --- Legal tab al final de cada punto --- */
.legalTabWrap{
  margin-top:10px;
  display:flex;
  justify-content:center;
}
.legalTab{
  appearance:none;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.9);
  color: var(--text-muted);
  font-size:12px;
  padding:8px 12px;
  border-radius:999px;
  cursor:pointer;
  transition: transform .08s ease, opacity .2s ease, box-shadow .2s ease;
}
.legalTab:hover{ opacity:.9 }
.legalTab:active{ transform: scale(.99) }
.legalTab:focus{ outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.18) }


.detailDesc{font-size:16px;line-height:1.65}

.routeCard{margin-top:14px;padding:12px 14px;border-radius:16px;background:var(--bg-subtle);border:1px solid var(--border)}
.routeCard b{display:block;margin-bottom:6px}
.routeSteps{margin:0;padding-left:18px}
.routeSteps li{margin:4px 0}

.routeCard{margin-top:14px;padding:12px;border:1px solid var(--border);border-radius:16px;background:var(--bg-subtle)}
.routeBtns{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.btn.routeStep{padding:10px 12px;border-radius:999px;font-weight:700;font-size:14px}
.routeHint{margin-top:10px;font-size:13px;color:var(--text-muted)}

.coordsLine{margin-top:12px;padding:10px 12px;border-radius:14px;background:var(--bg-subtle);border:1px solid var(--border);font-size:14px;color:var(--text)}
