/* ============================================
   ARSES Product Card — reusable component
   ============================================ */

.product-card {
  --pc-green: var(--green, #1f7a5c);
  --pc-green-dark: var(--green-dark, #165a44);
  --pc-mint: var(--mint, #e8f5ef);
  --pc-cream: var(--cream, #f6f7f5);
  --pc-text: var(--text, #111111);
  --pc-muted: var(--muted, #6b7280);
  --pc-border: var(--border, #e5e7eb);
  --pc-shadow: var(--shadow-sm, 0 1px 3px rgba(17, 17, 17, 0.06));
  --pc-radius: var(--radius, 16px);
  --pc-body-min: 220px;

  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  overflow: hidden;
  box-shadow: var(--pc-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(17, 17, 17, 0.1);
    border-color: rgba(31, 122, 92, 0.18);
  }
}

.product-card--unavailable {
  opacity: 0.92;
}

.product-card--unavailable .product-card__media img {
  filter: saturate(0.85);
}

/* ---- Media ---- */

.product-card__media {
  position: relative;
  display: block;
  flex-shrink: 0;
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, var(--pc-mint) 0%, #f0f4f2 100%);
  overflow: hidden;
  color: inherit;
}

.product-card__media:focus-visible {
  outline: 2px solid var(--pc-green);
  outline-offset: -2px;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover .product-card__media img {
    transform: scale(1.06);
  }
}

.product-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--pc-green);
  opacity: 0.28;
}

/* ---- Badges ---- */

.product-card__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 24px);
}

.product-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
  line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.product-card__badge--featured {
  background: #fef3c7;
  color: #92400e;
}

.product-card__badge--best {
  background: var(--pc-green);
  color: #fff;
}

.product-card__badge--sale {
  background: #991b1b;
  color: #fff;
}

.product-card__badge--sellers {
  background: rgba(255, 255, 255, 0.96);
  color: var(--pc-green-dark);
  border: 1px solid rgba(31, 122, 92, 0.12);
  backdrop-filter: blur(8px);
}

.product-card__badge--in {
  background: #dcfce7;
  color: #166534;
}

.product-card__badge--out {
  background: #fee2e2;
  color: #991b1b;
}

/* ---- Body ---- */

.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: var(--pc-body-min);
  padding: 18px;
  gap: 6px;
}

.product-card__sku {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--pc-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--pc-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.product-card__title a {
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .product-card__title a:hover {
    color: var(--pc-green);
  }
}

.product-card__title a:focus-visible {
  outline: 2px solid var(--pc-green);
  outline-offset: 2px;
  border-radius: 4px;
}

.product-card__desc {
  font-size: 0.8125rem;
  color: var(--pc-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.45em;
  flex: 1;
}

/* ---- Pricing ---- */

.product-card__pricing {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.product-card__price {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--pc-green-dark);
  letter-spacing: -0.02em;
}

.product-card__price--sale {
  color: #991b1b;
}

.product-card__price--muted {
  font-size: 0.9375rem;
  color: var(--pc-muted);
  font-weight: 600;
}

.product-card__price-old {
  font-size: 0.875rem;
  color: var(--pc-muted);
  text-decoration: line-through;
}

.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.product-card__sellers {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pc-muted);
}

.product-card__stock {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 100px;
  background: #dcfce7;
  color: #166534;
}

.product-card__stock--unavailable {
  background: #fee2e2;
  color: #991b1b;
}

/* ---- Actions ---- */

.product-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 767px) {
  .product-card__actions {
    grid-template-columns: 1fr;
  }

  .product-card__btn--outline {
    display: none;
  }

  .pd-recommendation-grid .product-card__body,
  .product-card__body {
    min-height: 180px;
  }
}

.product-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.product-card__btn:focus-visible {
  outline: 2px solid var(--pc-green);
  outline-offset: 2px;
}

.product-card__btn--primary {
  background: var(--pc-green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 122, 92, 0.2);
}

@media (hover: hover) and (pointer: fine) {
  .product-card__btn--primary:hover:not(:disabled) {
    background: var(--pc-green-dark);
    transform: translateY(-1px);
  }
}

.product-card__btn--primary:disabled {
  background: #eef1ef;
  color: #9ca3af;
  box-shadow: none;
  cursor: not-allowed;
}

.product-card__btn--outline {
  background: #fff;
  color: var(--pc-text);
  border-color: var(--pc-border);
}

@media (hover: hover) and (pointer: fine) {
  .product-card__btn--outline:hover {
    border-color: var(--pc-green);
    color: var(--pc-green);
  }
}

/* ---- Compact variant ---- */

.product-card--compact {
  flex-direction: row;
  max-width: 100%;
}

.product-card--compact .product-card__media {
  flex: 0 0 120px;
  aspect-ratio: 1 / 1;
}

.product-card--compact .product-card__body {
  min-height: auto;
  padding: 16px;
}

.product-card--compact .product-card__desc {
  -webkit-line-clamp: 1;
  min-height: auto;
}

.product-card--compact .product-card__title {
  min-height: auto;
  -webkit-line-clamp: 1;
}

@media (min-width: 480px) {
  .product-card--compact .product-card__media {
    flex-basis: 140px;
  }
}
