/* ══════════════════════════════════════════════
   کانتینر اصلی Toast
   ══════════════════════════════════════════════ */
#rabino-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999999; /* افزایش Z-Index برای اولویت */
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  width: min(420px, calc(100vw - 48px));
  direction: rtl;
  text-align: right;
  font-family: inherit;
}

@media (max-width: 768px) {
  #rabino-toast-container {
    top: 16px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: min(380px, calc(100vw - 24px));
  }
}

/* ══════════════════════════════════════════════
   کارت Toast
   ══════════════════════════════════════════════ */
.rabino-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--rabino-toast-bg, #334155);
  color: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.2),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  font-size: 14.5px;
  line-height: 1.6;
  position: relative;
  overflow: hidden;
  transform: translateX(120%) scale(0.95);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
  will-change: transform, opacity;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
  .rabino-toast {
    transform: translateY(-130%) scale(0.95);
  }
}

.rabino-toast.is-visible {
  transform: translate(0, 0) scale(1);
  opacity: 1;
}

.rabino-toast.is-hiding {
  transform: scale(0.92);
  opacity: 0;
}

.rabino-toast__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rabino-toast__icon svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
  stroke: #ffffff !important;
  stroke-width: 2.5 !important;
  fill: none !important;
}

.rabino-toast__message {
  flex: 1;
  word-break: break-word;
  font-weight: 500;
}

.rabino-toast__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s;
  padding: 0;
}

.rabino-toast__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.rabino-toast__close svg {
  width: 14px !important;
  height: 14px !important;
  stroke: currentColor;
  stroke-width: 2.2;
}

.rabino-toast__progress {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.65);
  transform-origin: right;
  animation: rabinoProgress linear forwards;
}

@keyframes rabinoProgress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* ══════════════════════════════════════════════
   مخفی‌سازی نوتیفیکیشن‌های پیش‌فرض ووکامرس و کامنت
   ══════════════════════════════════════════════ */
body.rabino-toast-active .woocommerce-notices-wrapper,
body.rabino-toast-active .woocommerce-message,
body.rabino-toast-active .woocommerce-error,
body.rabino-toast-active .woocommerce-info {
  display: none !important;
}

/* مخفی کردن Toast قدیمی درون افزونه Rabino-Comments */
#rabino-ajax-toast {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ══════════════════════════════════════════════
   اسپینر حذف محصول (Remove Spinner)
   ══════════════════════════════════════════════ */
.rabino-remove-spinner-overlay {
  position: absolute;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.rabino-remove-spinner-overlay.is-active {
  opacity: 1;
}
.rabino-remove-spinner-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: inherit;
}

.rabino-remove-spinner-ring {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
}
.rabino-remove-spinner-ring::before,
.rabino-remove-spinner-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}
.rabino-remove-spinner-ring::before {
  border-top-color: var(--rabino-spinner-color, #ef4444);
  border-right-color: var(--rabino-spinner-color, #ef4444);
  animation: rabinoSpinOuter 0.8s cubic-bezier(0.6, 0.15, 0.35, 0.85) infinite;
}
.rabino-remove-spinner-ring::after {
  inset: 5px;
  border-bottom-color: var(--rabino-spinner-color, #ef4444);
  border-left-color: var(--rabino-spinner-color, #ef4444);
  animation: rabinoSpinInner 0.6s cubic-bezier(0.6, 0.15, 0.35, 0.85) infinite
    reverse;
}
.rabino-remove-spinner-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--rabino-spinner-color, #ef4444);
  z-index: 3;
  animation: rabinoPulse 0.8s ease-in-out infinite;
}

@keyframes rabinoSpinOuter {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes rabinoSpinInner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes rabinoPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.8);
    opacity: 0.3;
  }
}

.rabino-cart-item-removing {
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    max-height 0.4s ease,
    padding 0.4s ease,
    margin 0.4s ease !important;
  opacity: 0.3 !important;
  transform: scale(0.97) !important;
  pointer-events: none !important;
}

.elementor-widget-woocommerce-cart .rabino-remove-spinner-overlay::before,
.elementor-cart-widget .rabino-remove-spinner-overlay::before {
  background: rgba(255, 255, 255, 0.8);
}
@media (max-width: 768px) {
  .rabino-remove-spinner-ring {
    width: 30px;
    height: 30px;
  }
  .rabino-remove-spinner-ring::after {
    inset: 4px;
  }
  .rabino-remove-spinner-dot {
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
  }
}
