/* کارت محصول — مشترک (پیشنهاد ویژه home + لیست محصولات) */
.deal-card {
  --deal-w: 9.25rem;
  --deal-radius: 1.75rem;
  flex: 0 0 var(--deal-w);
  width: var(--deal-w);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--deal-radius);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.deal-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.deal-card.is-hidden {
  display: none;
}

.deal-card__media {
  display: block;
  width: 100%;
  margin: 0;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--deal-radius) var(--deal-radius) 0 0;
  text-decoration: none;
  line-height: 0;
}

.deal-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  vertical-align: top;
  object-fit: cover;
  object-position: center;
}

.deal-card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  padding: 0.5rem 0.5rem 0.45rem;
  text-align: center;
}

.deal-card__title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
  min-height: 2.1em;
  color: rgba(255, 255, 255, 0.94);
}

.deal-card__title a {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-card__title a:hover {
  color: var(--y-hot);
}

.deal-card__discount {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  background: #d32f2f;
  border-radius: 999px;
}

.deal-card__price {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.15rem 0.25rem;
  line-height: 1.25;
}

.deal-card__price ins {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}

.deal-card__unit {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

/* چند بسته — بازه قیمت: ۴۵٬۰۰۰ ~ ۱۵۰٬۰۰۰ تومان */
.product-price-range {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.1rem 0.18rem;
  max-width: 100%;
}

.product-price-range__amount {
  font-weight: 800;
  white-space: nowrap;
}

.product-price-range__sep {
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
  margin-inline: 0.05rem;
}

.deal-card__price--range ins,
.product-card__price--range ins {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.1rem 0.15rem;
  max-width: 100%;
}

.deal-card__price--range .product-price-range__amount {
  font-size: 0.68rem;
}

.product-card__price--range .product-price-range__amount {
  font-size: 0.88em;
}

.deal-card > .deal-card__buy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  min-height: 2.45rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.03em;
  color: #1a1000;
  text-decoration: none;
  background: linear-gradient(180deg, #fff0a8 0%, var(--y-hot) 38%, #e8b800 100%);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0;
  box-sizing: border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 -2px 12px rgba(255, 214, 10, 0.12);
  transition:
    filter 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.deal-card > .deal-card__buy-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.78rem;
  color: #1a1000;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, background 0.2s ease;
}

.deal-card > .deal-card__buy-text {
  position: relative;
  top: 0.02em;
}

.deal-card > .deal-card__buy:hover {
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 -2px 18px rgba(255, 214, 10, 0.22);
}

.deal-card > .deal-card__buy:hover .deal-card__buy-icon {
  transform: scale(1.08);
  background: rgba(0, 0, 0, 0.14);
}

.deal-card > .deal-card__buy:active {
  transform: scale(0.985);
  filter: brightness(0.98);
}

.deal-card > .deal-card__buy:focus-visible {
  outline: 2px solid rgba(255, 240, 160, 0.9);
  outline-offset: -2px;
}

/* موجودی — تصویر خاکستری + برچسب ناموجود */
.deal-card__media-frame,
.product-card__media-frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.product-stock-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.52);
  pointer-events: none;
}

.product-stock-overlay__text {
  display: inline-block;
  max-width: 92%;
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.45rem;
}

.deal-card--unavailable .deal-card__thumb,
.deal-card--unavailable .deal-card__thumb--placeholder {
  filter: grayscale(1) brightness(0.42);
}

.deal-card--unavailable:hover {
  transform: none;
  border-color: var(--border);
}

.deal-card--unavailable > .deal-card__buy--disabled {
  background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
  color: rgba(255, 255, 255, 0.75);
  box-shadow: none;
}

.deal-card--limited .product-stock-overlay {
  background: rgba(0, 0, 0, 0.38);
}

.deal-card--limited .product-stock-overlay__text {
  font-size: 0.58rem;
  color: #fde68a;
  background: rgba(120, 80, 0, 0.75);
  border-color: rgba(253, 230, 138, 0.35);
}

.product-card--unavailable .product-card__img {
  filter: grayscale(1) brightness(0.42);
}

.product-card--unavailable .product-card__link {
  cursor: default;
}
