/**
 * CIMA — CimaTour (visita guiada por overlay spotlight). Prefijo único .ctour- para todo.
 * Colores SIEMPRE por variables del tema activo (--primary, --accent, --text-…, --glass-…),
 * excepto el velo oscuro del overlay (rgba(0,0,0,.6) — neutro, no es color de tema).
 * Respeta prefers-reduced-motion vía la clase .ctour-no-anim (sin transiciones).
 */

.ctour-root {
    position: fixed;
    inset: 0;
    /* Por ENCIMA de la chrome interactiva que atrapaba la tarjeta: drawers (99990/99991),
       modales (99999) y planner (100000). Por DEBAJO del legal-gate (100010) y de los
       overlays del asistente/soporte (2147483600+), que deben seguir mandando. */
    z-index: 100005;
    pointer-events: none; /* el wrapper no captura; solo .ctour-scrim y .ctour-card sí */
}

/* Capa que bloquea clicks fuera del "hole" (clip-path punzado en JS sobre el rect
   iluminado). Sin fondo propio: el oscurecimiento lo aporta el box-shadow del hole. */
.ctour-scrim {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: auto;
    z-index: 1;
}

/* Ventana iluminada: box-shadow gigante = velo oscuro alrededor. pointer-events:none
   para que el click real "pase" al elemento de la app (el punzado del scrim hace el resto). */
.ctour-hole {
    position: fixed;
    background: transparent;
    border-radius: 10px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .6);
    pointer-events: none;
    z-index: 2;
}
.ctour-root:not(.ctour-no-anim) .ctour-hole {
    transition: left .28s cubic-bezier(.22, 1, .36, 1), top .28s cubic-bezier(.22, 1, .36, 1),
        width .28s cubic-bezier(.22, 1, .36, 1), height .28s cubic-bezier(.22, 1, .36, 1);
}

/* Tarjeta: cristal del ecosistema, acentos por tema */
.ctour-card {
    position: fixed;
    z-index: 3;
    width: 320px;
    max-width: 92vw;
    box-sizing: border-box;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 14px;
    padding: 18px 18px 16px;
    pointer-events: auto; /* la tarjeta SÍ recibe clicks (el root es pointer-events:none) */
    box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
    backdrop-filter: blur(var(--glass-blur, 16px));
    -webkit-backdrop-filter: blur(var(--glass-blur, 16px));
}
.ctour-root:not(.ctour-no-anim) .ctour-card {
    transition: left .28s cubic-bezier(.22, 1, .36, 1), top .28s cubic-bezier(.22, 1, .36, 1),
        opacity .2s ease;
}

.ctour-card.ctour-centered { text-align: center; }

.ctour-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.ctour-close:hover {
    background: color-mix(in srgb, var(--text-main) 10%, transparent);
    color: var(--text-main);
}
.ctour-close i { font-size: .85rem; }

/* Flecha: diamante rotado, mismo cristal que la tarjeta. Posición por eje la fija JS
   (left/top en px); el lado visible por dirección lo fija la clase .ctour-arrow-<pos>. */
.ctour-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transform: rotate(45deg);
    display: none;
}
.ctour-card:not(.ctour-centered) .ctour-arrow { display: block; }
.ctour-arrow-bottom { top: -7px; border-right: 0; border-bottom: 0; }
.ctour-arrow-top    { bottom: -7px; border-left: 0; border-top: 0; }
.ctour-arrow-right  { left: -7px; border-top: 0; border-right: 0; }
.ctour-arrow-left   { right: -7px; border-bottom: 0; border-left: 0; }

.ctour-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 4px 26px 6px 0;
    color: var(--text-main);
}
.ctour-text {
    font-size: .86rem;
    line-height: 1.45;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.ctour-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ctour-count {
    font-size: .72rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
}
.ctour-card.ctour-centered .ctour-foot { justify-content: center; }
.ctour-card.ctour-centered .ctour-count { flex: none; }

.ctour-skip {
    font-size: .78rem;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.ctour-skip:hover { color: var(--text-main); text-decoration: underline; }

.ctour-next {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 10px;
    padding: 9px 14px;
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    background: color-mix(in srgb, var(--primary) 88%, transparent);
    color: var(--primary-text, #fff);
    white-space: nowrap;
}
.ctour-next:hover { background: var(--primary); }
.ctour-next i { font-size: .78rem; }

@media (max-width: 520px) {
    .ctour-card { width: 92vw; }
}
