:root {
  --mkz: #76236c;
  --mkz-light: rgba(118,35,108,.12);
  --mkz-mid:   rgba(118,35,108,.75);
}

.mkz-no-scroll { overflow: hidden; }

/* ── Overlay ── */
#mkz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
}

/* ── Floatbar inferior ── */
#mkz-floatbar {
  position: fixed;
  left: 0; right: 0; bottom: 14px;
  z-index: 99997;
  pointer-events: none;
}
.mkz-floatbar-inner {
  pointer-events: auto;
  max-width: 680px;
  margin: 0 auto;
  padding: 10px 14px;
  border-radius: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: var(--mkz-mid);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  transform: translateY(10px);
  opacity: 0;
  animation: mkzFloatIn .3s ease forwards;
}
@keyframes mkzFloatIn { to { transform: translateY(0); opacity: 1; } }

#mkz-float-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.3;
}
#mkz-float-text .mkz-where {
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.mkz-float-action {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  transition: filter .15s, transform .15s;
}
.mkz-float-action:hover { filter: brightness(.92); transform: translateY(-1px); }
.mkz-float-action.is-mk   { background: #fff; color: var(--mkz); }
.mkz-float-action.is-warn { background: #ff7a00; color: #fff; }

@media (max-width: 520px) {
  #mkz-floatbar { bottom: 10px; }
  .mkz-floatbar-inner { margin: 0 10px; }
}

/* ── Topbar (shortcode [mkz_topbar]) ── */
#mkz-topbar {
  position: relative;
  width: 100%;
  background: var(--mkz);
  color: #fff;
  z-index: 1000;
  display: flex;
  justify-content: center;
}
.mkz-topbar-inner {
  width: 100%;
  max-width: 1200px;
  padding: 10px 14px;
  font-size: 14px;
  text-align: center;
}
#mkz-topbar-text { display: block; width: 100%; }

/* ── Wizard modal ── */
#mkz-wizard {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
  max-width: 94%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  z-index: 99999;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  animation: mkzWizardIn .2s ease;
}
@keyframes mkzWizardIn {
  from { opacity: 0; transform: translate(-50%,-50%) scale(.97); }
  to   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

/* Header del wizard */
.mkz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}
.mkz-title {
  font-weight: 700;
  color: var(--mkz);
  font-size: 16px;
}
.mkz-close {
  background: none;
  border: none;
  color: var(--mkz);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  transition: background .15s;
  line-height: 1;
}
.mkz-close:hover { background: var(--mkz-light); }

/* Contenido del paso */
.mkz-step { display: none; padding: 22px 24px; }
.mkz-step.active { display: block; }

.mkz-step h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--mkz);
}
.mkz-step p {
  margin: 0 0 16px;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

#mkz-wizard input,
#mkz-wizard select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  background: #fff;
}
#mkz-wizard input:focus,
#mkz-wizard select:focus {
  border-color: var(--mkz);
  box-shadow: 0 0 0 3px rgba(118,35,108,.14);
}

#mkz-wizard button.mkz-btn-primary, #mkz-wizard button.mkz-btn-action, #mkz-wizard #mkz-next, #mkz-wizard #mkz-btn-vendedores {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 13px 14px;
  border: none;
  border-radius: 10px;
  background: var(--mkz);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  transition: filter .15s, transform .15s;
}
#mkz-wizard button.mkz-btn-primary:hover, #mkz-wizard #mkz-next:hover, #mkz-wizard #mkz-btn-vendedores:hover {
  filter: brightness(.92);
  transform: translateY(-1px);
}
#mkz-wizard #mkz-btn-vendedores:disabled {
  opacity: .6;
  cursor: default;
  transform: none;
}

/* Loading inline en botón */
.mkz-btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mkSpin .6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

.mkz-back-link {
  display: block;
  margin-top: 12px;
  color: #888;
  font-size: 13px;
  text-decoration: none;
  line-height: 1.5;
}
.mkz-back-link:hover { color: var(--mkz); }
.mkz-back-link strong { color: var(--mkz); }

#mkz-error {
  margin-top: 10px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
  line-height: 1.4;
}

/* ── Modal de confirmación detección GPS/IP ── */
#mkz-detect-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mkz-detect-box {
  width: 420px;
  max-width: 92%;
  background: #fff;
  border-radius: 18px;
  padding: 28px 26px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  position: relative;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  animation: mkzWizardIn .2s ease;
}
.mkz-detect-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 34px; height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(0,0,0,.06);
  color: var(--mkz);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.mkz-detect-close:hover { background: var(--mkz-light); }
.mkz-detect-icon { font-size: 40px; margin-bottom: 10px; }
.mkz-detect-text {
  color: #333;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.mkz-detect-actions { display: flex; flex-direction: column; gap: 8px; }
.mkz-detect-actions button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: filter .15s;
}
#mkz-detect-ok   { background: var(--mkz); color: #fff; }
#mkz-detect-change { background: #f1f5f9; color: #334155; }
#mkz-detect-ok:hover    { filter: brightness(.92); }
#mkz-detect-change:hover { background: #e2e8f0; }

/* ── Loader pantalla completa ── */
#mkz-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mkzFadeIn .2s ease;
}
@keyframes mkzFadeIn { from { opacity: 0; } to { opacity: 1; } }

.mkz-loading-box {
  background: #fff;
  padding: 32px 44px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: mkzPop .25s ease forwards;
}
@keyframes mkzPop { from { transform: scale(.95); } to { transform: scale(1); } }

.mkz-spinner {
  width: 40px; height: 40px;
  border: 3px solid #e9e9e9;
  border-top: 3px solid var(--mkz);
  border-radius: 50%;
  animation: mkSpin .65s linear infinite;
  margin: 0 auto;
}
.mkz-loading-text {
  font-size: 16px;
  font-weight: 600;
  margin-top: 14px;
  color: #444;
  transition: opacity .2s;
}
@keyframes mkSpin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   STEPPER 3 PASOS
═══════════════════════════════════════ */
.mkz-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 14px 24px 0;
}
.mkz-step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.mkz-dot-active { background: var(--mkz); color: #fff; }
.mkz-dot-done   { background: #16a34a; color: #fff; }
.mkz-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  transition: background .2s;
  max-width: 60px;
}
.mkz-line-done { background: #16a34a; }

/* ═══════════════════════════════════════
   LISTA DE COLONIAS
═══════════════════════════════════════ */
.mkz-search-wrap {
  margin-bottom: 10px;
}
.mkz-search-wrap input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.mkz-search-wrap input:focus { border-color: var(--mkz); }

.mkz-colonias-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 10px;
}
/* Items como DIV — no hereda estilos de botones del tema */
.mkz-colonia-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.4;
  transition: background .12s;
  box-sizing: border-box;
  user-select: none;
}
.mkz-colonia-item:last-child { border-bottom: none; }
.mkz-colonia-item:hover { background: #f8fafc; }
.mkz-colonia-item.selected { background: #f8fafc; border-left: 3px solid var(--mkz); }
.mkz-col-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  color: transparent;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.mkz-colonia-item.selected .mkz-col-check { background: var(--mkz); color: #fff; }
.mkz-col-info { display: flex; flex-direction: column; gap: 1px; }
.mkz-col-nombre { font-weight: 600; color: #1e293b; }
.mkz-col-muni   { font-size: 12px; color: #94a3b8; }
.mkz-colonia-empty {
  padding: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.mkz-error-msg {
  margin-top: 6px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  min-height: 16px;
}

/* ═══════════════════════════════════════
   PASO 3 — VENDEDORES
═══════════════════════════════════════ */
.mkz-code-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.mkz-code-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.mkz-code-row input:focus { border-color: var(--mkz); }
.mkz-code-row button {
  background: var(--mkz);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  margin-top: 0 !important;
  width: auto !important;
  display: inline-block !important;
}
.mkz-code-row button:hover { filter: brightness(.92); }

.mkz-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: #94a3b8;
  font-size: 12px;
}
.mkz-divider::before,
.mkz-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.mkz-vendedores-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.mkz-vendor-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mkz-vendor-card:hover { border-color: var(--mkz); background: #fdf4ff; }
.mkz-vendor-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--mkz);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mkz-vendor-info { flex: 1; }
.mkz-vendor-name { font-weight: 700; font-size: 14px; color: #1e293b; }
.mkz-vendor-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.mkz-tag { font-size: 11px; padding: 2px 7px; border-radius: 20px; font-weight: 600; }
.mkz-tag-disc { background: #fdf4ff; color: var(--mkz); border: 1px solid #e9d5ff; }
.mkz-tag-ship { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.mkz-vendor-btn {
  background: var(--mkz);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  margin-top: 0 !important;
  width: auto !important;
  display: inline-block !important;
}
.mkz-vendor-btn:hover { filter: brightness(.92); }

.mkz-btn-sin-vendedor {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.mkz-btn-sin-vendedor:hover { background: #f1f5f9; }

.mkz-no-vendors {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 12px 0;
  line-height: 1.5;
}
.mkz-loading-vendors {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 16px 0;
}


/* Override explícito para items de colonias — nunca fondo morado */
#mkz-wizard .mkz-colonia-item {
  background: #fff !important;
  color: #1e293b !important;
  border-radius: 0 !important;
  padding: 10px 14px !important;
  margin-top: 0 !important;
  width: 100% !important;
  display: flex !important;
}
#mkz-wizard .mkz-colonia-item:hover {
  background: #f8fafc !important;
}
#mkz-wizard .mkz-colonia-item.selected {
  background: #f8fafc !important;
  border-left: 3px solid var(--mkz) !important;
}
#mkz-wizard .mkz-col-nombre { color: #1e293b !important; font-weight: 600 !important; }
#mkz-wizard .mkz-col-muni   { color: #64748b !important; font-size: 12px !important; }
