/* The bell and its panel (js/notify.js), and the chat inside an order (cabinet OrderChat.jsx). */

.nt { position: relative; }
.nt[hidden] { display: none; }
.nt-bell { position: relative; }
.nt-bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nt-bell.ring svg { animation: nt-ring 0.9s var(--ease-out, ease); transform-origin: 50% 10%; }
@keyframes nt-ring {
  0% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); }
  45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } 100% { transform: rotate(0); }
}
.nt-badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px;
  background: linear-gradient(135deg, #ff7a3d, #ff4f8b); color: #fff; font-size: 11px; font-weight: 800;
  box-shadow: 0 0 0 2px var(--color-bg), 0 6px 14px -4px rgba(255, 79, 139, 0.7);
  animation: nt-pop 0.35s var(--ease-out, ease);
}
@keyframes nt-pop { from { transform: scale(0.4); } to { transform: scale(1); } }

.nt-panel {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 60;
  width: min(400px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 110px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 22px; background: var(--color-surface);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--color-border);
  transform-origin: top right; animation: nt-open 0.25s var(--ease-out, ease);
}
@keyframes nt-open { from { opacity: 0; transform: translateY(-6px) scale(0.97); } to { opacity: 1; transform: none; } }
.nt-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.nt-all, .nt-allow {
  border: 0; background: none; font: inherit; font-size: 13px; font-weight: 800; color: var(--color-accent); cursor: pointer;
}
.nt-list { overflow: auto; padding: 0 8px 8px; display: grid; gap: 2px; }
.nt-foot { padding: 6px 18px 14px; }
.nt-foot:empty { display: none; }
.nt-item {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start;
  width: 100%; padding: 12px; border: 0; border-radius: 16px; background: transparent; color: var(--color-text);
  font: inherit; text-align: left; cursor: pointer; animation: fx-rise 0.35s var(--ease-out, ease) backwards;
  transition: background-color 0.2s ease;
}
.nt-item:hover { background: var(--color-surface-2); }
.nt-item.unread::after {
  content: ""; position: absolute; right: 12px; top: 18px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-accent); box-shadow: 0 0 0 4px rgba(255, 107, 44, 0.18);
}
.nt-icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--color-surface-2); color: var(--color-accent);
}
.nt-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.k-money .nt-icon { color: var(--color-price); background: var(--color-ok-bg); }
.k-chat .nt-icon { color: #4f8cff; background: rgba(79, 140, 255, 0.14); }
.k-offer .nt-icon { color: #ff4f8b; background: rgba(255, 79, 139, 0.14); }
.nt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 14px; }
.nt-text b { font-weight: 800; font-size: 14px; line-height: 1.3; }
.nt-text span { font-size: 13px; color: var(--color-muted); overflow-wrap: anywhere; }
.nt-text small { font-size: 12px; color: var(--color-muted); opacity: 0.8; }
.nt-item.unread .nt-text b { color: var(--color-text); }
.nt-item:not(.unread) { opacity: 0.78; }
.nt-empty { display: grid; justify-items: center; gap: 8px; padding: 30px 20px 26px; text-align: center; color: var(--color-muted); }
.nt-empty svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.6; }
.nt-empty p { margin: 0; font-size: 14px; font-weight: 600; }

/* new ones for a moment, bottom right */
.nt-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.nt-toast {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 14px; border: 0; border-radius: 18px; text-align: left; cursor: pointer; font: inherit; color: var(--color-text);
  background: var(--color-surface); box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--color-border);
  animation: nt-in 0.45s var(--ease-out, ease);
}
.nt-toast.out { animation: nt-out 0.4s ease forwards; }
@keyframes nt-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes nt-out { to { opacity: 0; transform: translateX(30px); } }

/* ---------- the chat inside an order ---------- */
.oc-veil { position: fixed; inset: 0; z-index: 70; background: rgba(10, 6, 4, 0.45); animation: fx-fade 0.25s ease; }
.oc {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(440px, 100vw);
  display: flex; flex-direction: column; background: var(--color-surface);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.6); animation: oc-in 0.35s var(--ease-out, ease);
}
@keyframes oc-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.oc-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--color-border); }
.oc-head div { flex: 1; min-width: 0; }
.oc-head strong { display: block; overflow-wrap: anywhere; }
.oc-close {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--color-surface-2); color: var(--color-text);
  font-size: 20px; cursor: pointer;
}
.oc-list { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.oc-msg { max-width: 82%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--color-surface-2);
  animation: fx-rise 0.3s var(--ease-out, ease) backwards; overflow-wrap: anywhere; white-space: pre-wrap; }
.oc-msg.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; color: #fff;
  background: linear-gradient(135deg, #ff7a3d, #ff4f8b); }
.oc-msg small { display: block; margin-top: 4px; font-size: 11px; opacity: 0.7; }
.oc-empty { margin: auto; text-align: center; color: var(--color-muted); max-width: 260px; }
.oc-form { display: flex; gap: 8px; padding: 12px 14px 16px; border-top: 1px solid var(--color-border); }
.oc-form textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 120px; padding: 11px 16px; border-radius: 22px;
  border: 1.5px solid var(--color-border); background: var(--color-surface-2); color: var(--color-text); font: inherit;
}
.oc-form textarea:focus { outline: none; border-color: var(--color-accent); }
.oc-send { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: linear-gradient(135deg, #ff7a3d, #ff4f8b); color: #fff; font-size: 18px; font-weight: 800; }
.oc-send:disabled { opacity: 0.4; cursor: default; }
.chat-btn .dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #4f8cff; }

@media (max-width: 600px) {
  .nt-panel { position: fixed; left: 12px; right: 12px; top: calc(var(--header-h) + 4px); width: auto; }
  .site-header .bar-right { gap: 6px; }
  .nt-bell { width: 40px; height: 40px; }
}
/* the bell and the theme switch on the narrowest phones: smaller buttons so the whole bar fits */
@media (max-width: 420px) {
  .site-header .bar-right { gap: 4px; }
  .site-header .icon-btn { width: 36px; height: 36px; }
  .site-header .icon-btn svg { width: 19px; height: 19px; }
  .site-header .btn.btn-login { padding: 8px 12px; font-size: 14px; }
  .site-header .logo-word { font-size: 21px; }
}
