/* ============================================================
   WooCommerce Toast Notifications — Dunlopillo
   ============================================================ */


   /*
 * Masque les notices WC IMMÉDIATEMENT (avant JS).
 * La classe .js-wc-toast-ready est ajoutée par le JS sur <html>
 * dès que le script est parsé (inline dans <head>).
 * Sans JS, les notices restent visibles (fallback accessible).
 */
.js-wc-toast-ready .woocommerce-message,
.js-wc-toast-ready .woocommerce-error,
.js-wc-toast-ready .woocommerce-info,
.js-wc-toast-ready ul.woocommerce-error {
  display: none !important;
}

/* Conteneur positionné en haut à droite */
#wc-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

/* Toast de base */
.wc-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(23, 63, 108, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  font-family: 'Poppins', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #173f6c;
  position: relative;
  overflow: hidden;
  pointer-events: all;
  cursor: default;

  /* État initial (caché, décalé en haut) */
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  transition:
    opacity 280ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Visible */
.wc-toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Disparition */
.wc-toast--hiding {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition:
    opacity 220ms ease-in,
    transform 220ms ease-in;
}

/* Icône */
.wc-toast__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* Texte */
.wc-toast__text {
  flex: 1;
  padding-right: 8px;
  padding-top: 4px;
}

/* Bouton fermer */
.wc-toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: rgba(23, 63, 108, 0.4);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 180ms ease, background 180ms ease;
  margin-top: 2px;
}
.wc-toast__close:hover {
  color: #173f6c;
  background: rgba(23, 63, 108, 0.08);
}

/* Barre de progression */
.wc-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  border-radius: 0 0 10px 10px;
  transition: width 4000ms linear;
}

/* ── Variantes ─────────────────────────────── */

/* Succès */

.wc-toast--success .wc-toast__icon {
  background: #e8f5e9;
  color: #2e7d32;
}
.wc-toast--success .wc-toast__progress {
  background: #2e7d32;
}

/* Erreur */

.wc-toast--error .wc-toast__icon {
  background: #ffebee;
  color: #c62828;
}
.wc-toast--error .wc-toast__progress {
  background: #c62828;
}

/* Info */

.wc-toast--info .wc-toast__icon {
  background: #c4e0fb;
  color: #173f6c;
}
.wc-toast--info .wc-toast__progress {
  background: #173f6c;
}

/* ── Mobile ─────────────────────────────────── */
@media (max-width: 600px) {
  #wc-toast-container {
    top: auto;
    bottom: 20px;
    right: 12px;
    left: 12px;
    max-width: 100%;
    width: auto;
  }

  .wc-toast {
    transform: translateY(12px) scale(0.97);
  }
  .wc-toast--visible {
    transform: translateY(0) scale(1);
  }
  .wc-toast--hiding {
    transform: translateY(8px) scale(0.96);
  }
}