/* كارت منتج البوتيك — يُحمَّل مع includes/affiliate_product_card.php
   الأصناف المزدوجة (product-card + aff-card) مقصودة: الأولى يقرأها JS. */

.aff-card.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(42, 34, 24, 0.05);
  overflow: hidden;
  text-decoration: none;
  height: 100%;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.aff-card.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--rose-gold, #c9a27c);
  box-shadow: 0 12px 28px rgba(201, 162, 124, 0.18);
}

.aff-card .aff-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  background: var(--light-gray, #faf6ee);
  overflow: hidden;
  border-radius: 0;
}

.aff-card .aff-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.aff-card .store-no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  color: var(--dark-gray);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--light-gray, #faf6ee);
}

.aff-card .store-no-image__icon {
  font-size: 1.5rem;
  color: var(--rose-gold, #c9a27c);
}

.aff-card__stock {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
}

.aff-card__stock::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.aff-card__stock--ok {
  color: var(--success-color, #4caf50);
  border-color: #c8e6c9;
  background: #edf7ed;
}

.aff-card__stock--low {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.aff-card__stock--out {
  color: #6b7280;
}

.aff-card--out .aff-card__media img {
  filter: grayscale(0.85);
  opacity: 0.6;
}

.aff-card .product-wishlist {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--secondary-color);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.aff-card .product-wishlist:hover,
.aff-card .product-wishlist.active,
.aff-card .product-wishlist.wishlist-active {
  color: #c45c6a;
  border-color: #f3cdd2;
}

.aff-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 12px;
  flex: 1 1 auto;
}

.aff-card__name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.aff-card__pricing {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.aff-card__price-lbl {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--rose-gold, #c9a27c);
}

.aff-card .product-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  width: auto;
  min-width: 0;
}

.aff-card .price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--secondary-color, #333) !important;
  line-height: 1.15;
}

.aff-card__unit {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--dark-gray, #8a7b70);
  white-space: nowrap;
}

.aff-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.aff-card__view,
.aff-card .aff-card__cart.add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.aff-card__view {
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--secondary-color);
}

.aff-card:hover .aff-card__view {
  border-color: var(--rose-gold, #c9a27c);
  color: var(--rose-gold, #c9a27c);
}

.aff-card .aff-card__cart.add-to-cart-btn {
  width: 100%;
  flex: 0 0 auto;
  height: auto;
  margin: 0;
  border: 1px solid var(--primary-color);
  background: var(--primary-color);
  color: var(--on-primary, #333);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.aff-card .aff-card__cart.add-to-cart-btn:hover {
  background: var(--primary-dark, #e6c200);
  border-color: var(--primary-dark, #e6c200);
  color: var(--on-primary, #333);
}

.aff-card .aff-card__cart.add-to-cart-btn.is-unavailable,
.aff-card .aff-card__cart.add-to-cart-btn.is-unavailable:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .aff-card__body {
    padding: 10px;
    gap: 7px;
  }

  .aff-card__name {
    font-size: 0.82rem;
    min-height: 2.4em;
  }

  .aff-card .price {
    font-size: 0.92rem;
  }

  .aff-card__actions {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .aff-card__view,
  .aff-card .aff-card__cart.add-to-cart-btn {
    min-height: 34px;
    padding: 6px 4px;
    font-size: 0.68rem;
    gap: 4px;
    white-space: nowrap;
  }
}
