/* بلوک‌های فروشگاه مشترک — کارت محصول، section-head (home + product) */
.store-section {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.section-head__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-head__link {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--y-core);
  text-decoration: none;
  white-space: nowrap;
}

.section-head__link:hover {
  color: var(--y-hot);
}

.section-head--center {
  justify-content: center;
  gap: clamp(0.65rem, 3vw, 1.1rem);
}

.section-head--center .section-head__title {
  flex-shrink: 0;
  text-align: center;
}

.section-head--center .section-head__rule {
  flex: 1;
  min-width: 1.25rem;
  max-width: 7rem;
  height: 1px;
}

.section-head--center .section-head__rule:first-of-type {
  background: linear-gradient(90deg, rgba(255, 214, 10, 0.55) 0%, transparent 100%);
}

.section-head--center .section-head__rule:last-of-type {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 214, 10, 0.55) 100%);
}

.store-categories .section-head,
.store-bestsellers .section-head {
  margin-bottom: 0.65rem;
}

.product-scroll {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 7, 0.35) transparent;
  padding-bottom: 0.25rem;
  margin-inline: calc(-1 * var(--pad-inline));
  padding-inline: var(--pad-inline);
}

.product-scroll .product-card {
  flex: 0 0 min(72%, 11.5rem);
  scroll-snap-align: start;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.product-card {
  --product-card-radius: 1.75rem;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  clip-path: none;
  border-radius: var(--product-card-radius);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.product-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.product-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
}

.product-card__media[class*="product-card__media--"] {
  background: transparent !important;
}

.product-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* کارت گرید — تصویر مربع، گوشه‌های گرد (مثل محصولات مرتبط) */
.product-card--grid .product-card__link {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: inherit;
}

.product-card--grid .product-card__media {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: var(--product-card-radius) var(--product-card-radius) 0 0;
}

.product-card--grid .product-card__title {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.4rem 0.5rem 0.15rem;
}

.product-card--grid .product-card__price {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0 0.5rem 0.5rem;
}

.product-card__badge {
  position: absolute;
  top: 0.35rem;
  inset-inline-start: 0.35rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #1a1000;
  background: var(--y-hot);
  clip-path: polygon(
    0.25rem 0,
    100% 0,
    100% calc(100% - 0.25rem),
    calc(100% - 0.25rem) 100%,
    0 100%,
    0 0.25rem
  );
}

.product-card__title {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__meta {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.product-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.product-card__price del {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-card__price ins {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--y-hot);
  text-decoration: none;
}

.product-card__price ins span {
  font-size: 0.65rem;
  font-weight: 600;
}

.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;
}

.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%;
}

.product-card__price--range .product-price-range__amount {
  font-size: 0.88em;
}

/* صفحه محصول — تم تیره */
body.product-page .product-related .section-head__title {
  color: #f0f2f7;
}

body.product-page .product-related .section-head--center .section-head__rule:first-of-type {
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.45) 0%, transparent 100%);
}

body.product-page .product-related .section-head--center .section-head__rule:last-of-type {
  background: linear-gradient(90deg, transparent 0%, rgba(94, 234, 212, 0.45) 100%);
}

@media (min-width: 36rem) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
  }
}

@media (min-width: 48rem) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 64rem) {
  .section-head__title {
    font-size: 1.1rem;
  }

  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card:hover {
    transform: none;
  }
}
