/* MERARY product badge «Новинка» / «Хит» — catalog cards */
.cx-product-card,
.product-card {
  position: relative;
}

.product-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px 0 11px;
  overflow: hidden;
  isolation: isolate;
  background: rgba(255, 250, 251, 0.94);
  border: 1px solid rgba(239, 166, 183, 0.72);
  border-radius: 999px;
  color: #dc6079;
  box-shadow:
    0 3px 10px rgba(176, 84, 105, 0.05),
    0 1px 2px rgba(176, 84, 105, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(239, 166, 183, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition:
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease;
  pointer-events: none;
}

/* Блик — яркий, чёткий, сразу заметный */
.product-badge::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 0;
  width: 48%;
  height: 180%;
  z-index: 1;
  background: linear-gradient(
    112deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.35) 44%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0.35) 56%,
    rgba(255, 255, 255, 0) 70%,
    transparent 100%
  );
  transform: translateX(-185%) skewX(-24deg);
  animation: product-badge-shimmer-glow 2.2s ease-in-out infinite;
  pointer-events: none;
}

.product-badge::after {
  content: '';
  position: absolute;
  top: -40%;
  left: 0;
  width: 28%;
  height: 180%;
  z-index: 2;
  background: linear-gradient(
    112deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 36%,
    rgba(255, 255, 255, 0.85) 47%,
    #ffffff 50%,
    rgba(255, 255, 255, 0.85) 53%,
    rgba(255, 255, 255, 0) 64%,
    transparent 100%
  );
  transform: translateX(-185%) skewX(-24deg);
  animation: product-badge-shimmer 2.2s ease-in-out infinite;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95));
}

@keyframes product-badge-shimmer {
  0%,
  10% {
    transform: translateX(-185%) skewX(-24deg);
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  44% {
    transform: translateX(265%) skewX(-24deg);
    opacity: 1;
  }
  50%,
  100% {
    transform: translateX(265%) skewX(-24deg);
    opacity: 0;
  }
}

@keyframes product-badge-shimmer-glow {
  0%,
  10% {
    transform: translateX(-185%) skewX(-24deg);
    opacity: 0;
  }
  14% {
    opacity: 0.9;
  }
  44% {
    transform: translateX(265%) skewX(-24deg);
    opacity: 0.9;
  }
  50%,
  100% {
    transform: translateX(265%) skewX(-24deg);
    opacity: 0;
  }
}

.product-badge__icon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #e3637d;
  font-size: 16px;
  line-height: 1;
  transform-origin: center;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.product-badge__text {
  position: relative;
  z-index: 2;
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.045em;
  white-space: nowrap;
  text-transform: uppercase;
}

.product-badge--hit {
  color: #c94d6a;
  border-color: rgba(240, 79, 119, 0.55);
  background: rgba(255, 241, 244, 0.96);
}

.product-badge--hit .product-badge__icon {
  color: #f04f77;
}

.cx-product-card:hover .product-badge,
.product-card:hover .product-badge {
  transform: translateX(3px);
  background: rgba(255, 252, 252, 0.98);
  border-color: rgba(230, 126, 151, 0.82);
  box-shadow:
    0 6px 18px rgba(211, 95, 121, 0.1),
    0 2px 5px rgba(211, 95, 121, 0.05);
}

.cx-product-card:hover .product-badge__icon,
.product-card:hover .product-badge__icon {
  transform: rotate(7deg);
}

/* Hide legacy pill if empty / unused */
:is(body.catalog-exact, .cx-admin-stage, #bestsellers) .cx-badge {
  display: none !important;
}

@media (max-width: 768px) {
  .product-badge {
    top: 10px;
    left: 10px;
    height: 27px;
    padding: 0 11px 0 9px;
    gap: 6px;
  }
  .product-badge__text {
    font-size: 10px;
  }
  .product-badge__icon {
    width: 14px;
    height: 14px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-badge,
  .product-badge__icon {
    transition: none;
  }
  .product-badge::before,
  .product-badge::after {
    animation: none;
    display: none;
  }
  .cx-product-card:hover .product-badge,
  .product-card:hover .product-badge,
  .cx-product-card:hover .product-badge__icon,
  .product-card:hover .product-badge__icon {
    transform: none;
  }
}

/* Admin badge picker preview */
.admin-badge-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  min-height: 34px;
}
.admin-badge-preview .product-badge {
  position: static;
  transform: none !important;
}
