@import url("./tour-presupuesto.css");

/* The map stays in Inicio. Opening a chapter uses the CRM control itself. */
.tour-invitation {
  display: grid; grid-template-columns: minmax(270px, 5fr) minmax(330px, 4fr);
  margin-bottom: 18px; padding: 0; gap: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface);
}
.tour-welcome-body { padding: 22px 26px; align-self: center; }
.tour-invitation .tour-eyebrow { margin: 0 0 5px; color: var(--accent); font-size: .78rem; font-weight: 700; }
.tour-invitation h2, .tour-tip h2 { font-family: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif; }
.tour-invitation h2 { margin: 0; font-size: clamp(1.35rem, 2.2vw, 1.85rem); line-height: 1.15; letter-spacing: -.035em; }
.tour-description { max-width: 54ch; margin: 8px 0 15px; color: var(--ink-soft); font-size: .91rem; line-height: 1.5; }
.tour-home-actions, .tour-welcome-foot, .tour-welcome-foot > div, .tour-welcome-foot > span { display: flex; align-items: center; gap: 8px; }
.tour-home-actions, .tour-welcome-foot > div { flex-wrap: wrap; }
.tour-home-actions button { min-height: 40px; }
.tour-themes {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-content: center; align-items: start;
  margin: 0; padding: 24px 16px; list-style: none;
  background: var(--surface-2); border-inline-start: 1px solid var(--line);
}
.tour-themes li { position: relative; display: grid; justify-items: center; gap: 8px;
  color: var(--ink); font-size: .78rem; font-weight: 700; text-align: center; }
.tour-themes li:not(:last-child)::after { content: ""; position: absolute; top: 22px; left: 50%; width: 100%; border-top: 2px dashed var(--line-strong); }
.tour-theme-icon, .tour-section-icon { display: grid; place-items: center; color: var(--accent); }
.tour-theme-icon { position: relative; z-index: 1; width: 44px; height: 44px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 1px 2px rgb(14 42 33 / 6%); }
.tour-theme-icon .ic { width: 21px; height: 21px; }
.tour-welcome-foot { grid-column: 1 / -1; justify-content: space-between; flex-wrap: wrap;
  padding: 6px 20px 6px 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.tour-welcome-foot .ic { width: 15px; height: 15px; }
.tour-welcome-foot .link-button { padding: 6px; font-size: inherit; color: var(--ink-soft); }
.tour-replay { margin-bottom: 12px; }
.tour-replay button { display: inline-flex; gap: 7px; align-items: center; }
.tour-replay .ic { width: 16px; height: 16px; }
.tour-layer {
  position: fixed; inset: auto; margin: 0; padding: 0; border: 0;
  overflow: visible; pointer-events: none; z-index: 2147483647;
  max-width: none; max-height: none; background: transparent; color: var(--ink);
}
.tour-layer::backdrop { background: transparent; pointer-events: none; }
.tour-shade, .tour-context, .tour-outline, .tour-tip { position: absolute; box-sizing: border-box; }
.tour-shade { pointer-events: auto; }
.tour-context { pointer-events: none; border-radius: 10px; box-shadow: 0 0 0 200vmax rgb(12 23 20 / 20%); }
/* The guide supplies the tint while a native form is open. */
dialog:modal:has(> .tour-layer)::backdrop { background: transparent; }
.tour-outline { pointer-events: none; border: 2px solid var(--accent); border-radius: 10px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-line); }
.tour-tip {
  pointer-events: auto; width: min(356px,calc(100% - 20px)); max-height: calc(100% - 16px);
  padding: 15px 18px; border-radius: 16px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 14px 42px rgb(5 24 15 / 22%), 0 2px 7px rgb(5 24 15 / 10%); font-family: inherit; text-align: left;
}
.tour-tip::before { content:''; position:absolute; width:12px; height:12px; transform:rotate(45deg); background:var(--surface); }
.tour-tip[data-side=right]::before { left:-6px; top:calc(var(--arrow-at) - 6px); }
.tour-tip[data-side=left]::before { right:-6px; top:calc(var(--arrow-at) - 6px); }
.tour-tip[data-side=top]::before { bottom:-6px; left:calc(var(--arrow-at) - 6px); }
.tour-tip[data-side=bottom]::before { top:-6px; left:calc(var(--arrow-at) - 6px); }
.tour-tip[data-side=none] { overflow: auto; }
.tour-tip[data-side=none]::before { display:none; }
.tour-tip-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tour-tip [data-tour-count] { color: var(--muted); font-size: .69rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
.tour-bars { display: flex; gap: 3px; flex: 1; }
.tour-bars i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.tour-bars .on { background: var(--accent); }
.tour-tip [data-tour-pause] { font: inherit; font-size: .76rem; font-weight: 600; color: var(--ink-soft); border: none; border-radius: 7px; background: transparent; padding: 5px 6px; cursor: pointer; }
.tour-tip [data-tour-pause]:hover { background: var(--surface-2); }
.tour-section { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; color: var(--accent); font-size: .8rem; font-weight: 700; }
.tour-section-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); }
.tour-tip h2 { margin: 0; font-size: 1.15rem; line-height: 1.2; letter-spacing: -.025em; color: var(--ink); }
.tour-tip p { margin: 5px 0 0; font-size: .86rem; line-height: 1.45; color: var(--ink-soft); }
.tour-hint { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 8px 10px;
  border-radius: 9px; background: var(--surface-2); font-size: .78rem; line-height: 1.4; color: var(--ink-soft); }
.tour-hint .ic { width: 16px; height: 16px; color: var(--accent); }
.tour-tip [data-tour-storage-warning]:empty { margin: 0; }
.tour-tip [data-tour-storage-warning]:not(:empty) { margin-top: 8px; border-radius: 8px; padding: 7px 9px; background: var(--warn-soft); color: var(--warn); }
.tour-tip .primary { display: flex; margin: 12px 0 0 auto; min-height: 38px; }
.tour-tip [hidden] { display: none !important; }
.tour-tip[data-done="true"] [data-tour-count] { color: var(--accent); }
.tour-tip[data-done="true"] .tour-section-icon { width: 40px; height: 40px; }
@media (max-width: 980px) {
  .tour-invitation { grid-template-columns: 1fr; }
  .tour-themes { grid-row: 1; padding: 14px 18px; border: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 650px) {
  .tour-welcome-body { padding: 16px; }
  .tour-themes { padding: 12px 5px; }
  .tour-themes li { gap: 5px; font-size: .68rem; }
  .tour-theme-icon { width: 34px; height: 34px; border-radius: 10px; }
  .tour-theme-icon .ic { width: 17px; height: 17px; }
  .tour-themes li:not(:last-child)::after { top: 17px; }
  .tour-welcome-foot { gap: 0 6px; padding: 5px 10px; }
  .tour-welcome-foot > div { gap: 1px; }
  .tour-home-actions button { flex: 1 1 155px; }
  .tour-tip { width: min(322px, calc(100% - 20px)); padding: 10px 14px; }
  .tour-tip-top { margin-bottom: 4px; }
  .tour-section { margin-bottom: 5px; }
  .tour-section-icon { width: 25px; height: 25px; border-radius: 7px; }
  .tour-section-icon .ic { width: 16px; height: 16px; }
  .tour-tip h2 { font-size: 1.05rem; }
  .tour-tip .primary { margin-top: 8px; }
}

/* First visit: the invitation sits above Inicio; the interactive guide uses its own lighter overlay. */
.tour-welcome-dialog {
  position: fixed; inset: 0; margin: auto; width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  box-sizing: border-box; padding: 0; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 30px 80px rgb(5 14 10 / 45%);
}
.tour-welcome-dialog::backdrop { background: rgb(5 14 10 / 62%); }
body:has(.tour-welcome-dialog[open]) { overflow: hidden; }
body:has(.tour-welcome-dialog[open]) .tour-invitation { display: none; }
.tour-popup-top { position: relative; }
.tour-popup-top .tour-themes { padding: 30px 32px 22px; border: 0; border-bottom: 1px solid var(--line); }
.tour-popup-top .tour-theme-icon { width: 50px; height: 50px; border-radius: 15px; }
.tour-popup-top .tour-themes li:not(:last-child)::after { top: 25px; }
.tour-popup-top small { padding-inline: 5px; font-weight: 400; font-size: .76rem; line-height: 1.35; color: var(--muted); }
.tour-popup-close { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.tour-popup-close:hover { background: var(--surface-3); }
.tour-welcome-dialog .tour-welcome-body { padding: 24px 32px 0; }
.tour-welcome-dialog .tour-eyebrow { margin: 0 0 6px; font-weight: 700; font-size: .8rem; color: var(--accent); }
.tour-welcome-dialog h2 { margin: 0; overflow-wrap: anywhere; font: 700 clamp(24px, 4vw, 30px)/1.14 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -.03em; }
.tour-welcome-dialog #tour-popup-description { margin: 10px 0; line-height: 1.55; color: var(--ink-soft); }
.tour-welcome-dialog [data-welcome-error] { color: var(--danger); }
.tour-popup-foot { display: flex; align-items: center; gap: 10px; padding: 12px 32px 4px; }
.tour-popup-foot > span { display: flex; align-items: center; gap: 6px; flex: 1; color: var(--muted); font-size: .8rem; }
.tour-popup-foot > span .ic { width: 15px; }
.tour-popup-foot button { min-height: 44px; }
.tour-popup-reject { display: block; margin: 3px 32px 15px auto; font-size: .75rem; color: var(--muted); }
@media (max-width: 640px) {
  .tour-welcome-dialog { inset: auto 0 max(12px, env(safe-area-inset-bottom)); margin: 0 auto; border-radius: 18px; }
  .tour-popup-top .tour-themes { padding: 24px 7px 14px; }
  .tour-popup-top .tour-theme-icon { width: 36px; height: 36px; border-radius: 11px; }
  .tour-popup-top .tour-themes li:not(:last-child)::after { top: 18px; }
  .tour-popup-top small { display: none; }
  .tour-popup-close { width: 30px; height: 30px; top: 0; right: 0; }
  .tour-welcome-dialog .tour-welcome-body { padding: 20px 18px 0; }
  .tour-popup-foot { display: grid; grid-template-columns: 1fr auto; padding: 12px 18px 4px; }
  .tour-popup-foot .primary { grid-row: 1; grid-column: 1 / -1; justify-content: center; }
  .tour-popup-reject { margin-right: 18px; }
}
