/* ==== Product Families ("خانواده‌های محصول") ==== */
.product-families {
  width: 100%;
  background-color: #06111f;
  color: #ffffff;
  direction: rtl;
  padding: 28px 0 40px;
}

.product-families-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}

/* سرتیتر */
.product-families-header {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 32px;
}

.product-families-title {
  margin: 0;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}

.product-families-line {
  flex: 0 1 420px;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
}

.product-families-subtitle {
  margin-right: auto;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

/* شبکه کارت‌ها */
.product-families-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

/* کارت */
.family-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 20px;
  background-color: #0a1a2e;
  border: 1px solid rgba(80, 140, 200, 0.28);
  border-radius: 2px;
}

.family-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  min-width: 0;
}

.family-card-tag {
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #9aa8bb;
  margin-bottom: 18px;
}

.family-card-title {
  margin: 0 0 14px;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: #ffffff;
}

.family-card-model {
  margin: 0 0 18px;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.family-card-model--latin {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.3px;
  direction: ltr;
  align-self: flex-start;
}

.family-card-desc {
  margin: 0 0 26px;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.75;
  color: #ffffff;
  max-width: 260px;
}

/* دکمه (بدون هاور) */
.family-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 10px 16px;
  border: 1px solid #1e9be8;
  border-radius: 8px;
  color: #ffffff;
  text-decoration: none;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.family-card-btn-arrow {
  font-size: 20px;
  line-height: 1;
}

/* تصویر */
.family-card-media {
  flex: 0 0 46%;
  max-width: 230px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

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

/* برچسب زرد */
.family-card-badge {
  position: absolute;
  top: 14px;
  left: 16px;
  padding: 6px 12px;
  border: 1px solid #f5b800;
  border-radius: 4px;
  color: #f5b800;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 13px;
  font-weight: 700;
}

/* ==== انیمیشن ظاهر شدن هنگام اسکرول ==== */
.product-families .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  will-change: opacity, transform;
}

.product-families .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* تاخیر پلکانی کارت‌ها */
.product-families-grid .family-card:nth-child(1) { transition-delay: 0.05s; }
.product-families-grid .family-card:nth-child(2) { transition-delay: 0.18s; }
.product-families-grid .family-card:nth-child(3) { transition-delay: 0.31s; }
.product-families-grid .family-card:nth-child(4) { transition-delay: 0.44s; }

@media (prefers-reduced-motion: reduce) {
  .product-families .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==== RESPONSIVE ==== */
@media (max-width: 1024px) {
  .product-families-container {
    padding: 0 24px;
  }

  .product-families-grid {
    grid-template-columns: 1fr;
  }

  /* در حالت تک‌ستونی همه با تاخیر کم ظاهر شوند */
  .product-families-grid .family-card:nth-child(n) {
    transition-delay: 0.05s;
  }
}

@media (max-width: 640px) {
  .product-families-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .product-families-line {
    display: none;
  }

  .product-families-subtitle {
    margin-right: 0;
    width: 100%;
    font-size: 14px;
    color: #cbd5e1;
  }

  .family-card {
    flex-direction: column-reverse;
    align-items: stretch;
    padding: 18px;
  }

  .family-card-media {
    flex: none;
    max-width: none;
    width: 100%;
  }

  .family-card-badge {
    top: 26px;
    left: 26px;
    background-color: rgba(6, 17, 31, 0.8);
  }
}
