/**
 * FitRonix — اعلان سفارش مدیر (زنگ · پنل · toast)
 */

.admin-order-notif-wrap {
  position: relative;
  flex-shrink: 0;
}

.admin-order-notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-order-notif-bell:hover {
  color: var(--accent);
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.08);
}

.admin-order-notif-bell.is-ringing {
  animation: adminNotifBellRing 0.55s ease-in-out 3;
  border-color: rgba(249, 115, 22, 0.55);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.admin-order-notif-bell svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.admin-order-notif-badge {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.45);
  pointer-events: none;
}

.admin-order-notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, 70vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  z-index: 400;
  animation: adminNotifPanelIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.admin-order-notif-panel[hidden] {
  display: none !important;
}

.admin-order-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-order-notif-head strong {
  font-size: 13px;
}

.admin-order-notif-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-order-notif-sound {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

.admin-order-notif-sound.on {
  color: var(--accent);
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.08);
}

.admin-order-notif-list {
  overflow-y: auto;
  padding: 8px;
  margin: 0;
  list-style: none;
}

.admin-order-notif-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-order-notif-item:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.04));
}

.admin-order-notif-item.unread {
  background: rgba(249, 115, 22, 0.06);
}

.admin-order-notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.admin-order-notif-icon--shop {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.12));
}

.admin-order-notif-icon--workout {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(234, 88, 12, 0.12));
}

.admin-order-notif-icon--nutrition {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(22, 163, 74, 0.12));
}

.admin-order-notif-icon--combo {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(139, 92, 246, 0.12));
}

.admin-order-notif-body {
  min-width: 0;
}

.admin-order-notif-body strong {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}

.admin-order-notif-body span {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.45;
}

.admin-order-notif-time {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.admin-order-notif-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Toast غنی */
.admin-order-toasts {
  position: fixed;
  bottom: 20px;
  inset-inline-start: 20px;
  z-index: 600;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 40px));
}

.admin-order-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: adminOrderToastIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
  position: relative;
}

.admin-order-toast::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--aot-accent, var(--accent));
}

.admin-order-toast--shop { --aot-accent: #3b82f6; }
.admin-order-toast--workout { --aot-accent: #f97316; }
.admin-order-toast--nutrition { --aot-accent: #22c55e; }
.admin-order-toast--combo { --aot-accent: #a855f7; }

.admin-order-toast.is-leaving {
  animation: adminOrderToastOut 0.3s ease forwards;
}

.admin-order-toast-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: color-mix(in srgb, var(--aot-accent) 18%, transparent);
}

.admin-order-toast-body strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.admin-order-toast-body span {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.admin-order-toast-action {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--aot-accent) 40%, var(--border));
  background: color-mix(in srgb, var(--aot-accent) 12%, transparent);
  color: var(--aot-accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.admin-order-toast-action:hover {
  background: color-mix(in srgb, var(--aot-accent) 22%, transparent);
  transform: translateY(-1px);
}

.admin-order-toast-close {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}

.admin-order-toast-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

@keyframes adminNotifBellRing {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-12deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-6deg); }
}

@keyframes adminNotifPanelIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes adminOrderToastIn {
  from { opacity: 0; transform: translateX(-24px) scale(0.94); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes adminOrderToastOut {
  to { opacity: 0; transform: translateX(-16px) scale(0.92); }
}

@media (max-width: 720px) {
  .admin-order-notif-panel {
    inset-inline-end: auto;
    inset-inline-start: 0;
  }

  .admin-order-toasts {
    inset-inline-start: 12px;
    inset-inline-end: 12px;
    max-width: none;
  }
}
