/**
 * Product grid cards — single column alignment for copy, buttons, footer
 */

.products-grid .product-card,
.mk-pp-grid .product-card,
.product-card {
  --pc-pad-x: 18px;
  --pc-pad-y: 16px;
  --pc-radius: 16px;
  background: #fff;
  border: 1px solid #e8e4f5;
  border-radius: var(--pc-radius);
  box-shadow: 0 1px 3px rgba(15, 10, 40, 0.04);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.products-grid .product-card:hover,
.mk-pp-grid .product-card:hover,
.product-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 12px 32px rgba(108, 39, 232, 0.12);
  transform: translateY(-3px);
}

.product-card::before {
  display: none !important;
}

.product-card-interactive {
  position: relative;
  z-index: 5;
}

/* ── Media ── */
.product-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #f3f0ff 0%, #ebe6fa 100%);
  overflow: hidden;
  flex-shrink: 0;
}

.product-card-media-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-card-media-link:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: -2px;
}

.product-card-media-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px var(--pc-pad-x) 0;
  pointer-events: none;
}

.product-card-media-bar .wishlist-btn {
  position: static;
  pointer-events: auto;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  flex: 1;
  max-width: calc(100% - 42px);
  pointer-events: none;
}

.product-card-badges .product-badge {
  position: static;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
}

.product-badge--cat {
  background: color-mix(in srgb, var(--badge-color, #6c5ce7) 14%, transparent);
  color: var(--badge-color, #6c27e8);
  border: 1px solid color-mix(in srgb, var(--badge-color, #6c5ce7) 28%, transparent);
}

.product-badge--sale {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.product-card-media-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 38px var(--pc-pad-x) 14px;
  z-index: 0;
}

.product-card-media-visual img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.product-card:hover .product-card-media-visual img {
  transform: scale(1.04);
}

.product-card-media-visual .product-img-placeholder {
  position: static;
  width: 100%;
  height: 100%;
  min-height: 120px;
  border-radius: 0;
}

.product-card-media-visual .product-img-placeholder-icon {
  font-size: 48px;
}

.product-card-media-hover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: rgba(10, 8, 32, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.product-card:hover .product-card-media-hover,
.product-card:focus-within .product-card-media-hover {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .product-card-media-hover {
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

.pc-hover-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.pc-hover-btn--primary {
  background: #6c27e8;
  border-color: transparent;
}

.pc-hover-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.pc-hover-btn--primary:hover {
  background: #5b21b6;
}

/* ── Content column: copy + buttons share same horizontal padding ── */
.product-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--pc-pad-y) var(--pc-pad-x);
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.product-card-copy,
.product-card-actions {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.product-card-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.product-card-name a {
  color: #0f0a20;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.product-card-name a:hover {
  color: #6c27e8;
}

.product-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #6b6885;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.product-card-rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #6b6885;
}

.product-card-rating .stars {
  color: #f59e0b;
  font-size: 11px;
  letter-spacing: 0;
}

.product-card-rating-count {
  color: #9993c0;
}

.product-card-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.product-card-price {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #6c27e8;
  line-height: 1;
}

.product-card-price-was {
  font-size: 13px;
  color: #9993c0;
  text-decoration: line-through;
  font-weight: 600;
}

/* Actions — flush with copy above */
.product-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card .product-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.product-card-btn--cart {
  background: linear-gradient(135deg, #6c27e8, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 14px rgba(108, 39, 232, 0.28);
}

.product-card-btn--cart:hover {
  background: linear-gradient(135deg, #5b21b6, #6d28d9);
  color: #fff;
}

.product-card-btn--ghost {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe !important;
}

.product-card-btn--ghost:hover {
  background: #ede9ff;
  border-color: #c4b5fd !important;
  color: #4c1d95;
}

/* Footer — same side padding as content */
.product-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px var(--pc-pad-x);
  border-top: 1px solid #f0edf8;
  background: #faf9ff;
  font-size: 11px;
  font-weight: 600;
  color: #9993c0;
  min-width: 0;
  box-sizing: border-box;
}

.product-card-meta-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
  flex: 1;
}

.product-card-meta-left > span,
.product-card-meta-install {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.product-card-meta i {
  font-size: 10px;
  color: #a78bfa;
}

.product-card-meta-install {
  flex-shrink: 0;
  color: #059669;
}

.product-card-meta-install i {
  color: #10b981;
}

/* Kill legacy partial styles that shift alignment */
.mk-pp-grid .product-card-body,
.mk-pp-grid .product-card-info,
.mk-pp-grid .product-card-shop {
  padding: 0 !important;
  margin: 0 !important;
}

.mk-pp-grid {
  gap: 22px;
}

.products-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 22px;
}

@media (max-width: 400px) {
  .product-card {
    --pc-pad-x: 14px;
  }
  .product-card-price {
    font-size: 20px;
  }
}
