/**
 * BienHabillé — Animations CSS
 * Entrées, transitions, états visuels
 *
 * @package BienHabille
 */

/* ============================================================
   ENTRÉES AU SCROLL — Intersection Observer
   ============================================================ */

.bh-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.bh-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.bh-reveal--delay-1 { transition-delay: 0.1s; }
.bh-reveal--delay-2 { transition-delay: 0.2s; }
.bh-reveal--delay-3 { transition-delay: 0.3s; }
.bh-reveal--delay-4 { transition-delay: 0.4s; }

/* Réduire les animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
  .bh-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .bh-announcement-bar__track {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================================
   OVERLAY GLOBAL
   ============================================================ */

.bh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--bh-transition-slow);
}

.bh-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.bh-toasts {
  position: fixed;
  bottom: var(--bh-space-6);
  right: var(--bh-space-6);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--bh-space-3);
  pointer-events: none;
}

.bh-toast {
  display: flex;
  align-items: center;
  gap: var(--bh-space-3);
  padding: var(--bh-space-4) var(--bh-space-5);
  background: var(--bh-black);
  color: var(--bh-white);
  border-radius: var(--bh-radius-md);
  font-size: var(--bh-text-sm);
  font-weight: 500;
  box-shadow: var(--bh-shadow-lg);
  pointer-events: all;
  min-width: 260px;
  max-width: 360px;
  transform: translateX(120%);
  transition: transform var(--bh-transition-slow);
}

.bh-toast.is-visible {
  transform: translateX(0);
}

.bh-toast--success { background: var(--bh-green); }
.bh-toast--error   { background: var(--bh-red); }
.bh-toast--info    { background: var(--bh-black); }

.bh-toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.bh-toast__close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  transition: color var(--bh-transition);
  flex-shrink: 0;
}

.bh-toast__close:hover {
  color: var(--bh-white);
}

/* ============================================================
   WISHLIST HEART
   ============================================================ */

.bh-wishlist-btn {
  position: absolute;
  top: var(--bh-space-3);
  right: var(--bh-space-3);
  z-index: 3;
  width: 32px;
  height: 32px;
  background: var(--bh-white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--bh-shadow-sm);
  transition: transform var(--bh-transition), background var(--bh-transition);
  opacity: 0;
}

.bh-product-card:hover .bh-wishlist-btn {
  opacity: 1;
}

.bh-wishlist-btn:hover {
  transform: scale(1.1);
}

.bh-wishlist-btn svg {
  width: 16px;
  height: 16px;
  color: var(--bh-black);
  transition: fill var(--bh-transition), color var(--bh-transition);
}

.bh-wishlist-btn.is-active svg {
  fill: var(--bh-black);
}

/* ============================================================
   COMPARE BUTTON
   ============================================================ */

.bh-compare-btn {
  position: absolute;
  bottom: var(--bh-space-3);
  right: var(--bh-space-3);
  z-index: 3;
  width: 32px;
  height: 32px;
  background: var(--bh-white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--bh-shadow-sm);
  transition: transform var(--bh-transition), background var(--bh-transition);
  opacity: 0;
}

.bh-product-card:hover .bh-compare-btn {
  opacity: 1;
}

.bh-compare-btn:hover {
  transform: scale(1.1);
}

.bh-compare-btn svg {
  width: 16px;
  height: 16px;
  color: var(--bh-black);
}

.bh-compare-btn.is-active {
  background: var(--bh-black);
}

.bh-compare-btn.is-active svg {
  color: var(--bh-white);
}

/* ============================================================
   COMPARE BAR FLOTTANTE
   ============================================================ */

.bh-compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  background: var(--bh-white);
  border-top: 1px solid var(--bh-gray-mid);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  padding: var(--bh-space-4) var(--bh-space-8);
  transform: translateY(100%);
  transition: transform var(--bh-transition-slow);
}

.bh-compare-bar.is-visible {
  transform: translateY(0);
}

.bh-compare-bar__inner {
  max-width: var(--bh-container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--bh-space-6);
}

.bh-compare-bar__items {
  display: flex;
  gap: var(--bh-space-4);
  flex: 1;
}

.bh-compare-bar__item {
  display: flex;
  align-items: center;
  gap: var(--bh-space-3);
  background: var(--bh-beige-light);
  padding: var(--bh-space-2) var(--bh-space-3);
  border-radius: var(--bh-radius-md);
}

.bh-compare-bar__item img {
  width: 40px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--bh-radius-sm);
  background: var(--bh-beige-mid);
}

.bh-compare-bar__item-name {
  font-size: var(--bh-text-xs);
  font-weight: 500;
  color: var(--bh-black);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bh-compare-bar__item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bh-gray-text);
  padding: 0;
  font-size: 14px;
  line-height: 1;
  transition: color var(--bh-transition);
}

.bh-compare-bar__item-remove:hover {
  color: var(--bh-black);
}

.bh-compare-bar__ctas {
  display: flex;
  gap: var(--bh-space-3);
  flex-shrink: 0;
}

.bh-compare-bar__btn {
  padding: var(--bh-space-3) var(--bh-space-5);
  border-radius: var(--bh-radius-pill);
  font-family: var(--bh-font);
  font-size: var(--bh-text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--bh-transition);
}

.bh-compare-bar__btn--primary {
  background: var(--bh-black);
  color: var(--bh-white);
  border: none;
}

.bh-compare-bar__btn--secondary {
  background: var(--bh-white);
  color: var(--bh-black);
  border: 1px solid var(--bh-gray-mid);
}

.bh-compare-bar__btn:hover {
  opacity: 0.8;
}
