/* ================================================
   modals.css — Modales v4
   ================================================ */

/* ── Base ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,14,25,0.6);
  z-index: 300;
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(8,14,25,0.3);
  border: 1px solid var(--border-soft);
  animation: scaleIn 0.28s var(--ease-out) both;
}
.modal-wide { max-width: 720px; }

.modal-head {
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: var(--bg-white);
  z-index: 2;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-head h2 {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.6px;
  color: var(--text);
}
.modal-head p {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 4px;
  font-weight: 400;
}

.modal-close {
  background: var(--bg-subtle);
  border: none;
  width: 36px; height: 36px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-soft);
  flex-shrink: 0;
  margin-left: 12px;
  transition: all var(--duration);
  display: flex; align-items: center; justify-content: center;
}
.modal-close .material-icons {
  font-size: 20px;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body { padding: 26px 32px 32px; }

/* ── Nota informativa ── */
.form-note {
  background: rgba(11,111,232,0.06);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 20px;
  line-height: 1.55;
}
.form-note strong { color: var(--blue); }

/* ── Divisor ── */
.modal-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── Resumen de pedido ── */
.order-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  gap: 12px;
}
.order-summary-item:last-child { border-bottom: none; }
.order-item-name { font-size: 14px; color: var(--text-mid); }
.order-item-qty {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--text-soft);
}
.order-item-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

/* ── Total modal ── */
.modal-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  margin-top: 8px;
}
.modal-total-label { font-size: 14px; font-weight: 600; color: var(--text-soft); }
.modal-total-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -1px;
}

/* ── Footer modal ── */
.modal-footer {
  padding: 0 32px 28px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ── Éxito ── */
.modal-success {
  text-align: center;
  padding: 48px 32px;
}
.modal-success-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounceIn 0.5s var(--ease-out);
}
.modal-success h2 {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.7px;
  margin-bottom: 10px;
}
.modal-success p {
  font-size: 15px;
  color: var(--text-soft);
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Progress steps ── */
.modal-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}
.modal-step {
  display: flex;
  align-items: center;
  flex: 1;
}
.step-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-soft);
  flex-shrink: 0;
  transition: all var(--duration-md);
}
.step-circle.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(11,111,232,0.15);
}
.step-circle.done {
  background: var(--brand-cyan2);
  border-color: var(--brand-cyan2);
  color: #fff;
}
.step-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  margin-left: 7px;
  white-space: nowrap;
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 10px;
}
.step-line.done { background: var(--brand-cyan2); }

/* ── Dark mode ── */
[data-theme="dark"] .modal-box { background: var(--bg-white); border-color: var(--border); }
[data-theme="dark"] .modal-head {
  background: var(--bg-white);
  border-bottom-color: var(--border);
}
[data-theme="dark"] .modal-close { background: var(--bg-subtle); }
[data-theme="dark"] .form-note { background: rgba(59,143,255,0.08); }
