/* ================================================
   modals.css — Modales v8 MAXIMALISTA
   ================================================ */

/* ── Base ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 300;
  backdrop-filter: blur(14px);
  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 40px 100px rgba(0,0,0,0.90), 0 0 0 1px rgba(47,98,212,0.12);
  border: 1px solid var(--card-border);
  animation: scaleIn 0.28s var(--ease-out) both;
  position: relative;
}
/* Línea dorada arriba del modal */
.modal-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #5B8DEF 25%, #2F62D4 75%, transparent);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 3;
}
.modal-wide { max-width: 720px; }

.modal-head {
  padding: 32px 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.7px;
  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: 1px solid var(--border);
  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: rgba(255,69,96,0.12); border-color: rgba(255,69,96,0.28); color: #FF7090; }

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

/* ── Nota informativa ── */
.form-note {
  background: linear-gradient(135deg, rgba(47,98,212,0.07) 0%, rgba(30,71,160,0.05) 100%);
  border: 1px solid rgba(47,98,212,0.18);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-note-item {
  display: flex; align-items: flex-start; gap: 12px;
}
.form-note-item .material-icons {
  font-size: 22px; color: var(--blue); flex-shrink: 0; margin-top: 1px;
}
.form-note-item strong {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--text); margin-bottom: 2px;
}
.form-note-item p {
  font-size: 12px; color: var(--text-soft); margin: 0; line-height: 1.5;
}
[data-theme="dark"] .form-note {
  background: linear-gradient(135deg, rgba(47,98,212,0.08) 0%, rgba(30,71,160,0.06) 100%);
  border-color: rgba(47,98,212,0.20);
}

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

/* ── Resumen de pedido ── */
.order-summary {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
}
.order-summary-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--text);
}
.order-summary-head .material-icons { font-size: 18px; color: var(--gold); }
.order-summary-count {
  margin-left: auto;
  background: linear-gradient(135deg, #5B8DEF, #2F62D4);
  color: #FFFFFF;
  font-size: 11px; font-weight: 800;
  padding: 2px 9px; border-radius: 99px;
}
.order-summary-list { padding: 4px 0; }
.order-item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.order-item-row:last-child { border-bottom: none; }
.order-item-icon { font-size: 18px; flex-shrink: 0; width: 28px; text-align: center; }
.order-item-name {
  flex: 1; font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.order-item-qty {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 800;
  background: rgba(47,98,212,0.10);
  color: var(--gold);
  border: 1px solid rgba(47,98,212,0.22);
  padding: 2px 8px; border-radius: 99px; flex-shrink: 0;
}
.order-item-price {
  font-size: 12px; font-weight: 500; color: var(--text-soft);
  white-space: nowrap; flex-shrink: 0;
}
.order-total-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(47,98,212,0.07), rgba(30,71,160,0.04));
  border-top: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-mid);
}
.order-total-row .material-icons { font-size: 16px; color: var(--gold); }

/* ── 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: 'DM Sans', sans-serif;
  font-size: 30px; font-weight: 900;
  background: linear-gradient(135deg, #5B8DEF, #2F62D4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -1.5px;
}

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

/* ── Éxito ── */
.modal-success {
  text-align: center; padding: 52px 32px;
}
.modal-success-icon {
  font-size: 72px; margin-bottom: 18px;
  animation: bounceIn 0.5s var(--ease-out);
}
.modal-success h2 {
  font-size: 28px; font-weight: 900;
  color: var(--text); letter-spacing: -0.8px; margin-bottom: 12px;
}
.modal-success p {
  font-size: 15px; color: var(--text-soft);
  max-width: 400px; margin: 0 auto; line-height: 1.65;
}

/* ── 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: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 900; color: var(--text-soft);
  flex-shrink: 0; transition: all var(--duration-md);
}
.step-circle.active {
  background: linear-gradient(135deg, #5B8DEF, #2F62D4);
  border-color: transparent; color: #FFFFFF;
  box-shadow: 0 0 20px rgba(47,98,212,0.35);
}
.step-circle.done {
  background: var(--gold-dark);
  border-color: var(--gold-dark); color: #FFFFFF;
}
.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: linear-gradient(90deg, var(--gold-dark), var(--gold)); }

/* ── Dark mode (admin) ── */
[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); }

/* ── Responsive móvil ── */
@media (max-width: 600px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    max-width: 100%; max-height: 92vh;
    border-radius: 24px 24px 0 0;
    animation: modalSlideUp 0.3s cubic-bezier(0.32,0.72,0,1);
  }
  @keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .modal-head { padding: 24px 20px 16px; }
  .modal-head h2 { font-size: 19px; }
  .modal-body { padding: 18px 20px 24px; }
  .modal-footer { padding: 0 20px 24px; flex-direction: column; }
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary { width: 100%; justify-content: center; }
}
