/* ============================================================================
   KORBI - FLOATING CART LOTTIE WIDGET
   ============================================================================
   Fixed widget at bottom of viewport. 4 Lottie layers + HTML text overlay.
   Uses pointer-events:none on container; only hitbox divs capture clicks.
   Hidden on cart page via PHP (not rendered at all).
   ============================================================================ */

/* --- Container --- */
.korbi-clw {
  position: fixed;
  z-index: 9990;
  left: 50%;
  bottom: -60px;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 32px);
  max-width: 361px;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  transition: none;
}

.korbi-clw.is-visible {
  transform: translateX(-50%) translateY(0) scale(0.4);
  transform-origin: bottom center;
}

.korbi-clw.is-exiting {
  transform: translateX(-50%) translateY(130%) scale(0.4);
  transform-origin: bottom center;
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.55, 0, 1, 0.45),
              opacity 280ms ease !important;
}

/* --- Lottie layers (all share same 454x673 comp, stacked) --- */
.clw-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.clw-layer svg {
  display: block;
  width: 100% !important;
  height: auto !important;
}

/* Entrance is relative to establish container height */
.clw-layer--entrance {
  position: relative;
  z-index: 2;
}

.clw-layer--bar {
  z-index: 1;
}

.clw-layer--add {
  z-index: 3;
}

.clw-layer--remove {
  z-index: 4;
}

/* --- Clickable hitboxes (user-drawn, percentage-based) --- */
.korbi-clw__hit {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  z-index: 6;
}

.korbi-clw__hit--cart {
  left: 1.2%;
  top: 31.0%;
  width: 39.5%;
  height: 28.7%;
  border-radius: 12px;
}

.korbi-clw__hit--bar {
  left: 17.8%;
  top: 38.4%;
  width: 81.7%;
  height: 18.5%;
  border-radius: 20px;
}

/* --- HTML text overlay (PANIER + count) --- */
.korbi-clw__text {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  left: 51.2%;
  top: 42.8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.korbi-clw__text.is-shown {
  opacity: 1;
  transform: translateY(0);
}

.korbi-clw__panier {
  font-family: var(--font-family);
  font-size: 27px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.korbi-clw__count {
  font-family: var(--font-family);
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: -4px;
}

@keyframes clwCountBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.korbi-clw__count.is-bumping {
  animation: clwCountBump 280ms ease;
}

/* --- Float above bottom nav when present --- */
body.has-korbi-nav .korbi-clw {
  bottom: calc(56px - 60px);
}

/* --- Hide on cart and checkout pages (backup - PHP already skips rendering) --- */
body.woocommerce-cart .korbi-clw {
  display: none;
}

body.woocommerce-checkout .korbi-clw {
  display: none;
}
