/* La Vruta — estilos de la web pública.
   Los colores y tipografías están en :root para poder cambiarlos
   cuando llegue la identidad definitiva. */

@font-face { font-family: "Bricolage"; src: url("../fonts/BricolageGrotesque.woff") format("woff"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/AtkinsonHyperlegible-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/AtkinsonHyperlegible-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  /* ---- Colores (tema "Día" por defecto; los otros temas los sobrescriben abajo) ---- */
  --paper: #f5f7f1;      /* fondo: blanco verdoso, luz de mediodía */
  --surface: #ffffff;
  --ink: #17261c;        /* tinta: verde casi negro */
  --ink-soft: #4b5a4f;
  --heading: var(--ink);
  --brand: #4f6b2a;      /* principal: aceituna aloreña */
  --brand-deep: #2f4418; /* enlaces */
  --accent: #f3cf3a;     /* acento: limón; solo para la ruta y lo conseguido */
  --accent-hover: #ffd94d;
  --on-accent: #17261c;  /* texto encima del acento */
  --line: #d9e0d2;
  --danger: #a33a24;

  --btn-bg: var(--ink);
  --btn-ink: var(--paper);
  --btn-hover-bg: var(--brand-deep);
  --btn-hover-ink: #ffffff;
  --hard-shadow: var(--ink);             /* sombra "de pegatina" del tiquet */
  --soft-shadow: rgba(23, 38, 28, .35);

  --tint-brand: #e5edd6;  --tint-brand-ink: var(--brand-deep);
  --tint-warn: #fbefc0;   --tint-warn-ink: #6b5208;
  --tint-bad: #f7dcd4;
  --today: #fff7cf;
  --map-bg: #dfe6da;

  --header-bg: var(--paper);
  --header-ink: var(--ink);
  --header-line: var(--line);
  --header-stripe: none;
  --header-hover: var(--line);
  --header-current-bg: var(--ink);
  --header-current-ink: var(--paper);

  --footer-bg: #17261c;
  --footer-ink: #d7dfd2;
  --footer-link: #ffffff;

  color-scheme: light;

  --font-display: "Bricolage", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.6rem, 9vw, 5.2rem);

  --gutter: clamp(16px, 4vw, 40px);
  --measure: 68ch;
  --radius-s: 6px;
  --radius-m: 14px;
}

/* ---- Tema Málaga: morado y verde de la bandera ---- */
:root[data-theme="malaga"] {
  --paper: #fbf7fb;
  --surface: #ffffff;
  --ink: #2b0a2c;
  --ink-soft: #5f4a60;
  --heading: #830184;
  --brand: #05a100;
  --brand-deep: #830184;   /* enlaces en morado (contraste 9:1) */
  --accent: #05a100;       /* verde bandera */
  --accent-hover: #12b80c;
  --on-accent: #13001a;    /* el blanco sobre este verde no llega al contraste mínimo */
  --line: #ead9ea;
  --danger: #b3261e;

  --btn-bg: #830184;
  --btn-ink: #ffffff;
  --btn-hover-bg: #5c005d;
  --btn-hover-ink: #ffffff;
  --hard-shadow: #830184;
  --soft-shadow: rgba(60, 0, 61, .35);

  --tint-brand: #e3f5e2;  --tint-brand-ink: #036b00;
  --tint-warn: #f6e3f6;   --tint-warn-ink: #830184;
  --tint-bad: #fbe0dc;
  --today: #e6f7e5;
  --map-bg: #efe4ef;

  --header-bg: #830184;
  --header-ink: #ffffff;
  --header-line: #830184;
  --header-stripe: inset 0 -5px 0 #05a100;
  --header-hover: rgba(255, 255, 255, .16);
  --header-current-bg: #ffffff;
  --header-current-ink: #830184;

  --footer-bg: #830184;
  --footer-ink: #f3dff3;
  --footer-link: #ffffff;
}

/* ---- Tema Noche ---- */
:root[data-theme="noche"] {
  --paper: #0f1712;
  --surface: #18231b;
  --ink: #e6ece2;
  --ink-soft: #a7b4a8;
  --heading: var(--ink);
  --brand: #9cc26a;
  --brand-deep: #b9d98b;
  --accent: #f3cf3a;
  --accent-hover: #ffd94d;
  --on-accent: #17261c;
  --line: #2c3a30;
  --danger: #ff8a70;

  --btn-bg: #e6ece2;
  --btn-ink: #0f1712;
  --btn-hover-bg: #b9d98b;
  --btn-hover-ink: #0f1712;
  --hard-shadow: #000000;
  --soft-shadow: rgba(0, 0, 0, .5);

  --tint-brand: #24361f;  --tint-brand-ink: #b9d98b;
  --tint-warn: #3a3214;   --tint-warn-ink: #f3dc7a;
  --tint-bad: #4a2219;
  --today: #2f2b14;
  --map-bg: #1c2620;

  --header-bg: #0f1712;
  --header-ink: #e6ece2;
  --header-line: #2c3a30;
  --header-stripe: none;
  --header-hover: #24312a;
  --header-current-bg: #e6ece2;
  --header-current-ink: #0f1712;

  --footer-bg: #070c09;
  --footer-ink: #b7c3b3;
  --footer-link: #ffffff;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--font-body);
}
img, svg { max-width: 100%; }
a { color: var(--brand-deep); text-underline-offset: .18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); border-radius: 3px; }
h1, h2, h3 { color: var(--heading); font-family: var(--font-display); line-height: 1.08; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: var(--step-4); font-stretch: 85%; font-weight: 800; }
h2 { font-size: var(--step-3); font-stretch: 90%; }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; max-width: var(--measure); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Cabecera ---------- */
.site-header { background: var(--header-bg); color: var(--header-ink); border-bottom: 1px solid var(--header-line); box-shadow: var(--header-stripe); position: sticky; top: 0; z-index: 1000; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--header-ink); }
.brand img { height: 38px; width: auto; display: block; }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 1.55rem; font-stretch: 80%; letter-spacing: -.02em; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--header-ink); padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: var(--step--1); }
.nav a[aria-current="page"] { background: var(--header-current-bg); color: var(--header-current-ink); }
.nav a:hover:not([aria-current]) { background: var(--header-hover); color: var(--header-ink); }

/* Logo: en los temas con cabecera oscura se usa la versión blanca (si existe) */
.brand .logo-alt { display: none; }
:root[data-theme="malaga"] .brand.has-alt .logo-std,
:root[data-theme="noche"] .brand.has-alt .logo-std { display: none; }
:root[data-theme="malaga"] .brand.has-alt .logo-alt,
:root[data-theme="noche"] .brand.has-alt .logo-alt { display: block; }

/* Selector de estilo (Málaga / Día / Noche) */
.header-right { display: flex; align-items: center; gap: 12px; }
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border: 2px solid var(--header-ink); border-radius: 999px; flex: none; }
.theme-switch button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--header-ink);
  font: 700 var(--step--1)/1 var(--font-body); padding: 6px 10px; min-height: 34px; border-radius: 999px; cursor: pointer; }
.theme-switch button:hover { background: var(--header-hover); }
.theme-switch button[aria-pressed="true"] { background: var(--header-current-bg); color: var(--header-current-ink); }
.theme-switch svg { width: 18px; height: 18px; flex: none; display: block; }
.theme-switch .flag { width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1.5px currentColor; }
@media (min-width: 721px) and (max-width: 1040px) {
  .theme-switch .t-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 720px) {
  .site-header .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .header-right { display: contents; }
  .theme-switch { order: 2; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; margin: 0 -6px; }
  .nav a { white-space: nowrap; }
}

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 var(--step-0)/1 var(--font-body);
  padding: 14px 20px; border-radius: 999px; border: 2px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-ink);
  text-decoration: none; cursor: pointer; min-height: 48px; }
.btn:hover { background: var(--btn-hover-bg); border-color: var(--btn-hover-bg); color: var(--btn-hover-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-lemon { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-lemon:hover { background: var(--accent-hover); border-color: var(--ink); color: var(--on-accent); }
.btn-small { padding: 8px 14px; min-height: 38px; font-size: var(--step--1); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Portada ---------- */
.hero { padding: clamp(32px, 7vw, 88px) 0 clamp(28px, 5vw, 56px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 64px); align-items: end; }
.hero h1 { margin-bottom: .2em; }
.hero h1 img { max-height: 1.1em; width: auto; }
.hero-tag { font-size: var(--step-2); font-family: var(--font-display); font-weight: 500; font-stretch: 95%; margin-bottom: 1rem; max-width: 22ch; line-height: 1.15; }
.hero-dates { font-weight: 700; font-size: var(--step-1); margin: 0 0 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.countdown { font-size: var(--step--1); color: var(--ink-soft); margin-top: 18px; }

/* El "tiquet" de ejemplo de la portada: la ruta como protagonista */
.ticket { background: var(--surface); border-radius: var(--radius-m); padding: 22px 22px 18px; position: relative;
  border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--hard-shadow); }
.ticket-title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); margin: 0 0 14px; padding-bottom: 12px; border-bottom: 2px dashed var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ticket-title small { font-family: var(--font-body); font-weight: 400; font-size: var(--step--1); color: var(--ink-soft); }

/* Itinerario (portada y mapa) */
.itinerary { list-style: none; margin: 0; padding: 0; position: relative; }
.itinerary li { display: grid; grid-template-columns: 58px 22px 1fr; gap: 0 10px; align-items: start; }
.itinerary .time { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 2px; }
.itinerary .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); border: 2px solid var(--ink);
  font: 700 .72rem/18px var(--font-body); text-align: center; position: relative; z-index: 1; }
.itinerary .stop { padding-bottom: 14px; }
.itinerary .stop strong { display: block; }
.itinerary .stop span { color: var(--ink-soft); font-size: var(--step--1); }
.itinerary li.leg { grid-template-columns: 58px 22px 1fr; color: var(--ink-soft); font-size: var(--step--1); }
.itinerary li.leg .rail { width: 22px; display: flex; justify-content: center; }
.itinerary li.leg .rail::before { content: ""; width: 0; border-left: 3px dotted var(--ink); min-height: 26px; }
.itinerary li.leg .walk { padding: 3px 0 10px; }
.itinerary .wait { color: var(--brand-deep); }

/* Secciones */
.section { padding: clamp(36px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.section-intro { color: var(--ink-soft); font-size: var(--step-1); }
.prose p { font-size: 1.075rem; }
.facts { font-family: var(--font-display); font-size: var(--step-2); font-stretch: 92%; line-height: 1.3; max-width: 30ch; font-weight: 500; }
.facts b { font-weight: 800; }

.regions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px 40px; }
.region h3 { display: flex; align-items: center; gap: 10px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--brand)); flex: none; border: 2px solid var(--ink); }
.venue-list { list-style: none; padding: 0; margin: 0; }
.venue-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.venue-list a { font-weight: 700; text-decoration: none; }
.venue-list a:hover { text-decoration: underline; }
.venue-list .meta { color: var(--ink-soft); font-size: var(--step--1); white-space: nowrap; }

.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1.5px solid currentColor; line-height: 1.5; }
.tag-vegano { color: var(--tint-brand-ink); background: var(--tint-brand); border-color: transparent; }
.tag-vegetariano { color: var(--tint-warn-ink); background: var(--tint-warn); border-color: transparent; }
.tag-opciones { color: var(--ink-soft); background: transparent; }

.agenda { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.agenda li { display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.agenda .when { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
.agenda .when small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--ink-soft); }
.agenda h3 { margin-bottom: .25em; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 28px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps .dot { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-family: var(--font-display); font-weight: 800; }
.steps strong { display: block; font-family: var(--font-display); font-size: var(--step-1); }
.steps strong a { text-decoration: none; }
.steps strong a:hover { text-decoration: underline; }
.steps span:not(.dot) { display: block; color: var(--ink-soft); font-size: var(--step--1); }
.growth { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); font-weight: 700; max-width: var(--measure); }

.name-wall { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.name-wall li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; }

.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding: 40px 0 56px; margin-top: 40px; font-size: var(--step--1); }
.site-footer a { color: var(--footer-link); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: center; }
.site-footer img { height: 44px; width: auto; }

/* ---------- Ficha del local ---------- */
.venue-head { padding: clamp(28px, 5vw, 56px) 0 24px; }
.venue-head h1 { font-size: clamp(2.2rem, 7vw, 3.8rem); }
.venue-head .meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--ink-soft); }
.note-box { background: var(--accent); color: var(--on-accent); font-weight: 700; padding: 10px 14px; border-radius: var(--radius-s); display: inline-block; margin: 12px 0 0; }
.venue-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(24px, 5vw, 56px); padding-bottom: 40px; }
.tapas { list-style: none; margin: 0; padding: 0; }
.tapa { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.tapa h3 { margin: 0; font-size: var(--step-1); }
.tapa p { grid-column: 1; margin: 0; color: var(--ink-soft); }
.tapa .price { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.tried { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; font-weight: 700; cursor: pointer; user-select: none; width: fit-content; }
.tried input { width: 22px; height: 22px; accent-color: var(--brand); }
.tried.is-on { background: var(--accent); color: var(--on-accent); padding: 3px 10px 3px 6px; border-radius: 999px; }
.tried-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.tried-row .tried { margin-top: 0; }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.hours-table th { font-weight: 700; width: 45%; }
.hours-table .closed { color: var(--ink-soft); }
.hours-table tr.today th, .hours-table tr.today td { background: var(--today); }
.mini-map { height: 220px; border-radius: var(--radius-m); border: 2px solid var(--ink); margin-bottom: 16px; }

/* ---------- Mapa ---------- */
.map-page { display: grid; grid-template-columns: minmax(340px, 400px) 1fr; height: calc(100dvh - 61px); }
.map-panel { background: var(--paper); border-right: 2px solid var(--ink); display: flex; flex-direction: column; min-height: 0; }
.panel-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 2px solid var(--ink); }
.panel-tabs button { font: 700 var(--step-0)/1 var(--font-body); padding: 16px 8px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.panel-tabs button[aria-selected="true"] { background: var(--btn-bg); color: var(--btn-ink); }
.panel-tabs .count { display: inline-block; min-width: 22px; padding: 2px 6px; margin-left: 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .8rem; }
.panel-body { overflow-y: auto; padding: 16px var(--gutter) 24px; flex: 1; min-height: 0; }
.panel-body[hidden] { display: none; }
#map { height: 100%; width: 100%; background: var(--map-bg); }
.filters { display: grid; gap: 12px; margin-bottom: 14px; }
.field label, .field-label { display: block; font-weight: 700; font-size: var(--step--1); margin-bottom: 4px; }
.field select, .field input[type="time"], .field input[type="search"], .field input[type="number"] {
  width: 100%; font: 400 var(--step-0)/1.2 var(--font-body); padding: 10px 12px; border: 2px solid var(--ink); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); min-height: 46px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 700 var(--step--1)/1 var(--font-body); padding: 8px 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-count { color: var(--ink-soft); font-size: var(--step--1); margin: 4px 0 8px; }
.vcards { list-style: none; padding: 0; margin: 0; }
.vcard { padding: 14px 0; border-bottom: 1px solid var(--line); }
.vcard-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.vcard h3 { margin: 0 0 4px; font-size: 1.12rem; }
.vcard h3 button { all: unset; cursor: pointer; }
.vcard h3 button:hover { text-decoration: underline; }
.vcard h3 button:focus-visible { outline: 3px solid var(--accent); }
.vcard .sub { color: var(--ink-soft); font-size: var(--step--1); }
.vcard .hours-line { font-size: var(--step--1); margin-top: 4px; }
.vcard .closed-day { color: var(--danger); font-weight: 700; }
.add-btn { flex: none; font: 700 var(--step--1)/1 var(--font-body); padding: 9px 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 38px; }
.add-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.empty { color: var(--ink-soft); padding: 20px 0; }
.plan-list { list-style: none; padding: 0; margin: 0 0 14px; }
.plan-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.plan-list li { justify-content: flex-start; }
.plan-list .plan-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); border: 2px solid var(--ink); display: grid; place-items: center; font: 800 13px/1 var(--font-display); }
.plan-list .plan-name { flex: 1; min-width: 0; }
.plan-list .plan-tools { flex: none; display: flex; gap: 4px; }
.plan-list button { border: 2px solid var(--ink); border-radius: 50%; background: var(--surface); color: var(--ink); font: 700 15px/1 var(--font-body); cursor: pointer; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; }
.plan-list button:disabled { opacity: .25; cursor: default; }
.plan-list button.plan-remove { border-color: transparent; color: var(--danger); }
.plan-order { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 2px 0 6px; font-size: var(--step--1); color: var(--ink-soft); }
.plan-order p { margin: 0; }
.link-btn { border: 0; background: none; padding: 0; font: 700 var(--step--1) var(--font-body); color: var(--brand-deep); text-decoration: underline; cursor: pointer; }
#r-end-field[hidden] { display: none; }
.itinerary .stop .stay-tools { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.itinerary .stop .stay-tools button { font: 700 .78rem/1 var(--font-body); border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink); padding: 6px 9px; min-height: 30px; cursor: pointer; }
.itinerary .stop .stay-tools button:disabled { opacity: .3; cursor: default; }
.itinerary .stop .stay-tools .stay-min { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 48px; text-align: center; }
.stay-note { font-size: var(--step--1); color: var(--ink-soft); margin: 10px 0 0; }
.notice { padding: 12px 14px; border-radius: var(--radius-s); background: var(--tint-warn); margin: 10px 0; font-size: var(--step--1); }
.notice.bad { background: var(--tint-bad); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.privacy { font-size: .8rem; color: var(--ink-soft); margin-top: 18px; }

/* Marcadores del mapa */
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid var(--ink); display: grid; place-items: center; box-shadow: 2px 2px 0 var(--soft-shadow); }
.pin span { transform: rotate(45deg); color: #fff; font: 700 12px/1 var(--font-body); }
.pin.is-selected { background: var(--accent); }
.pin.is-selected span { color: var(--on-accent); }
.pin.is-dim { opacity: .35; }
.pin-order { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); border: 3px solid var(--ink); display: grid; place-items: center; font: 800 15px/1 var(--font-display); color: var(--on-accent); box-shadow: 2px 2px 0 var(--soft-shadow); cursor: pointer; }
.pin:not(.is-selected) span::before { content: ""; display: block; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink); }
.route-arrow { width: 20px; height: 20px; display: grid; place-items: center; font: 900 11px/1 var(--font-body); color: var(--on-accent); background: var(--accent); border: 2px solid var(--ink); border-radius: 50%; }
.map-legend { background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius-s); padding: 6px 10px; font: 600 .78rem/1.2 var(--font-body); display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: calc(100vw - 90px); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { font-style: normal; flex: none; display: grid; place-items: center; }
.map-legend .lg-pin { width: 14px; height: 14px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--brand-deep, #4f6b2a); border: 1.5px solid var(--ink); font-size: 0; }
.map-legend .lg-pin.is-selected { background: var(--accent); }
.map-legend .lg-order { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ink); color: var(--on-accent); font: 800 10px/1 var(--font-display); }
.map-legend .lg-route { display: none; }
.map-legend.has-route .lg-route { display: inline-flex; }
.stop-link { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; }
.stop-link:hover { color: var(--brand-deep); }
.route-approx { font-size: var(--step--1); color: var(--ink-soft); margin: 10px 0 0; }
.plan-cta { position: sticky; bottom: 12px; width: 100%; margin-top: 12px; box-shadow: 3px 3px 0 var(--hard-shadow); }
.plan-cta[hidden] { display: none; }
.only-mobile { display: none; }
.leaflet-popup-content { font: 400 var(--step-0)/1.45 var(--font-body); margin: 14px 16px; min-width: 220px; }
.leaflet-popup-content h3 { font-size: 1.15rem; margin: 0 0 4px; }
.leaflet-popup-content ul { padding-left: 18px; margin: 6px 0; }
.leaflet-popup-content .actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.leaflet-container a.btn { color: var(--btn-ink); }
.leaflet-container a.btn-ghost { color: var(--ink); }

@media (max-width: 860px) {
  .hero-grid, .venue-grid { grid-template-columns: 1fr; }
  .map-page { grid-template-columns: 1fr; grid-template-rows: 46dvh auto; height: auto; }
  .map-page .map-wrap { order: -1; position: relative; height: 46dvh; z-index: 1; border-bottom: 2px solid var(--ink); }
  .map-panel { border-right: 0; }
  .panel-body { overflow: visible; }
  .only-mobile { display: inline-flex; }
  .map-legend { font-size: .72rem; padding: 4px 8px; gap: 2px 10px; }
  .map-legend .lg-extra { display: none; }
  .agenda li { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Tapaporte ---------- */
.passport-head { padding: clamp(28px, 5vw, 56px) 0 12px; }
.progress { height: 18px; border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); overflow: hidden; max-width: 520px; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .4s ease; }
.badges { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { border: 2px dashed var(--line); border-radius: var(--radius-m); padding: 14px; text-align: center; color: var(--ink-soft); }
.badge strong { display: block; font-family: var(--font-display); font-size: 1.05rem; color: inherit; }
.badge.is-on { border: 2px solid var(--ink); background: var(--accent); color: var(--on-accent); transform: rotate(-1.5deg); }
.stamp-list { list-style: none; padding: 0; margin: 0 0 28px; }
.stamp-list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.stamp-list .tapa-row { display: flex; gap: 10px; align-items: center; padding: 4px 0; }
.stamp-list .tapa-row { flex-wrap: wrap; }
.stamp-list .tapa-row label { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; }
.stamp-list .tapa-row input { width: 22px; height: 22px; accent-color: var(--brand); }

/* Repetir tapa: "La he repetido", "¡Otra!", y la cuenta (repetida, tripitida…) */
.repe { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.repe[hidden], .repe-btn[hidden] { display: none; }
.repe-word { font-size: var(--step--1); font-weight: 700; color: var(--ink-soft); }
.repe-word b { color: var(--ink); }
.tried b { font-family: var(--font-display); }
.repe-btn { font: 700 var(--step--1)/1 var(--font-body); min-height: 34px; min-width: 34px; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; }
.repe-btn[data-repe-delta="-1"] { padding: 6px 0; font-size: 1.1rem; }
.repe-btn:hover { background: var(--accent); color: var(--on-accent); }
.repe-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Logro secreto: oculto hasta conseguirlo */
.badge.is-secret { border-style: dotted; font-style: italic; }
.badge.is-secret strong { letter-spacing: .2em; font-style: normal; }
.badge.is-secret-on { transform: rotate(2deg); box-shadow: 4px 4px 0 var(--hard-shadow); }

/* Aviso flotante (logro desbloqueado) */
.vruta-toast { position: fixed; left: 50%; bottom: 20px; z-index: 2000; transform: translate(-50%, 140%); max-width: calc(100% - 32px);
  background: var(--accent); color: var(--on-accent); border: 2px solid var(--ink); border-radius: var(--radius-m); box-shadow: 4px 4px 0 var(--hard-shadow);
  padding: 12px 18px; text-align: center; transition: transform .35s ease; pointer-events: none; }
.vruta-toast.is-on { transform: translate(-50%, 0) rotate(-1.5deg); }
.vruta-toast small { display: block; font-weight: 700; font-size: var(--step--1); }
.vruta-toast strong { display: block; font-family: var(--font-display); font-size: var(--step-1); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Cartel imprimible ---------- */
.poster-page { background: #e9ece4; }
.poster { width: 210mm; min-height: 297mm; margin: 20px auto; background: var(--paper); padding: 22mm 18mm; display: flex; flex-direction: column; gap: 10mm; border: 1px solid var(--line); }
.poster .p-brand { font-family: var(--font-display); font-weight: 800; font-size: 42pt; font-stretch: 80%; line-height: 1; }
.poster .p-brand img { height: 30mm; width: auto; }
.poster .p-name { font-family: var(--font-display); font-weight: 800; font-size: 34pt; line-height: 1.05; }
.poster .p-qr { width: 105mm; height: 105mm; align-self: center; border: 3px solid var(--ink); border-radius: 6mm; padding: 4mm; background: #fff; }
.poster .p-qr svg { width: 100%; height: 100%; }
.poster .p-cta { font-family: var(--font-display); font-size: 20pt; font-weight: 700; text-align: center; line-height: 1.2; }
.poster .p-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: end; font-size: 11pt; color: var(--ink-soft); }
.poster .p-foot img { height: 18mm; width: auto; }
.print-bar { text-align: center; padding: 16px; }
@media print {
  @page { size: A4; margin: 0; }
  .print-bar { display: none; }
  .poster-page { background: none; }
  .poster { margin: 0; border: 0; }
}

/* Caja para copiar a mano cuando no se puede compartir ni copiar automáticamente */
.share-manual { margin: 10px 0 0; }
.share-manual label { display: block; font-size: .85rem; margin-bottom: 4px; }
.share-manual textarea { width: 100%; font: inherit; font-size: .9rem; padding: 8px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); color: var(--ink); }

/* Tapaporte en imagen */
.pp-card { margin: 18px 0 8px; padding: 16px; border: 2px solid var(--ink); border-radius: var(--radius-m); background: var(--surface); max-width: 560px; }
.pp-card img { display: block; width: 100%; height: auto; border-radius: var(--radius-s); box-shadow: 0 6px 18px var(--soft-shadow); }
.pp-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.pp-card-hint { font-size: .9rem; color: var(--danger); }

@media (max-width: 400px) {
  .theme-switch .t-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .theme-switch button { padding: 6px 9px; }
}

/* Leaflet adaptado al tema (popups, controles, línea de la ruta) */
.leaflet-container .leaflet-popup-content-wrapper,
.leaflet-container .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-soft); }
.leaflet-container .leaflet-bar a { background: var(--surface); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-container .leaflet-bar a:hover { background: var(--line); }
.leaflet-container .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--ink-soft); }
.leaflet-container .leaflet-control-attribution a { color: var(--brand-deep); }
.leaflet-container .route-casing { stroke: var(--hard-shadow); }
.leaflet-container .route-line { stroke: var(--accent); }

/* ===================== Versión con datos: guardar, legal, mis datos ===================== */
.savebox { margin: 18px 0 0; padding: 14px 16px; border: 2px dashed var(--line); border-radius: var(--radius-m); background: var(--surface); font-size: var(--step--1); }
.savebox p { margin: 0 0 8px; }
.savebox p:last-child { margin-bottom: 0; }
.savebox.is-on { border-style: solid; border-color: var(--tint-brand); background: var(--tint-brand); color: var(--tint-brand-ink); }
.savebox .savebox-more { margin-left: 6px; }
.savebox-legal { color: var(--ink-soft); font-size: .8rem; }
.saved-days { margin: 4px 0 14px; }
.saved-days .chips { margin-top: 6px; }
.saved-days .count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .75rem; }
.shared-notice p { margin: 0 0 8px; }
.shared-notice p:last-child { margin: 0; }
.notice.good { background: var(--tint-brand); color: var(--tint-brand-ink); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: var(--paper); }
.legal-inline { margin-top: 6px; }

.site-footer .legal-links { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.15); justify-content: flex-start; gap: 8px 22px; }

.legal-page { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-top: clamp(24px, 5vw, 48px); padding-bottom: 24px; }
.legal-page h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); margin-bottom: .2em; }
.legal-page h2 { font-size: var(--step-2); margin-top: 1.8em; }
.legal-page h3 { font-size: var(--step-1); margin-top: 1.4em; }
.legal-page li { margin-bottom: .4em; }
.legal-updated { color: var(--ink-soft); font-size: var(--step--1); margin-top: 0; }
.legal-summary { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-m); padding: 6px 20px 10px; margin: 20px 0; box-shadow: 4px 4px 0 var(--hard-shadow); }
.legal-summary h2 { margin-top: .8em; }
.legal-missing { background: var(--tint-warn); color: var(--tint-warn-ink); border: 2px solid currentColor; border-radius: var(--radius-s); padding: 12px 14px; margin: 16px 0; font-size: var(--step--1); }
.legal-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; }
.legal-dl dt { font-weight: 700; }
.legal-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .legal-dl { grid-template-columns: 1fr; gap: 0; } .legal-dl dd { margin-bottom: 8px; } }
.legal-norms { color: var(--ink-soft); font-size: var(--step--1); margin-top: 2em; }
.table-scroll { overflow-x: auto; margin: 12px 0; }
.legal-table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: var(--step--1); }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.legal-table th { border-bottom: 2px solid var(--ink); }
.legal-table code, .legal-page code { font-size: .9em; overflow-wrap: anywhere; }
.optout { padding: 12px 16px; border-radius: var(--radius-m); background: var(--surface); border: 2px dashed var(--line); }
.optout p { margin: 0 0 8px; } .optout p:last-child { margin: 0; }

.mis-datos section { margin-bottom: 1.5em; }
.md-route { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.md-route ol { margin: 8px 0 10px; }
.md-tapas { padding-left: 1.2em; }
.md-tapas span { color: var(--ink-soft); }
.md-date { font-size: .8rem; margin-left: 6px; }
.md-link { display: flex; gap: 8px; flex-wrap: wrap; }
.md-link input { flex: 1 1 260px; min-width: 0; font: inherit; font-size: var(--step--1); padding: 8px 10px; border: 2px solid var(--ink); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); }

/* Mapa en el tema Noche: las teselas de OpenStreetMap solo existen en claro, así que se oscurecen */
:root[data-theme="noche"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.6); }
