/* ==========================================================================
   Toast: mensaje flotante de respuesta de los formularios de Contact Form 7.
   Lo crea assets/js/contact-form.js en el <body>, fuera de .site: dentro de
   .site (container-type) position: fixed quedaría relativo al contenedor y no
   a la pantalla. Por eso tampoco se usan container queries acá: el ancho se
   resuelve con left/right + max-width (abajo a la derecha en desktop, a lo
   ancho con 16px de margen en mobile).

   Plano: fondo blanco, línea de 1px y borde izquierdo de 3px del color del estado.
   ========================================================================== */

:root {
  --toast-icon-success: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.5 2.5L16 9.5'/%3E%3C/svg%3E");
  --toast-icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
  --toast-icon-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l9.5 16.5h-19z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E");
}

.byc-toast {
  --toast-color: var(--color-ink);
  --toast-icon: var(--toast-icon-info);

  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 300; /* sobre el header sticky (200) y los drawers (100) */
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  max-width: 420px;
  margin-left: auto;
  padding: 16px 12px 16px 16px;
  border: 1px solid var(--color-line-strong);
  border-left: 3px solid var(--toast-color);
  background: var(--color-white);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.5;
  animation: toast-in 0.3s ease both;
}

/* Desde 600px de pantalla: separado del borde, abajo a la derecha */
@media (min-width: 600px) {
  .byc-toast {
    right: 24px;
    bottom: 24px;
  }
}

.byc-toast.is-leaving { animation: toast-out 0.2s ease both; }

.byc-toast::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background: var(--toast-color);
  -webkit-mask: var(--toast-icon) center / contain no-repeat;
  mask: var(--toast-icon) center / contain no-repeat;
}

.byc-toast__body { display: grid; gap: 2px; min-width: 0; }

.byc-toast__title {
  margin: 0;
  color: var(--color-ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.byc-toast__message {
  margin: 0;
  color: var(--color-graphite);
  overflow-wrap: anywhere;
}

.byc-toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -6px -4px 0 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  transition: border-color var(--transition);
}
.byc-toast__close:hover { border-color: var(--color-line-strong); }
.byc-toast__close:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }

.byc-toast__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* ---------- Estados (según la clase que CF7 pone en el form) ---------- */
.byc-toast--success {
  --toast-color: var(--color-success);
  --toast-icon: var(--toast-icon-success);
}
.byc-toast--error {
  --toast-color: var(--color-danger);
  --toast-icon: var(--toast-icon-error);
}
.byc-toast--invalid {
  --toast-color: var(--color-peach-strong);
  --toast-icon: var(--toast-icon-error);
}
.byc-toast--spam {
  --toast-color: var(--color-graphite);
  --toast-icon: var(--toast-icon-info);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* base.css ya anula animaciones con prefers-reduced-motion; acá también se
   evita el desplazamiento por si este archivo se usa sin base.css. */
@media (prefers-reduced-motion: reduce) {
  .byc-toast,
  .byc-toast.is-leaving { animation: none; }
}
