/* ============================================================
   css/toast-ari.css · Estilos Toast Ari
   Spec: DESIGN_SPEC_TOAST_ARI-2026-05-25-001 (Lúa)
   Tokens: tpv.css (--carbon, --ash, --smoke, --bone, --brasa, --success, --danger)
   Marina · CTO · ENG-2026-05-25-001 Fase B
   ============================================================ */

#toast-ari-root {
  position: fixed;
  right: 24px;
  bottom: 168px;
  z-index: 1000;
  pointer-events: none;
  /* Los hijos individuales reactivan pointer-events */
}

@media (min-width: 1440px) {
  #toast-ari-root {
    bottom: 200px;
  }
}

.toast-ari {
  position: relative;
  width: 360px;
  min-height: 80px;
  max-height: 140px;
  background: var(--ash);
  border: 1px solid rgba(90, 85, 76, 0.4); /* --smoke 40% */
  border-radius: 12px;
  padding: 14px 16px 14px 22px; /* extra left para borde 3px + gap */
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: start;
  cursor: pointer;
  pointer-events: auto;

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.32),
    0 2px 6px rgba(0, 0, 0, 0.18);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  /* Estado inicial pre-visible */
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 280ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-ari--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-ari--dismissing {
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 200ms ease-in,
    transform 200ms ease-in;
}

.toast-ari__border-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 12px 0 0 12px;
  /* background asignado por JS según tipo */
}

.toast-ari__avatar {
  width: 64px;
  height: 64px;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.toast-ari__contenido {
  min-width: 0; /* permite text-overflow funcione si pasa hacer falta */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.toast-ari__texto {
  font-family: var(--font-body, 'Figtree', sans-serif);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.35;
  color: var(--bone);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
}

/* Hover sutil (irrelevante en tablets touch pero por completitud)*/
@media (hover: hover) {
  .toast-ari:hover {
    filter: brightness(1.04);
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .toast-ari {
    transform: none;
    transition: opacity 200ms ease-out;
  }
  .toast-ari--visible {
    transform: none;
  }
  .toast-ari--dismissing {
    transform: none;
    transition: opacity 150ms ease-in;
  }
}

/* ============================================================
   ENG-2026-05-26-001 · Stack pedidos FIFO-3 + botón "Ver comanda"
   Marina · CTO · 26-may-2026
   ============================================================ */

#toast-ari-stack-root {
  position: fixed;
  bottom: 24px;
  right: 164px;
  z-index: 1000;
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
  pointer-events: none;
}
@media (max-width: 800px) {
  #toast-ari-stack-root { right: 124px; bottom: 16px; }
}
@media (min-width: 1440px) {
  #toast-ari-stack-root { right: 204px; bottom: 32px; }
}

/* ENG-2026-05-26-002b · variante toast dentro del stack horizontal */
.toast-ari--in-stack {
  width: 260px;
  height: 128px;
  pointer-events: auto;
}

/* ENG-2026-05-26-002b · grupo de botones (Ver comanda + cerrar) */
.toast-ari__btn-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
  align-self: flex-end;
}

/* ENG-2026-05-26-002b · boton cerrar X */
.toast-ari__btn-cerrar {
  background: var(--smoke, #5A554C);
  color: var(--bone, #EFE9E0);
  border: none;
  border-radius: 8px;
  width: 36px;
  min-height: 36px;
  padding: 0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-family: 'Figtree', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: filter 150ms ease;
}
.toast-ari__btn-cerrar:hover,
.toast-ari__btn-cerrar:active {
  filter: brightness(1.2);
}
@media (prefers-reduced-motion: reduce) {
  .toast-ari__btn-cerrar { transition: none; }
}

#toast-ari-stack-root .toast-ari {
  position: relative;
  transition:
    opacity 280ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-ari__btn-ver-comanda {
  background: var(--brasa);
  color: var(--carbon);
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  min-height: 36px;
  font-family: var(--font-body, 'Figtree', sans-serif);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  pointer-events: auto;
  transition: filter 150ms ease-out;
}

.toast-ari__btn-ver-comanda:hover {
  filter: brightness(1.1);
}

.toast-ari__btn-ver-comanda:active {
  filter: brightness(0.95);
}

@media (prefers-reduced-motion: reduce) {
  .toast-ari__btn-ver-comanda {
    transition: none;
  }
}
