/* ============================================================
   TOAST NOTIFICATIONS — Modern slide-in alerts
   Cart, Favorite, Generic info/success/error
   ============================================================ */

.tp-toast-wrap {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 48px);
}

.tp-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  color: #1a1a1a;
  border-radius: 12px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--color-primary, #704831);
  transform: translateX(120%);
  opacity: 0;
  pointer-events: auto;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tp-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.tp-toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

/* progress bar */
.tp-toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--color-primary, #704831);
  transform-origin: left;
  animation: tpToastProgress 4s linear forwards;
}

@keyframes tpToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.tp-toast__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(112, 72, 49, 0.1);
  color: var(--color-primary, #704831);
}

.tp-toast__icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.tp-toast__icon i {
  font-size: 18px;
}

.tp-toast__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tp-toast__title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
}

.tp-toast__message {
  font-size: 13px;
  color: #555;
  line-height: 1.45;
  word-break: break-word;
}

.tp-toast__action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--color-primary, #704831);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
  margin-left: 4px;
}

.tp-toast__action:hover,
.tp-toast__action:focus {
  background: #1a1a1a;
  color: #fff;
  transform: translateX(2px);
}

.tp-toast__close {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.tp-toast__close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
}

/* ── Variants ── */
.tp-toast--success {
  border-left-color: #2e9b6a;
}
.tp-toast--success::after { background: #2e9b6a; }
.tp-toast--success .tp-toast__icon {
  background: rgba(46, 155, 106, 0.12);
  color: #2e9b6a;
}

.tp-toast--cart {
  border-left-color: var(--color-primary, #704831);
}
.tp-toast--cart::after { background: var(--color-primary, #704831); }

.tp-toast--favori {
  border-left-color: #e63946;
}
.tp-toast--favori::after { background: #e63946; }
.tp-toast--favori .tp-toast__icon {
  background: rgba(230, 57, 70, 0.12);
  color: #e63946;
}
.tp-toast--favori .tp-toast__action {
  background: #e63946;
}
.tp-toast--favori .tp-toast__action:hover {
  background: #1a1a1a;
}

.tp-toast--info {
  border-left-color: #2563eb;
}
.tp-toast--info::after { background: #2563eb; }
.tp-toast--info .tp-toast__icon {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.tp-toast--error {
  border-left-color: #dc2626;
}
.tp-toast--error::after { background: #dc2626; }
.tp-toast--error .tp-toast__icon {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .tp-toast-wrap {
    top: auto;
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: 100%;
  }

  .tp-toast {
    transform: translateY(120%);
    padding: 12px 14px;
    gap: 10px;
  }

  .tp-toast.show {
    transform: translateY(0);
  }

  .tp-toast.hide {
    transform: translateY(120%);
  }

  .tp-toast__icon {
    width: 34px;
    height: 34px;
  }

  .tp-toast__title { font-size: 13px; }
  .tp-toast__message { font-size: 12px; }
}
