/**
 * PCTechComVn — Booking Toast CSS
 * Child Theme CSS Module
 * Version: 1.0.0 (Sprint 0)
 *
 * Social proof toast notifications.
 * "Anh Minh vừa đặt lịch sửa laptop Dell — 3 phút trước"
 * JS: booking-toast.js tạo và animate các toast.
 */

.booking-toasts {
  position: fixed;
  top: calc(var(--header-h) + 20px);
  left: calc(var(--side-rail-w) + 16px);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 320px;
}

.booking-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--green);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.booking-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.booking-toast.hide {
  opacity: 0;
  transform: translateX(-30px);
}

/* Type variants */
.booking-toast.remote {
  border-left-color: var(--blue);
}

.booking-toast.ai {
  border-left-color: #a334fa;
}

.booking-toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.booking-toast.remote .booking-toast-icon {
  background: var(--blue-light);
}

.booking-toast.ai .booking-toast-icon {
  background: #f3e8ff;
}

.booking-toast-body {
  flex: 1;
  min-width: 0;
}

.booking-toast-body strong {
  display: block;
  font-size: 0.85rem;
  color: var(--blue-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-toast-body span {
  display: block;
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.booking-toast-body em {
  font-style: normal;
  color: var(--orange);
  font-weight: 600;
}

.booking-toast-time {
  font-size: 0.7rem;
  color: var(--gray-500);
  margin-top: 4px;
  opacity: 0.7;
}

/* Mobile: bottom-right, smaller */
@media (max-width: 768px) {
  .booking-toasts {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    left: auto;
    right: 12px;
    max-width: 280px;
    align-items: flex-end;
    z-index: 9995;
  }

  .booking-toast {
    max-width: 280px;
    width: calc(100vw - 24px);
    padding: 10px 14px;
    gap: 10px;
    border-left-width: 3px;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(13, 61, 122, 0.14);
    transform: translateX(calc(100% + 20px));
  }

  .booking-toast.show {
    transform: translateX(0);
  }

  .booking-toast.hide {
    transform: translateX(calc(100% + 20px));
  }

  .booking-toast-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .booking-toast-body strong {
    font-size: 0.8rem;
  }

  .booking-toast-body span {
    font-size: 0.74rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .booking-toast-time {
    display: none;
  }
}

/* Side rail ẩn → toast dịch trái */
@media (max-width: 1100px) and (min-width: 769px) {
  .booking-toasts {
    left: 16px;
  }
}
