/* =========================
   Comparison Table Component (BEM) - UPDATED (Glassmorphic Header + Highlighted Popular Column)
========================= */

.table {
  width: 100%;
  overflow-x: auto;
  margin: 40px 0;
}

.table__title {
  text-align: center;
  margin-bottom: 40px;
}

.table__title h2 {
  font-size: 28px;
  font-weight: 800;
  color: #020617;
  margin: 12px 0;
  text-align: center;
}

.table__subtitle {
  font-size: 16px;
  color: #64748b;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.table__wrapper {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.table__content {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

/* =========================
   Glassmorphic Header (جذاب و شیشه‌ای)
========================= */
.table__head th {
  position: relative;
  background: rgba(255, 255, 255, 0.15); /* شیشه‌ای شفاف */
  backdrop-filter: blur(12px); /* افکت بلور شیشه‌ای */
  -webkit-backdrop-filter: blur(12px); /* سافاری */
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 28px 16px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* ستون ویژگی‌ها (سمت راست) کمی تیره‌تر برای تمایز */
.table__head .table__feature {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: right;
  padding-right: 32px;
}

/* پس‌زمینه کلی هدر برای یکپارچگی شیشه‌ای */
.table__head {
  background: linear-gradient(135deg, rgba(0, 31, 63, 0.9), rgba(30, 58, 138, 0.8));
}

/* =========================
   Highlight ستون پرفروش (ستون وسط - حرفه‌ای ⭐)
   رنگ متمایز اما نه خیلی شدید
========================= */
/* هدر ستون پرفروش */
.table__head th:nth-child(3) { /* فرض: ستون سوم = پکیج حرفه‌ای (پرفروش) */
  background: rgba(25, 118, 210, 0.35) !important; /* آبی جذاب شیشه‌ای */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* بدنه - تمام سلول‌های ستون پرفروش */
.table__body td:nth-child(3) {
  background: rgba(25, 118, 210, 0.08) !important; /* رنگ ملایم اما قابل تشخیص */
  font-weight: 600;
}

/* راه‌راه (striped) - حفظ تمایز در ردیف‌های زوج */
.table--striped .table__body tr:nth-child(even) td:nth-child(3) {
  background: rgba(25, 118, 210, 0.15) !important;
}

/* بسته عنوان پرفروش */
.table__package-name {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
}

/* Badge پرفروش */
.table__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #aa0505;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(255, 64, 129, 0.3);
  z-index: 10;
}

/* Body عمومی */
.table__body td {
  padding: 18px 16px;
  font-size: 15px;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  color: #334155;
  vertical-align: middle;
}

.table__feature {
  font-weight: 700;
  color: #020617;
  text-align: right !important;
  background: #f8fafc;
  padding-right: 32px;
  font-size: 15px;
}

/* Striped */
.table--striped .table__body tr:nth-child(even) td {
  background: #f8fafc;
}

.table--striped .table__body tr:nth-child(even) .table__feature {
  background: #f1f5f9;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .table__wrapper {
    border: none;
    box-shadow: none;
    max-width: 100%;
  }

  .table__content {
    border: none;
  }

  .table__head {
    display: none;
  }

  .table__body tr {
    display: block;
    margin-bottom: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    direction: rtl;
    text-align: right;
  }

  .table__body td {
    display: block;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    direction: rtl;
  }

  .table__body td:last-child {
    border-bottom: none;
  }

  .table__feature {
    background: #001f3f !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 18px;
    text-align: center !important;
    padding: 20px 24px;
    border-radius: 14px 14px 0 0;
  }

  .table__body td:not(.table__feature) {
    text-align: center;
    padding: 16px 24px;
  }

  /* برجسته کردن سلول پرفروش در موبایل */
  .table__body td[data-label="حرفه‌ای ⭐"] {
    background: rgba(25, 118, 210, 0.15) !important;
    font-weight: 700;
    color: #1976d2;
    border-left: 4px solid #1976d2;
  }

  .table__body td:not(.table__feature)::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
    font-size: 15px;
  }

  .table__body td[data-label="حرفه‌ای ⭐"]::before {
    color: #1976d2;
    font-weight: 800;
    font-size: 16px;
  }
}