/**
 * Header cart badge — place [laventyr_cart_count] inside/near the Elementor bag button.
 * Parent should be position: relative (e.g. .elementor-button-content-wrapper or .elementor-button).
 */

.elementor-button .elementor-button-content-wrapper,
.elementor-button {
  position: relative;
}

.elementor-widget-icon .elementor-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.elementor-widget-icon .wppb-font-shopping-bag {
  position: relative;
  display: inline-block;
}

.elementor-widget-icon .wppb-font-shopping-bag.laventyr-bag-has-items::after {
  content: "";
  position: absolute;
  top: 54%;
  left: 50%;
  width: 0.34em;
  height: 0.34em;
  margin-left: -0.17em;
  margin-top: -0.17em;
  border-radius: 999px;
  background: #1a1a1a;
  animation: laventyr-bag-dot-grow 1.2s ease-out infinite;
  pointer-events: none;
}

.laventyr-header-cart-count {
  position: absolute;
  top: -1em;
  right: -0.8em;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  background: #1a1a1a;
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
}

.laventyr-header-cart-count--has-items {
  animation: laventyr-cart-dot-pulse 1.3s ease-out infinite;
}

.laventyr-header-cart-count--has-items::after {
  content: "";
  position: absolute;
  inset: -0.22rem;
  border-radius: 999px;
  border: 1px solid rgba(26, 26, 26, 0.35);
  animation: laventyr-cart-dot-ring 1.3s ease-out infinite;
}

.laventyr-header-cart-count--empty {
  display: none !important;
}

@keyframes laventyr-cart-dot-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.08);
  }
}

@keyframes laventyr-cart-dot-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes laventyr-bag-dot-grow {
  0%,
  100% {
    transform: scale(0.88);
    opacity: 0.7;
  }
  45% {
    transform: scale(1.18);
    opacity: 1;
  }
}
