/* =========================================================
   MAISON NOYAU — ANIMATIONS V2
   ✦ transform + opacity uniquement (GPU)
   ✦ respecte prefers-reduced-motion
   ✦ ajout: tilt 3D, magnetic buttons, ink-effects
   ========================================================= */


/* -------------------------------------------------------
   ACCESSIBILITÉ
------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .mn-tilt { transform: none !important; }
}


/* -------------------------------------------------------
   FADE / REVEAL AU SCROLL
------------------------------------------------------- */
.mn-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 800ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 800ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}
.mn-reveal.is-visible { opacity: 1; transform: translateY(0); }

.mn-reveal--left  { transform: translateX(-40px); }
.mn-reveal--right { transform: translateX(40px); }
.mn-reveal--scale { transform: scale(0.94); }
.mn-reveal--left.is-visible,
.mn-reveal--right.is-visible,
.mn-reveal--scale.is-visible { transform: translate(0) scale(1); }

.mn-reveal--delay-1 { transition-delay: 0.1s; }
.mn-reveal--delay-2 { transition-delay: 0.2s; }
.mn-reveal--delay-3 { transition-delay: 0.3s; }
.mn-reveal--delay-4 { transition-delay: 0.4s; }
.mn-reveal--delay-5 { transition-delay: 0.5s; }


/* -------------------------------------------------------
   LIGNE DÉCORATIVE ANIMÉE (titres)
------------------------------------------------------- */
.mn-underline-anim {
  position: relative;
  display: inline-block;
}
.mn-underline-anim::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: var(--mn-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 400ms cubic-bezier(0, 0, 0.2, 1);
}
.mn-underline-anim.is-visible::after,
.mn-underline-anim:hover::after { transform: scaleX(1); }


/* -------------------------------------------------------
   COMPTEURS
------------------------------------------------------- */
.mn-counter {
  display: inline-block;
  font-family: var(--mn-font-serif);
  font-weight: 500;
  color: inherit;
}


/* -------------------------------------------------------
   TILT 3D — cards, products, hero bottle
   transform appliqué par JS au mousemove
------------------------------------------------------- */
.mn-tilt {
  transform-style: preserve-3d;
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.mn-tilt.is-tilting { transition: transform 80ms linear; }


/* -------------------------------------------------------
   PARALLAX
------------------------------------------------------- */
.mn-parallax { overflow: hidden; }
.mn-parallax__inner { will-change: transform; }


/* -------------------------------------------------------
   MAGNETIC BUTTONS
------------------------------------------------------- */
.mn-btn-magnetic {
  transition:
    transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 250ms ease,
    background-color 280ms ease,
    color 280ms ease;
}


/* -------------------------------------------------------
   LOADER
------------------------------------------------------- */
#mn-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--mn-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1),
              visibility 500ms cubic-bezier(0.4, 0, 0.2, 1);
}
#mn-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.mn-loader__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background-color: var(--mn-gold);
  margin: 0 5px;
  animation: mn-pulse 1.2s ease-in-out infinite;
}
.mn-loader__dot:nth-child(2) { animation-delay: 0.2s; background-color: var(--mn-accent); }
.mn-loader__dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes mn-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1.1); opacity: 1; }
}


/* -------------------------------------------------------
   PRODUCT IMAGE OVERLAY
------------------------------------------------------- */
.mn-product-image-wrap { position: relative; overflow: hidden; }
.mn-product-image-wrap img { transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1); }
.mn-product-image-wrap:hover img { transform: scale(1.06); }
.mn-product-image-wrap .mn-product-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(20, 18, 34, 0.7));
  display: flex; align-items: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mn-product-image-wrap:hover .mn-product-overlay { opacity: 1; }
.mn-product-image-wrap .mn-product-overlay .button {
  width: 100%;
  transform: translateY(12px);
  transition: transform 320ms cubic-bezier(0, 0, 0.2, 1) 60ms;
}
.mn-product-image-wrap:hover .mn-product-overlay .button { transform: translateY(0); }


/* -------------------------------------------------------
   SKELETON
------------------------------------------------------- */
.mn-skeleton {
  background: linear-gradient(
    90deg,
    var(--mn-cream-dark) 25%,
    var(--mn-cream) 50%,
    var(--mn-cream-dark) 75%
  );
  background-size: 200% 100%;
  animation: mn-shimmer 1.5s infinite;
  border-radius: var(--mn-radius-sm);
}
@keyframes mn-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* -------------------------------------------------------
   ICON ROTATE
------------------------------------------------------- */
.mn-icon-rotate { transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1); }
.mn-icon-rotate.is-open { transform: rotate(180deg); }


/* =========================================================
   V5.5 — TOAST AJOUT PANIER + ÉTATS AJAX ADD-TO-CART
   ========================================================= */

/* Toast élégant — remplace le bandeau WC par défaut */
.mn-toast {
  position: fixed !important;
  top: 100px !important;
  right: 24px !important;
  left: auto !important;
  z-index: 99999 !important;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  margin: 0 !important;
  padding: 16px 20px !important;
  background: #fff !important;
  border: 1px solid rgba(232, 168, 32, 0.4) !important;
  border-left: 4px solid #4CAF50 !important;
  border-radius: 8px !important;
  box-shadow: 0 14px 38px rgba(20, 18, 34, 0.18) !important;
  font-family: var(--mn-font-sans);
  font-size: 0.92rem;
  color: var(--mn-black);
  animation: mn-toast-in 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mn-toast__icon {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  background: #4CAF50;
  color: #fff;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}
.mn-toast__text { flex: 1; line-height: 1.4; }
.mn-toast__cta {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mn-gold-deep) !important;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  flex-shrink: 0;
}
.mn-toast__cta:hover { color: var(--mn-accent) !important; }

@keyframes mn-toast-in {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@media (max-width: 600px) {
  .mn-toast {
    right: 12px !important;
    left: 12px !important;
    max-width: none;
    top: 80px !important;
  }
}


/* États AJAX du bouton add-to-cart sur la home */
.mnv2-product .add_to_cart_button.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}
.mnv2-product .add_to_cart_button.loading::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px; height: 14px;
  margin-top: -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: mn-spinner 0.7s linear infinite;
}
.mnv2-product .add_to_cart_button.added {
  background: #4CAF50 !important;
  border-color: #4CAF50 !important;
}
.mnv2-product .add_to_cart_button.added::after {
  content: ' ✓';
  margin-left: 6px;
  font-weight: 700;
}
@keyframes mn-spinner { to { transform: rotate(360deg); } }

/* Lien "View cart" qui apparaît après ajout — masquer (on utilise notre toast) */
.added_to_cart.wc-forward { display: none !important; }
