/* =========================================================
   COMPONENTES REUTILIZABLES - MovilGSM
   Botones consistentes en todo el sistema
   ========================================================= */

/* ---------- Botones base ---------- */
.btn-mg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.5;
}

/* Tamaños */
.btn-mg-xs   { padding: 0.25rem 0.5rem;   font-size: 0.75rem;  }
.btn-mg-sm   { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-mg      { padding: 0.5rem 1rem;      font-size: 0.875rem; }
.btn-mg-lg   { padding: 0.625rem 1.25rem; font-size: 1rem;     }
.btn-mg-xl   { padding: 0.75rem 1.5rem;   font-size: 1.125rem; }

/* Ancho */
.btn-mg-block { width: 100%; }

/* ---------- Variantes de color ---------- */
.btn-mg-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(37,99,235,0.25);
}
.btn-mg-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

.btn-mg-secondary {
  background: #fff;
  color: #475569;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-mg-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}

.btn-mg-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  border-color: #047857;
  box-shadow: 0 1px 3px rgba(5,150,105,0.25);
}
.btn-mg-success:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 4px 12px rgba(5,150,105,0.35);
  transform: translateY(-1px);
}

.btn-mg-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
  border-color: #b91c1c;
  box-shadow: 0 1px 3px rgba(220,38,38,0.25);
}
.btn-mg-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  box-shadow: 0 4px 12px rgba(220,38,38,0.35);
  transform: translateY(-1px);
}

.btn-mg-warning {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  border-color: #b45309;
  box-shadow: 0 1px 3px rgba(217,119,6,0.25);
}
.btn-mg-warning:hover {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  box-shadow: 0 4px 12px rgba(217,119,6,0.35);
  transform: translateY(-1px);
}

.btn-mg-info {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  color: #fff;
  border-color: #0e7490;
  box-shadow: 0 1px 3px rgba(8,145,178,0.25);
}
.btn-mg-info:hover {
  background: linear-gradient(135deg, #0e7490 0%, #155e75 100%);
  box-shadow: 0 4px 12px rgba(8,145,178,0.35);
  transform: translateY(-1px);
}

/* Outline variants */
.btn-mg-outline-primary {
  background: transparent;
  color: #2563eb;
  border-color: #2563eb;
}
.btn-mg-outline-primary:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.btn-mg-outline-secondary {
  background: transparent;
  color: #64748b;
  border-color: #cbd5e1;
}
.btn-mg-outline-secondary:hover {
  background: #f8fafc;
  color: #475569;
}

/* Ghost / subtle */
.btn-mg-ghost {
  background: transparent;
  color: #475569;
  border-color: transparent;
}
.btn-mg-ghost:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* Disabled */
.btn-mg:disabled,
.btn-mg.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---------- Payment selector ---------- */
.mg-payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 576px) {
  .mg-payment-methods {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 768px) {
  .mg-payment-methods {
    grid-template-columns: repeat(5, 1fr);
  }
}

.mg-pay-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.875rem 0.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mg-pay-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.mg-pay-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.mg-pay-btn .mg-pay-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.mg-pay-btn.efectivo.active   { border-color: #059669; background: #ecfdf5; color: #047857; box-shadow: 0 0 0 3px rgba(5,150,105,0.15); }
.mg-pay-btn.transferencia.active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.mg-pay-btn.sinpe.active      { border-color: #d97706; background: #fffbeb; color: #b45309; box-shadow: 0 0 0 3px rgba(217,119,6,0.15); }
.mg-pay-btn.combinado.active  { border-color: #7c3aed; background: #f5f3ff; color: #6d28d9; box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }

.mg-payment-details {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}

.mg-pay-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.mg-pay-row:last-child { border-bottom: none; }

.mg-pay-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  font-weight: 600;
  font-size: 0.875rem;
}
.mg-pay-label i { font-size: 1.1rem; }

.mg-pay-input {
  flex: 1;
}
.mg-pay-input input[type="number"],
.mg-pay-input input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}
.mg-pay-input input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* input-group integrado */
.mg-pay-input .input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.mg-pay-input .input-group-text {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-right: none;
  border-radius: 0.5rem 0 0 0.5rem;
}
.mg-pay-input .input-group .form-control {
  border-radius: 0 0.5rem 0.5rem 0;
  flex: 1;
  min-width: 0;
}

.mg-pay-status {
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  margin-top: 0.75rem;
}
.mg-pay-status.ok    { background: #dcfce7; color: #166534; }
.mg-pay-status.warn  { background: #fef3c7; color: #92400e; }
.mg-pay-status.error { background: #fee2e2; color: #991b1b; }
