/* Glass toasts. Sit under the header, above the page, below the cart modal. */

.pit-toasts {
  position: fixed;
  z-index: 70;
  top: calc(var(--admin-top, 0px) + 5.4rem);
  right: 1rem;
  display: grid;
  gap: 0.6rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.pit-toast {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "thumb copy close"
    "actions actions actions";
  gap: 0.15rem 0.7rem;
  align-items: center;
  overflow: hidden;
  padding: 0.7rem 0.7rem 0.85rem;
  border: 1px solid rgba(18, 18, 18, 0.06);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.12);
  color: var(--text);
  pointer-events: auto;
  backdrop-filter: blur(18px) saturate(1.3);
}

.pit-toast.is-out {
  opacity: 0;
  transform: translateY(-6px);
}

.pit-toast--note {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
}

.pit-toast--note p {
  flex: 1 1 auto;
  min-width: 0;
}

.pit-toast--note button {
  flex: 0 0 auto;
}

.pit-toast__thumbs {
  grid-area: thumb;
  align-self: start;
  display: flex;
}

.pit-toast__thumbs img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  padding: 0.2rem;
  border-radius: 0.8rem;
  background: var(--surface);
  box-sizing: border-box;
}

.pit-toast__thumbs img + img {
  margin-left: -0.85rem;
  box-shadow: -4px 0 0 #fff;
}

.pit-toast__copy {
  grid-area: copy;
  display: grid;
  gap: 0.05rem;
  min-width: 0;
  padding-top: 0.1rem;
}

.pit-toast__title,
.pit-toast__name,
.pit-toast__meta,
.pit-toast__nudge,
.pit-toast p {
  margin: 0;
}

.pit-toast__title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.pit-toast__name {
  overflow: hidden;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pit-toast__meta,
.pit-toast__nudge {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pit-toast__actions {
  grid-area: actions;
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.pit-toast button {
  min-height: 2.15rem;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 999px;
  background: #121212;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.pit-toast__actions button {
  flex: 1 1 0;
}

.pit-toast .pit-toast__undo {
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pit-toast .pit-toast__x {
  grid-area: close;
  align-self: start;
  width: 1.75rem;
  height: 1.75rem;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
}

.pit-toast__bar {
  position: absolute;
  right: 0.85rem;
  bottom: 0;
  left: 0.85rem;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  animation: pit-toast-bar linear forwards;
}

@media (max-width: 767px) {
  .pit-toasts {
    top: calc(var(--admin-top, 0px) + 4.6rem);
    right: 0.7rem;
    left: 0.7rem;
    width: auto;
  }

  .pit-toast__actions {
    flex-direction: row;
  }

  .pit-toast__actions button,
  .pit-toast--note button {
    min-height: 2.4rem;
  }
}

@media (min-width: 768px) {
  .pit-toast__actions button {
    flex: 0 1 auto;
    min-width: 5.6rem;
  }
}

@keyframes pit-toast-bar {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
