/**
 * f2p — 3D designer product badges (CSS, без плоских PNG)
 */

.product-thumb .image > a,
.product-thumb .image,
#product-product .thumbnails li:first-child a.thumbnail,
#product-product .thumbnails > li:first-child {
  position: relative;
  display: block;
}

.f2p-badges {
  position: absolute;
  top: 6%;
  left: 4%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
  perspective: 420px;
  transform-style: preserve-3d;
}

/* ── Base 3D pill ── */
.f2p-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px 5px 8px;
  min-height: 28px;
  border-radius: 8px 10px 10px 8px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  transform: rotate(-8deg) rotateX(12deg) translateZ(8px);
  transform-origin: left center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12),
    0 1px 0 rgba(0, 0, 0, 0.08),
    0 4px 8px rgba(0, 0, 0, 0.22),
    0 10px 20px rgba(0, 0, 0, 0.12);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  animation: f2p-badge-in 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

.f2p-badge:nth-child(2) {
  transform: rotate(-5deg) rotateX(10deg) translateZ(4px) translateX(4px);
  animation-delay: 0.06s;
}

.f2p-badge:nth-child(n+3) {
  display: none;
}

@keyframes f2p-badge-in {
  from {
    opacity: 0;
    transform: rotate(-8deg) rotateX(12deg) translateZ(0) scale(0.7);
  }
  to {
    opacity: 1;
  }
}

/* Gloss + depth edge */
.f2p-badge__layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.08) 38%,
    transparent 52%,
    rgba(0, 0, 0, 0.06) 100%
  );
}

.f2p-badge__layer::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 2px;
  height: 42%;
  border-radius: 6px 8px 50% 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent);
}

.f2p-badge__icon {
  position: relative;
  z-index: 1;
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.2));
}

.f2p-badge__text {
  position: relative;
  z-index: 1;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ── Variants (3D gradients) ── */
.f2p-badge--hit {
  background: linear-gradient(145deg, #ffe566 0%, #f5a623 45%, #d4890a 100%);
  color: #3d2800;
}
.f2p-badge--hit .f2p-badge__text,
.f2p-badge--hit .f2p-badge__icon {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.f2p-badge--new {
  background: linear-gradient(145deg, #7dffb8 0%, #2d9d5a 50%, #1a6b3c 100%);
}

.f2p-badge--seasonal {
  background: linear-gradient(145deg, #c4b5fd 0%, #7c3aed 55%, #5b21b6 100%);
}

.f2p-badge--winter {
  background: linear-gradient(145deg, #e0f2fe 0%, #38bdf8 45%, #0284c7 100%);
  color: #0c4a6e;
}

.f2p-badge--spring {
  background: linear-gradient(145deg, #bbf7d0 0%, #4ade80 50%, #16a34a 100%);
  color: #14532d;
}

.f2p-badge--summer {
  background: linear-gradient(145deg, #fde047 0%, #f97316 55%, #ea580c 100%);
}

.f2p-badge--autumn {
  background: linear-gradient(145deg, #fdba74 0%, #ea580c 50%, #9a3412 100%);
}

.f2p-badge--sale {
  background: linear-gradient(145deg, #fca5a5 0%, #ef4444 48%, #b91c1c 100%);
  font-size: 11px;
}

.f2p-badge--farm {
  background: linear-gradient(145deg, #d9f99d 0%, #65a30d 50%, #3f6212 100%);
  color: #fff;
}

.f2p-badge--bundle {
  background: linear-gradient(145deg, #fda4af 0%, #e11d48 50%, #9f1239 100%);
}

/* Legacy PNG fallback (если остался старый markup) */
.f2p-badges img {
  width: 22%;
  min-width: 40px;
  max-width: 72px;
  height: auto;
  filter:
    drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28))
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.12));
  transform: rotate(-6deg) perspective(200px) rotateX(8deg);
}

@media (min-width: 768px) {
  .f2p-badge {
    font-size: 11px;
    padding: 6px 13px 6px 9px;
    min-height: 32px;
  }
  .f2p-badge__icon {
    font-size: 12px;
  }
}

@media (max-width: 767px) {
  .f2p-badges {
    top: 5%;
    left: 3%;
    gap: 6px;
  }
  .f2p-badge {
    font-size: 9px;
    padding: 4px 9px 4px 7px;
    min-height: 24px;
    transform: rotate(-7deg) rotateX(10deg) translateZ(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .f2p-badge {
    animation: none;
  }
}
