/* Картка товару — спокійний преміум (shop_design §5.1 + BeautyCake). */

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: var(--radius-card);
  padding: 0.7rem;
  box-shadow: var(--shadow-card);
}

.product-card__image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  max-height: none;
  overflow: hidden;
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-accent-start) 8%, #fff);
}

.product-card__media-link {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.product-card__image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 14px;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.4s ease;
}

.product-card:hover .product-card__image,
.product-card:focus-within .product-card__image {
  transform: scale(1.04);
}

.product-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background:
    radial-gradient(circle at 30% 22%, color-mix(in srgb, var(--color-accent-start) 16%, transparent), transparent 55%),
    var(--color-surface);
}

/* ——— Badges ——— */
.product-card__badge {
  position: absolute;
  z-index: 2;
  top: 0.65rem;
  left: auto;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(250, 247, 242, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.02em;
  line-height: 1;
  pointer-events: none;
}

.product-card__badge--hit,
.product-card__badge--new {
  color: var(--color-accent-start);
}

/* ——— Favorite (top-left) ——— */
.product-card__fav {
  position: absolute;
  z-index: 3;
  top: 0.55rem;
  left: 0.55rem;
  margin: 0;
}

.product-card__fav-form {
  margin: 0;
}

.product-card__fav-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(250, 247, 242, 0.9);
  color: var(--color-ink);
  box-shadow: 0 4px 12px rgba(61, 42, 50, 0.12);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.product-card__fav-btn:hover,
.product-card__fav-btn:focus-visible {
  color: var(--color-accent-end);
}

.product-card__fav-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent-start) 28%, transparent);
}

.product-card__fav-btn.is-active {
  color: var(--color-accent-end);
}

.product-card__fav-btn.is-active path {
  fill: currentColor;
}

/* ——— Cart FAB ——— */
.product-card__cart {
  position: absolute;
  z-index: 3;
  right: 0.65rem;
  bottom: 0.65rem;
  margin: 0;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.product-card__cart-btn {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--btn-gradient);
  color: var(--color-on-accent);
  box-shadow: 0 4px 14px rgba(185, 28, 71, 0.28);
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.product-card__cart-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
}

.product-card__cart-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(185, 28, 71, 0.34);
}

.product-card__cart-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--color-accent-start) 25%, transparent),
    0 4px 14px rgba(185, 28, 71, 0.28);
}

.product-card__in-cart {
  position: absolute;
  z-index: 3;
  left: 0.55rem;
  bottom: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 1.7rem;
  margin: 0;
  padding: 0.2rem 0.55rem 0.2rem 0.4rem;
  border-radius: 999px;
  background: rgba(232, 245, 233, 0.94);
  color: #2f7d4a;
  max-width: calc(100% - 3.4rem);
  font-size: 0.72rem;
  font-weight: 560;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.product-card__in-cart[hidden] {
  display: none;
}

.product-card__cart-check {
  display: none;
}

.product-card__cart-btn.is-added,
.product-card__cart-btn.is-in-cart {
  background: #2f7d4a;
  box-shadow: 0 4px 14px rgba(47, 125, 74, 0.28);
}

.product-card__cart-btn.is-added .product-card__cart-icon,
.product-card__cart-btn.is-in-cart .product-card__cart-icon {
  display: none;
}

.product-card__cart-btn.is-added .product-card__cart-check,
.product-card__cart-btn.is-in-cart .product-card__cart-check {
  display: inline;
}

.product-card__cart-btn.is-added:hover,
.product-card__cart-btn.is-in-cart:hover {
  box-shadow: 0 6px 16px rgba(47, 125, 74, 0.34);
}

.product-card__cart-btn.is-error {
  background: var(--color-danger);
}

.product-card__cart-btn:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover .product-card__cart,
  .product-card:focus-within .product-card__cart {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

@media (hover: none), (pointer: coarse) {
  .product-card__cart {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

/* ——— Body / typography ——— */
.product-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  min-height: 0;
  padding: 0 0.1rem;
}

.product-card__link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: inherit;
  text-decoration: none;
  min-height: 0;
}

.product-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.95rem, 1.6vw, 1.12rem);
  line-height: 1.3;
  color: var(--color-ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.product-card__meta {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--color-ink);
  opacity: 0.6;
}

.product-card__price {
  margin: 0;
  margin-top: auto;
  font-family: var(--font-sans);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: baseline;
}

.product-card__current {
  font-size: 0.98rem;
  font-weight: 560;
  color: var(--color-ink);
}

.product-card__current--sale {
  color: var(--color-accent-start);
  font-weight: 650;
}

.product-card__old {
  color: color-mix(in srgb, var(--color-ink) 62%, var(--color-muted));
  text-decoration: line-through;
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 1;
}

.product-card__oos {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  .product-card__image,
  .product-card__cart,
  .product-card__cart-btn {
    transition: none;
  }

  .product-card:hover .product-card__image,
  .product-card:focus-within .product-card__image {
    transform: none;
  }
}

@media (max-width: 768px) {
  .product-card {
    gap: 0.55rem;
  }

  .product-card__image-wrapper {
    border-radius: 12px;
  }

  .product-card__image {
    border-radius: 12px;
  }

  .product-card__badge {
    top: 0.45rem;
    left: auto;
    right: 0.45rem;
    min-height: 1.35rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
  }

  .product-card__fav {
    top: 0.4rem;
    left: 0.4rem;
  }

  .product-card__fav-btn {
    width: 2.75rem;
    height: 2.75rem;
  }

  .product-card__in-cart {
    left: 0.4rem;
    bottom: 0.4rem;
    min-height: 1.55rem;
    font-size: 0.68rem;
  }

  .product-card__cart {
    right: 0.45rem;
    bottom: 0.45rem;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .product-card__cart-btn {
    width: 2.25rem;
    height: 2.25rem;
    box-shadow: 0 3px 10px rgba(185, 28, 71, 0.24);
  }

  .product-card__cart-btn svg {
    width: 1rem;
    height: 1rem;
  }

  .product-card__title {
    font-size: 0.875rem;
    line-height: 1.25;
  }

  .product-card__meta {
    font-size: 0.75rem;
  }

  .product-card__current {
    font-size: 0.84rem;
  }

  .product-card__old {
    font-size: 0.72rem;
  }
}
