/* ═══════════════════════════════════════════════════════════════════════════
   Alkaline Care — Notificaciones de ventas recientes
   Archivo: assets/css/recent-sales.css
════════════════════════════════════════════════════════════════════════════ */

/* ── Tarjeta base ────────────────────────────────────────────────────────── */
.ac-sn {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9990;

  display: flex;
  align-items: center;
  gap: .875rem;

  max-width: 320px;
  width: calc(100vw - 3rem);
  padding: .875rem 2.25rem .875rem .875rem; /* right padding deja espacio al X */

  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 14px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, .08),
    0 10px 30px -5px rgba(0, 0, 0, .12);

  /* oculto por defecto */
  opacity: 0;
  transform: translateY(20px) scale(.97);
  pointer-events: none;
  transition: opacity .35s cubic-bezier(.4, 0, .2, 1),
              transform .35s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity, transform;
}

/* ── Estados ─────────────────────────────────────────────────────────────── */
.ac-sn--in {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ac-sn--out {
  opacity: 0;
  transform: translateY(12px) scale(.97);
  pointer-events: none;
}

/* ── Imagen del producto ─────────────────────────────────────────────────── */
.ac-sn__img-wrap {
  flex-shrink: 0;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  width: 60px;
  height: 60px;
}

.ac-sn__img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  background: #f4f9eb;
  display: block;
}

/* ── Cuerpo ──────────────────────────────────────────────────────────────── */
.ac-sn__body {
  flex: 1;
  min-width: 0;
}

.ac-sn__who {
  font-size: .72rem;
  color: #6b7280;
  margin: 0 0 .2rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Indicador "real" — punto verde */
.ac-sn--real .ac-sn__who::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: .35rem;
  vertical-align: middle;
  margin-top: -1px;
}

.ac-sn__product {
  display: block;
  font-size: .8125rem;
  font-weight: 700;
  color: #1c2408;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .25rem;
  line-height: 1.3;
  transition: color .15s ease;
}

.ac-sn__product:hover {
  color: #4b8407;
  text-decoration: underline;
}

.ac-sn__time {
  font-size: .69rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: .3rem;
}

.ac-sn__time::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
}

/* ── Botón cerrar ────────────────────────────────────────────────────────── */
.ac-sn__close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 1.375rem;
  height: 1.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: #c1c8d0;
  cursor: pointer;
  border-radius: 50%;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  line-height: 1;
}

.ac-sn__close:hover {
  background: #f3f4f6;
  color: #374151;
}

.ac-sn__close:focus-visible {
  outline: 2px solid #4b8407;
  outline-offset: 2px;
}

/* ── Barra inferior de color (acento de marca) ───────────────────────────── */
.ac-sn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: linear-gradient(90deg, #4b8407, #86a560);
  border-radius: 0 0 2px 2px;
  opacity: .7;
}

/* ── Responsive móvil (< 480px) ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .ac-sn {
    /* Sube para no quedar detrás de la barra de gestos/browser */
    bottom: calc(env(safe-area-inset-bottom, 0px) + 4.5rem);
    left: .875rem;
    right: .875rem;
    max-width: none;
    width: auto;
    gap: .625rem;
    padding: .75rem 2.75rem .75rem .75rem;
    border-radius: 12px;
  }

  .ac-sn__img-wrap,
  .ac-sn__img {
    width: 48px;
    height: 48px;
  }

  .ac-sn__who     { font-size: .68rem; }
  .ac-sn__product { font-size: .76rem; }
  .ac-sn__time    { font-size: .65rem; }

  /* Botón X con área táctil de 44px mínimo */
  .ac-sn__close {
    width: 2.75rem;
    height: 2.75rem;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    border-radius: 0 12px 12px 0;
    background: #f9fafb;
    color: #6b7280;
  }
  .ac-sn__close:hover,
  .ac-sn__close:active { background: #f3f4f6; color: #374151; }
}

/* Swipe feedback visual */
.ac-sn--swiping {
  transition: transform .1s linear, opacity .1s linear !important;
}

/* ── Reducir movimiento ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ac-sn {
    transition: opacity .2s ease;
    transform: none !important;
  }
}
