/* Makler.ge non-blocking site toasts */
:root {
  --mk-toast-header-offset: 96px;
  --mk-toast-gap: 12px;
  --mk-toast-z: 3200;
}

/* Auth pages: language control sits near the top-right */
body:has(.auth-shell__lang),
body:has(.auth-lang) {
  --mk-toast-header-offset: 64px;
}

.site-toast-container {
  position: fixed;
  top: var(--mk-toast-header-offset);
  right: 24px;
  left: auto;
  bottom: auto;
  width: min(380px, calc(100vw - 32px));
  max-width: 380px;
  z-index: var(--mk-toast-z);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--mk-toast-gap);
  pointer-events: none;
  box-sizing: border-box;
}

.site-toast {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 14px 16px 16px;
  border-radius: 12px;
  background: #ffffff;
  color: #1a2332;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(26, 35, 50, 0.12);
  overflow: hidden;
  box-sizing: border-box;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.site-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.site-toast.is-leaving {
  opacity: 0;
  transform: translateX(12px);
}

.site-toast__icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 1px;
}

.site-toast__icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.site-toast__content {
  min-width: 0;
  padding-top: 1px;
}

.site-toast__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 4px;
  color: #1a2332;
}

.site-toast__message {
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
  word-break: break-word;
}

.site-toast__message p {
  margin: 0 0 0.35em;
}

.site-toast__message p:last-child {
  margin-bottom: 0;
}

.site-toast__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6b7280;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: -2px -4px 0 0;
}

.site-toast__close:hover,
.site-toast__close:focus {
  color: #1a2332;
  background: #f3f4f6;
  outline: none;
}

.site-toast__close:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f15a29;
}

.site-toast__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(26, 35, 50, 0.08);
  overflow: hidden;
}

.site-toast__progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  background: currentColor;
}

.site-toast--success {
  border-color: #bbf7d0;
}

.site-toast--success .site-toast__icon {
  background: #dcfce7;
  color: #15803d;
}

.site-toast--success .site-toast__progress-bar {
  color: #22c55e;
}

.site-toast--info {
  border-color: #bfdbfe;
}

.site-toast--info .site-toast__icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.site-toast--info .site-toast__progress-bar {
  color: #3b82f6;
}

.site-toast--warning {
  border-color: #fde68a;
}

.site-toast--warning .site-toast__icon {
  background: #fef3c7;
  color: #b45309;
}

.site-toast--warning .site-toast__progress-bar {
  color: #f59e0b;
}

.site-toast--error {
  border-color: #fecaca;
}

.site-toast--error .site-toast__icon {
  background: #fee2e2;
  color: #b91c1c;
}

.site-toast--error .site-toast__progress-bar {
  color: #ef4444;
}

/* Legacy Bootstrap toast mounts: keep non-blocking if any remain */
.toast-container.toast-top-center,
.toast-container.toast-top-right {
  top: var(--mk-toast-header-offset) !important;
  left: auto !important;
  right: 24px !important;
  width: min(380px, calc(100vw - 32px)) !important;
  max-width: 380px !important;
  padding: 0 !important;
  pointer-events: none;
  z-index: var(--mk-toast-z);
}

.toast-container.toast-top-center .toast,
.toast-container.toast-top-right .toast {
  pointer-events: auto;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

@media (max-width: 991.98px) {
  :root {
    --mk-toast-header-offset: 76px;
  }

  .site-toast-container {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    align-items: center;
  }

  .site-toast {
    width: min(420px, 100%);
    transform: translateY(-8px);
  }

  .site-toast.is-visible {
    transform: translateY(0);
  }

  .site-toast.is-leaving {
    transform: translateY(-6px);
  }

  .toast-container.toast-top-center,
  .toast-container.toast-top-right {
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-toast,
  .site-toast.is-visible,
  .site-toast.is-leaving,
  .site-toast__progress-bar {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
