/* ECS — Skin del motor de guías interactivas (frontend).
   Estilos del launcher + catálogo (propios) y overrides de marca para el
   bocadillo/overlay de Shepherd.js (clase .ecsg-shepherd).
   Prefijo .ecsg- para no colisionar con el resto del tema. */

:root {
    --ecsg-primary: #1d4ed8;
    --ecsg-primary-hover: #1e40af;
    --ecsg-radius: 12px;
    --ecsg-shadow: 0 10px 40px rgba(0, 0, 0, .18);
    --ecsg-z: 20000;
}

/* ── Launcher flotante ───────────────────────────────────────────────── */
.ecsg-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: var(--ecsg-primary);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--ecsg-shadow);
    z-index: var(--ecsg-z);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, background .15s ease;
}
.ecsg-launcher:hover { background: var(--ecsg-primary-hover); transform: translateY(-2px); }

.ecsg-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Modal de catálogo ───────────────────────────────────────────────── */
.ecsg-modal {
    position: fixed;
    right: 20px;
    bottom: 86px;
    width: 360px;
    max-width: calc(100vw - 40px);
    max-height: 70vh;
    background: #fff;
    border-radius: var(--ecsg-radius);
    box-shadow: var(--ecsg-shadow);
    z-index: var(--ecsg-z);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.ecsg-modal.ecsg-show { display: flex; }

/* Ocultar el modal launcher cuando hay una guía activa */
.shepherd-active .ecsg-modal {
    display: none !important;
}

.ecsg-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-weight: 700;
    border-bottom: 1px solid #eee;
}
.ecsg-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}
.ecsg-modal-body { padding: 8px; overflow-y: auto; }
.ecsg-empty { padding: 24px 16px; color: #6b7280; text-align: center; }

/* ── Tarjeta de guía ─────────────────────────────────────────────────── */
.ecsg-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    transition: background .12s ease;
}
.ecsg-card:hover { background: #f3f4f6; }
.ecsg-card-icon { font-size: 24px; color: var(--ecsg-primary); flex: 0 0 auto; }
.ecsg-card-main { flex: 1 1 auto; min-width: 0; }
.ecsg-card-title { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ecsg-card-summary { font-size: 13px; color: #6b7280; }

.ecsg-dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; flex: 0 0 auto; }
.ecsg-dot.ecsg-progress { background: #f59e0b; }
.ecsg-dot.ecsg-done { background: #22c55e; }

/* ── Botones (catálogo + footer de Shepherd) ─────────────────────────── */
.ecsg-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.ecsg-btn:hover { background: #f3f4f6; }
.ecsg-btn.ecsg-primary { background: var(--ecsg-primary); border-color: var(--ecsg-primary); color: #fff; }
.ecsg-btn.ecsg-primary:hover { background: var(--ecsg-primary-hover); }
.ecsg-card-cta { flex: 0 0 auto; }

.ecsg-img { width: 100%; border-radius: 8px; margin: 8px 0; }

/* ── Overrides de marca para Shepherd.js ─────────────────────────────── */
.ecsg-shepherd.shepherd-element {
    border-radius: var(--ecsg-radius);
    box-shadow: var(--ecsg-shadow);
    max-width: 340px;
}
.ecsg-shepherd .shepherd-header {
    background: transparent;
    padding: 14px 16px 0;
}
.ecsg-shepherd .shepherd-title { font-weight: 700; font-size: 16px; color: #111827; }
.ecsg-shepherd .shepherd-text { font-size: 14px; color: #374151; line-height: 1.5; padding: 8px 16px 0; }
.ecsg-shepherd .shepherd-footer { padding: 14px 16px; gap: 8px; display: flex; justify-content: flex-end; }

/* Botones del tour: base común (alto contraste, distinguibles entre sí). */
.ecsg-shepherd .shepherd-footer .shepherd-button {
    margin: 0;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
/* Siguiente / Finalizar: fondo blanco, letras y borde azules. */
.ecsg-shepherd .shepherd-footer .shepherd-button.ecsg-next {
    background: #fff;
    color: var(--ecsg-primary);
    border-color: var(--ecsg-primary);
}
.ecsg-shepherd .shepherd-footer .shepherd-button.ecsg-next:hover {
    background: #eff6ff;
    color: var(--ecsg-primary-hover);
    border-color: var(--ecsg-primary-hover);
}
/* Atrás: contorno gris sobre blanco. */
.ecsg-shepherd .shepherd-footer .shepherd-button.ecsg-back {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.ecsg-shepherd .shepherd-footer .shepherd-button.ecsg-back:hover { background: #f3f4f6; }
/* Saltar: discreto, estilo enlace. */
.ecsg-shepherd .shepherd-footer .shepherd-button.ecsg-skip {
    background: transparent;
    color: #6b7280;
    border-color: transparent;
    text-decoration: underline;
}
.ecsg-shepherd .shepherd-footer .shepherd-button.ecsg-skip:hover { color: #374151; }

@media (max-width: 480px) {
    .ecsg-modal { right: 10px; left: 10px; width: auto; bottom: 80px; }
}
