/* ================================================================
   WP Smart Guided Tours — Frontend CSS v5.0.0
================================================================ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --wt-primary:   #6366f1;
  --wt-primary-d: #4f46e5;
  --wt-success:   #22c55e;
  --wt-danger:    #ef4444;
  --wt-warn:      #f59e0b;
  --wt-info:      #3b82f6;
  --wt-white:     #ffffff;
  --wt-dark:      #1e293b;
  --wt-muted:     #64748b;
  --wt-border:    #e2e8f0;
  --wt-radius:    12px;
  --wt-shadow:    0 20px 60px rgba(0,0,0,.18);
}

/* ════════════════════════════════════════════════════════════════
   BOTÓN FLOTANTE 🎓
   Solo se renderiza cuando hay tours para esta página + rol
════════════════════════════════════════════════════════════════ */
#wpsgt-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wt-primary);
  color: #fff;
  font-size: 24px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(99,102,241,.45);
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, box-shadow .2s, background .2s;
  animation: wpsgt-pop-in .4s cubic-bezier(.34,1.56,.64,1) both;
}
#wpsgt-trigger:hover {
  background: var(--wt-primary-d);
  transform: scale(1.1);
  box-shadow: 0 10px 32px rgba(99,102,241,.55);
}
#wpsgt-trigger:active { transform: scale(.95); }

/* Badge de pendientes */
#wpsgt-trigger::after {
  content: attr(data-count);
  display: none;
  position: absolute;
  top: -4px; right: -4px;
  background: var(--wt-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 20px; height: 20px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  font-family: -apple-system, sans-serif;
}
#wpsgt-trigger[data-count]::after { display: flex; }

@keyframes wpsgt-pop-in {
  from { opacity:0; transform: scale(.6); }
  to   { opacity:1; transform: scale(1); }
}

/* ════════════════════════════════════════════════════════════════
   OVERLAY / SELECTOR DE TOURS
════════════════════════════════════════════════════════════════ */
.wpsgt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wpsgt-selector {
  background: var(--wt-white);
  border-radius: 18px;
  box-shadow: var(--wt-shadow);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: wpsgt-slide-up .25s ease both;
}

@keyframes wpsgt-slide-up {
  from { opacity:0; transform: translateY(20px) scale(.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

.wpsgt-selector__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--wt-border);
}
.wpsgt-selector__head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--wt-dark);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.wpsgt-selector__close {
  width: 32px; height: 32px; border: 1px solid var(--wt-border);
  border-radius: 8px; background: transparent; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  color: var(--wt-muted); transition: all .15s;
}
.wpsgt-selector__close:hover { background: #f1f5f9; color: var(--wt-danger); }

.wpsgt-selector__sub {
  padding: 14px 24px 8px;
  margin: 0;
  font-size: 13px;
  color: var(--wt-muted);
  font-family: -apple-system, sans-serif;
}

.wpsgt-sel-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 12px;
  max-height: 360px;
  overflow-y: auto;
}

.wpsgt-sel-item {
  display: flex;
  align-items: center;
  width: 100%;
  background: transparent;
  border: 1px solid var(--wt-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  text-align: left;
  gap: 12px;
  transition: all .15s;
  font-family: -apple-system, sans-serif;
}
.wpsgt-sel-item:hover {
  background: #ede9fe;
  border-color: var(--wt-primary);
  transform: translateX(3px);
}
.wpsgt-sel-item__info { flex: 1; }
.wpsgt-sel-item__info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--wt-dark);
  margin-bottom: 3px;
}
.wpsgt-sel-item__info span {
  display: block;
  font-size: 12px;
  color: var(--wt-muted);
  margin-bottom: 4px;
}
.wpsgt-sel-item__info small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}
.wpsgt-sel-item__arr {
  font-size: 20px;
  color: var(--wt-primary);
  font-weight: 300;
  flex-shrink: 0;
}

.wpsgt-selector__foot {
  padding: 12px 24px 20px;
  text-align: right;
  border-top: 1px solid var(--wt-border);
}
.wpsgt-ghost-btn {
  background: none; border: 1px solid var(--wt-border); border-radius: 8px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--wt-muted);
  font-family: -apple-system, sans-serif; transition: all .15s;
}
.wpsgt-ghost-btn:hover { background: #f1f5f9; color: var(--wt-dark); }

/* ════════════════════════════════════════════════════════════════
   SHEPHERD.JS — TEMA PERSONALIZADO
════════════════════════════════════════════════════════════════ */
.wpsgt-theme.shepherd-element {
  max-width: 420px !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.20), 0 0 0 1px rgba(99,102,241,.15) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  overflow: visible !important;
}

/* Flecha */
.wpsgt-theme .shepherd-arrow::before {
  background: var(--wt-white) !important;
  box-shadow: none !important;
}

/* Header */
.wpsgt-theme .shepherd-header {
  background: linear-gradient(135deg, var(--wt-primary) 0%, #818cf8 100%) !important;
  border-radius: 16px 16px 0 0 !important;
  padding: 16px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.wpsgt-theme .shepherd-title {
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.15) !important;
  flex: 1 !important;
}
.wpsgt-theme .shepherd-cancel-icon {
  color: rgba(255,255,255,.8) !important;
  font-size: 20px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 !important;
  line-height: 1 !important;
  transition: color .15s !important;
}
.wpsgt-theme .shepherd-cancel-icon:hover { color: #fff !important; }

/* Body */
.wpsgt-theme .shepherd-text {
  background: var(--wt-white) !important;
  padding: 0 !important;
  color: var(--wt-dark) !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
}

/* Contenido del paso */
.wpsgt-step-wrap {
  padding: 18px 20px 14px;
}
.wpsgt-step-text {
  color: var(--wt-dark);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.wpsgt-step-text p    { margin: 0 0 10px; }
.wpsgt-step-text ul,
.wpsgt-step-text ol   { margin: 6px 0 10px 18px; padding: 0; }
.wpsgt-step-text li   { margin-bottom: 4px; }
.wpsgt-step-text strong { color: var(--wt-primary); }
.wpsgt-step-text a    { color: var(--wt-primary); }
.wpsgt-step-text code {
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
  font-family: 'SF Mono','Fira Code',Consolas,monospace; font-size: 12px;
}

/* Pie del paso: counter + barra */
.wpsgt-step-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.wpsgt-step-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--wt-muted);
  white-space: nowrap;
}
.wpsgt-prog {
  flex: 1;
  height: 5px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.wpsgt-prog__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wt-primary), #a78bfa);
  border-radius: 10px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* Footer / botones */
.wpsgt-theme .shepherd-footer {
  background: #f8fafc !important;
  padding: 14px 20px !important;
  border-top: 1px solid var(--wt-border) !important;
  border-radius: 0 0 16px 16px !important;
  display: flex !important;
  gap: 8px !important;
  justify-content: flex-end !important;
}

.wpsgt-theme .shepherd-button {
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border: none !important;
  transition: all .15s !important;
  font-family: -apple-system, sans-serif !important;
}
.wpsgt-theme .wpsgt-next {
  background: var(--wt-primary) !important;
  color: #fff !important;
}
.wpsgt-theme .wpsgt-next:hover {
  background: var(--wt-primary-d) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(99,102,241,.4) !important;
}
.wpsgt-theme .wpsgt-back {
  background: transparent !important;
  color: var(--wt-muted) !important;
  border: 1px solid var(--wt-border) !important;
}
.wpsgt-theme .wpsgt-back:hover {
  background: #f1f5f9 !important;
  color: var(--wt-dark) !important;
}
.wpsgt-theme .wpsgt-skip {
  background: transparent !important;
  color: #94a3b8 !important;
  font-weight: 400 !important;
  text-decoration: underline !important;
  padding: 8px 10px !important;
}
.wpsgt-theme .wpsgt-skip:hover { color: var(--wt-danger) !important; }

/* Overlay de Shepherd */
.shepherd-modal-overlay-container .shepherd-modal-overlay {
  fill: rgba(15,23,42,.5) !important;
}

/* ════════════════════════════════════════════════════════════════
   NOTIFICACIÓN FLOTANTE (flash)
════════════════════════════════════════════════════════════════ */
.wpsgt-flash {
  position: fixed;
  bottom: 100px;
  right: 28px;
  background: var(--wt-white);
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 99999;
  font-family: -apple-system, sans-serif;
  max-width: 340px;
  transform: translateX(120%);
  transition: transform .35s cubic-bezier(.34,1.4,.64,1);
  border-left: 4px solid transparent;
}
.wpsgt-flash--show { transform: translateX(0); }
.wpsgt-flash--success { border-left-color: var(--wt-success); }
.wpsgt-flash--error   { border-left-color: var(--wt-danger); }
.wpsgt-flash--warning { border-left-color: var(--wt-warn); }
.wpsgt-flash--info    { border-left-color: var(--wt-info); }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #wpsgt-trigger { width: 48px; height: 48px; font-size: 20px; bottom: 18px; right: 18px; }
  .wpsgt-theme.shepherd-element { max-width: calc(100vw - 32px) !important; }
  .wpsgt-flash { right: 16px; bottom: 80px; max-width: calc(100vw - 32px); }
  .wpsgt-selector { border-radius: 14px; }
}
