.product-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  position: relative;
}

.product-card.in-cart {
  background: #fef9c3;
  border-color: rgba(250, 204, 21, 0.5);
}

.product-media {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.65), rgba(226, 232, 240, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.product-media:focus {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: -2px;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-media .placeholder {
  font-size: 18px;
  font-weight: 600;
  color: #475569;
}

/* Badge + edit affordances (copied from shop catalog) */
.product-edit {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #2563eb;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 2;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.product-edit:hover {
  transform: scale(1.05);
}

.product-edit:focus {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

.product-edit svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.product-badge {
  position: absolute;
  top: -24px;
  left: -24px;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  z-index: 1;
}

.product-badge__label {
  padding: 1px 10px;
  max-width: 40px;
  max-height: 32px;
  text-align: center;
  font-weight: 700;
  line-height: 1.05;
  white-space: normal;
  word-break: normal;
  transform: translateY(5px);
}

.product-badge__label-word {
  display: inline-block;
}

@media (max-width: 900px) {
  .product-badge {
    display: none;
  }
}

.product-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-main {
  flex: 0 0 auto;
}

.product-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.product-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.product-variant {
  margin: 4px 0 12px 0;
  font-size: 16px;
  color: #475569;
}

.product-price {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: #0f172a;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

/* Price row styles aligned with shop */
.price-current {
  font-weight: 700;
  color: #0f172a;
}

.product-price.is-discounted .price-current,
.modal-price.is-discounted .price-current {
  color: #0f172a;
}

.price-compare {
  color: #d10107;
  text-decoration: line-through;
  margin-left: 8px;
  font-weight: 500;
  font-size: 0.8em;
}

.price-prefix {
  color: #94a3b8;
  font-weight: 600;
  margin-right: 2px;
  font-size: 0.6em;
}

.price-currency {
  font-size: 0.6em;
  margin-left: 2px;
  display: inline-block;
  vertical-align: baseline;
  transform: translateY(0.05em);
}

.price-savings {
  display: block;
  flex-basis: 100%;
  color: #0d864c;
  font-size: 0.64em;
  font-weight: 500;
  margin-top: 4px;
}

.price-row {
  display: block;
  line-height: 1.05;
}

.price-row + .price-row {
  margin-top: 2px;
}

.unit-tags-row {
  align-self: flex-start;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.unit-tag {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
}

.unit-tag.unit-tag--badge {
  margin-left: 6px;
  display: none;
}

.product-action {
  margin-top: auto;
}

.product-action .btn {
  height: 52px;
}

/* Scope shop-style primary button look to cards only so the
   builder's left-panel buttons keep their dark theme. */
.product-card .btn {
  border: none;
  border-radius: 12px;
  background: #facc15;
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(250, 204, 21, 0.38);
}

.product-card .btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Inline quantity controls – mirror shop layout */
.product-action .quantity-control {
  height: 52px;
}

.product-action .quantity-control button {
  flex: 0 0 52px;
  min-width: 52px;
}

.quantity-control {
  display: flex;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  overflow: hidden;
  background: #f8fafc;
  min-width: 0;
  height: 36px;
}

.quantity-control button {
  flex: 0 0 36px;
  border: none;
  background: var(--accent-yellow);
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-control input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0 10px;
  text-align: center;
  font-size: 14px;
  color: #0f172a;
}

.product-card--compact {
  min-height: 0;
}

.product-card--compact .product-content {
  padding: 12px 14px;
}

.product-card--compact .product-name {
  font-size: 15px;
}

.product-card--compact .product-variant {
  font-size: 13px;
  margin: 2px 0 8px 0;
}

.product-card--compact .product-price {
  font-size: 18px;
  margin-bottom: 10px;
}

.product-card--compact .product-action .btn {
  height: 44px;
}
