/* ─────────────────────────────────────────────────────────────
 * feedback.css - Modals / toasts / confirms propios (sin SweetAlert)
 * Estilo: overlay rgba(0,0,0,.9) + modal negro sólido, borde #1c1c1c,
 * icono SVG animado, botones con máscara slide en hover.
 * ───────────────────────────────────────────────────────────── */

.fb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  padding: 1rem;
  box-sizing: border-box;
}

/* Revelado por JS (.fb-ready): aparece centrado de una vez, sin flash. */
.fb-overlay.fb-ready {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease;
}

.fb-modal {
  position: relative;
  background: #000;
  border: 1px solid #1c1c1c;
  border-radius: 10px;
  width: min(90%, 420px);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 40px 30px 30px;
  text-align: center;
  color: #f8fafc;
  font-family: var(--font-body);
  transform: translateY(14px);
  box-sizing: border-box;
}

.fb-overlay.fb-ready .fb-modal {
  animation: fb-rise 0.3s ease forwards;
}

.fb-modal p {
  font-family: var(--jost);
  font-size: 0.9rem;
  font-weight: 300;
  color: #cfcfcf;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}

.fb-modal h3 {
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0;
  overflow-wrap: anywhere;
}

.fb-input {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid #383838;
  border-radius: 6px;
  background: #090909;
  color: #f8fafc;
  font: inherit;
  text-align: left;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fb-input:focus {
  border-color: var(--color-primario, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

/* Nombre destacado dentro del modal (usuario protagonista) */
.fb-user {
  font-weight: 300;
  font-size: 1.9rem;
  line-height: 1.2;
  color: #f5f5f5;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

/* Icono animado según tipo */
.fb-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 2px solid;
}

.fb-icon svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fb-icon.success { color: #4ade80; animation: fb-pop 0.4s ease; }
.fb-icon.error   { color: #f87171; animation: fb-pop 0.4s ease; }
.fb-icon.warning { color: #fbbf24; animation: fb-pop 0.4s ease; }
.fb-icon.info    { color: #60a5fa; animation: fb-pop 0.4s ease; }

.fb-icon.success::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: fb-ring 0.7s ease 0.15s;
}

.fb-icon.success svg path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: fb-draw 0.45s ease 0.2s forwards;
}

.fb-icon.error svg line,
.fb-icon.warning svg line,
.fb-icon.info svg line,
.fb-icon.info svg circle {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: fb-draw 0.3s ease 0.15s forwards;
}

/* Spinner (loading) */
.fb-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid #2a2a2a;
  border-top-color: #f8fafc;
  animation: fb-spin 0.8s linear infinite;
}

/* Cerrar (X) y botones: máscara slide, sin fondo */
.fb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #9a9a9a;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.fb-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.fb-btn {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.85rem;
  text-transform: uppercase;
  padding: 9px 22px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Máscara slide: el texto sale hacia arriba y su copia entra desde abajo */
.fb-roll {
  position: relative;
  display: inline-block;
  overflow: hidden;
  line-height: 1.2;
}

.fb-roll-a,
.fb-roll-b {
  display: block;
  transition: transform 0.25s ease;
  -webkit-transition: transform 0.25s ease;
}

.fb-roll-b {
  position: absolute;
  inset: 0;
  transform: translateY(110%);
}

.fb-close:hover .fb-roll-a,
.fb-btn:hover .fb-roll-a {
  transform: translateY(-110%);
}

.fb-close:hover .fb-roll-b,
.fb-btn:hover .fb-roll-b {
  transform: translateY(0);
  opacity: 0.65;
}

.fb-btn.primary {
  border-color: #f8fafc;
}

.fb-btn.danger {
  border-color: #ef4444;
  color: #fca5a5;
}

/* ── Toasts (esquina superior derecha, apilados) ── */
.fb-toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(92vw, 360px);
}

.fb-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: #000;
  border: 1px solid #1c1c1c;
  border-left: 3px solid #9a9a9a;
  border-radius: 8px;
  color: #f8fafc;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: fb-toast-in 0.25s ease;
  cursor: pointer;
}

.fb-toast--success { border-left-color: #4ade80; }
.fb-toast--error   { border-left-color: #f87171; }
.fb-toast--warning { border-left-color: #fbbf24; }
.fb-toast--info    { border-left-color: #60a5fa; }

.fb-toast__icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.fb-toast__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fb-toast--success .fb-toast__icon { color: #4ade80; }
.fb-toast--error .fb-toast__icon   { color: #f87171; }
.fb-toast--warning .fb-toast__icon { color: #fbbf24; }
.fb-toast--info .fb-toast__icon    { color: #60a5fa; }

.fb-toast__body { min-width: 0; }
.fb-toast__title {
  font-size: 0.85rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.fb-toast__text {
  font-size: 0.78rem;
  font-weight: 300;
  color: #cfcfcf;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.fb-toast--leaving {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes fb-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Unificación visual de modales funcionales existentes ── */
.modal__content,
.image-selector-content,
#shippingZoneModal .modal-content {
  background: #000;
  border: 1px solid #1c1c1c;
  border-radius: 10px;
  color: #f8fafc;
}

@keyframes fb-rise { to { transform: translateY(0); } }
@keyframes fb-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fb-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes fb-draw { to { stroke-dashoffset: 0; } }
@keyframes fb-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .fb-modal { padding: 32px 20px 24px; }
  .fb-toasts { left: 1rem; right: 1rem; max-width: none; }
}
