/* Consentimiento, mapas y vídeos a la carta (sistema «Taller»). Aceptar y rechazar pesan lo mismo. */
.tm-consent-dialog {
  width: min(42rem, calc(100vw - 24px)); max-width: none; max-height: min(92dvh, 52rem);
  padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  color: var(--ink); background: var(--bg); overflow: auto;
  box-shadow: 0 24px 64px -24px rgb(0 0 0 / .45);
}
.tm-consent-dialog::backdrop { background: rgb(15 16 18 / .55); }
.tm-consent-shell { padding: clamp(18px, 4vw, 28px); }
.tm-consent-brand {
  display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 700; font-size: .9375rem; color: var(--ink-2);
}
.tm-consent-mark { width: 28px; height: 28px; flex: none; }
.tm-consent-eyebrow { margin: 18px 0 4px; font-family: var(--font-display); font-weight: 700; font-size: .9375rem; color: var(--brand-ink); }
.tm-consent-dialog h2 { margin: 0; font-size: clamp(1.4rem, 3.4vw, 1.75rem); }
.tm-consent-dialog h2:focus { outline: none; }
.tm-consent-copy { margin: 10px 0 0; color: var(--ink-2); font-size: .96875rem; line-height: 1.6; }
.tm-consent-links { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .9375rem; }
.tm-consent-links a { color: var(--brand-ink); }
.tm-consent-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.tm-consent-button {
  min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: var(--r-sm);
  color: var(--ink); background: var(--surface); font: inherit; font-size: .96875rem; font-weight: 650; line-height: 1.2; cursor: pointer;
}
.tm-consent-button:hover { background: var(--surface-2); }
.tm-consent-button.tm-consent-primary { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.tm-consent-button.tm-consent-primary:hover { background: var(--brand-press); border-color: var(--brand-press); }
.tm-consent-footnote { margin: 14px 0 0; color: var(--ink-3); font-size: .875rem; line-height: 1.5; }
.tm-consent-options { display: grid; gap: 10px; margin-top: 16px; }
.tm-consent-option {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
.tm-consent-option strong { font-size: .96875rem; }
.tm-consent-option p { margin: 4px 0 0; color: var(--ink-2); font-size: .875rem; line-height: 1.5; }
.tm-switch { display: grid; grid-template-columns: 44px auto; align-items: center; gap: 8px; min-width: 96px; color: var(--ink-2); font-size: .8125rem; cursor: pointer; }
.tm-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tm-switch span {
  position: relative; grid-column: 1; grid-row: 1; width: 44px; height: 26px;
  border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--surface-2); transition: background var(--ease), border-color var(--ease);
}
.tm-switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--ink-3); transition: transform var(--ease), background var(--ease);
}
.tm-switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.tm-switch input:checked + span { border-color: var(--ok); background: var(--ok); }
.tm-switch input:checked + span::after { transform: translateX(18px); background: var(--bg); }
.tm-switch input:disabled + span { opacity: .6; }
.tm-switch b { grid-column: 2; grid-row: 1; font-weight: 600; white-space: nowrap; }
.tm-consent-settings-actions { grid-template-columns: 2fr 1fr; }
.tm-consent-dialog [hidden] { display: none !important; }
@media (max-width: 520px) {
  .tm-consent-actions { grid-template-columns: minmax(0, 1fr); }
  .tm-consent-option { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* Mapa que espera permiso */
.tm-map-consent {
  display: grid; place-content: center; gap: 10px; min-height: 18rem; padding: 20px;
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); text-align: center; background: var(--surface-2);
}
.tm-map-consent strong { font-family: var(--font-display); font-size: 1.125rem; }
.tm-map-consent p { max-width: 40ch; margin: 0 auto; color: var(--ink-2); font-size: .9375rem; line-height: 1.55; }
.tm-map-consent button {
  justify-self: center; margin-top: 4px; min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-sm);
  background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 700; cursor: pointer;
}

/* Vídeo de YouTube: no conecta hasta pulsar «Reproducir» */
.tm-video-opt-in { position: absolute; inset: 0; }
.tm-video-opt-in iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tm-youtube-consent, .repair-video-play {
  position: absolute; inset: 0; width: 100%; height: 100%; display: grid; place-items: center;
  padding: 0; border: 0; color: #f3f1ec; background: #1b1e22; cursor: pointer;
}
.tm-youtube-poster, .repair-video-play .repair-video-poster {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: 10px; padding: clamp(18px, 4vw, 32px); text-align: left; background: #1b1e22;
}
.tm-youtube-poster::after, .repair-video-poster::after {
  content: ""; position: absolute; right: 9%; top: 50%; width: 56px; height: 56px; border-radius: 50%;
  transform: translateY(-50%); background: #e8541e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l9 5-9 5z' fill='%231b1e22'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.tm-youtube-poster b, .repair-video-play .repair-video-poster b { font-size: .8125rem; font-weight: 600; color: #b9bdc3; letter-spacing: 0; }
.tm-youtube-poster strong, .repair-video-play .repair-video-poster strong {
  max-width: 70%; font-family: var(--font-display); font-size: clamp(1.05rem, 3vw, 1.6rem); line-height: 1.2; color: #f3f1ec;
}
.tm-youtube-poster small, .repair-video-play .repair-video-poster small { color: #b9bdc3; font-size: .8125rem; }
.tm-youtube-cta, .repair-video-play .repair-video-cta {
  position: relative; z-index: 1; margin-top: auto; align-self: flex-start; min-height: 40px; padding: 0 16px;
  display: inline-flex; align-items: center; border-radius: var(--r-sm); background: #e8541e; color: #1b1e22; font-size: .9375rem; font-weight: 700;
}
.tm-youtube-consent:focus-visible, .repair-video-play:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

/* Franja de aviso v4 (16-11-2026, Pablo: el aviso no puede tapar la herramienta). Una línea fija abajo (≤ 64 px;
   en el celular, 2 líneas y los botones en una fila, ≤ 85 px), sin oscurecer ni mover la página. privacy-consent.js
   la sube arriba (data-lado) si abajo tapa el título, el campo o los botones de la herramienta. En Europa, los tres
   botones pesan lo mismo; fuera, «Entendido» es el principal. */
.tm-consent-franja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483000;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line-2);
  color: var(--ink); background: var(--bg); box-shadow: 0 -8px 24px -16px rgb(0 0 0 / .45);
  font-size: .875rem; line-height: 1.4;
}
.tm-consent-franja[data-lado="arriba"] { border-top: 0; border-bottom: 1px solid var(--line-2); box-shadow: 0 8px 24px -16px rgb(0 0 0 / .45); }
.tm-consent-franja-in { display: flex; align-items: center; gap: 6px 16px; max-width: var(--max, 1068px); margin: 0 auto; }
.tm-consent-franja p { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--ink-2); }
.tm-consent-franja a, .tm-consent-franja .tm-consent-enlace { color: var(--brand-ink); }
.tm-consent-enlace { padding: 0; border: 0; background: none; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tm-consent-franja-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.tm-consent-franja .tm-consent-button { min-height: 36px; padding: 6px 14px; font-size: inherit; white-space: nowrap; }
@media (max-width: 767px) {
  .tm-consent-franja { padding: 5px 12px calc(5px + env(safe-area-inset-bottom, 0px)); font-size: .8125rem; line-height: 1.3; }
  .tm-consent-franja-in { flex-wrap: wrap; row-gap: 4px; }
  .tm-consent-franja p { flex-basis: 100%; }
  .tm-consent-franja-actions { flex: 1 1 100%; }
  .tm-consent-franja .tm-consent-button { flex: 1 1 auto; min-height: 32px; padding: 4px 8px; }
}
@media print { .tm-consent-franja { display: none; } }
