/*
 * WebPlus — Chapter 5: Services Stack Styles (بطاقات الخدمات المتراكمة)
 * بطاقات Sticky متراكمة فوق بعضها بارتفاعات وحسابات دقيقة وتأثير عمق بصري
 * بادئة الأصناف: wx-
 */

.wx-services-section {
  position: relative;
  background-color: var(--wx-navy);
  color: var(--wx-snow);
  padding-block: var(--wx-sec-pad);
  overflow: visible; /* للسماح بالـ sticky */
}

.wx-services-header {
  margin-bottom: var(--wx-head-gap);
}

.wx-services-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-bottom: 60px;
}

.wx-service-card {
  position: sticky;
  top: calc(90px + var(--card-i, 0) * 18px);
  min-height: 460px;
  background: linear-gradient(145deg, #091a3e 0%, #050e24 100%);
  border: 1px solid var(--wx-border-dark);
  border-radius: var(--wx-radius-xl);
  padding: clamp(32px, 5vw, 54px);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.55);
  transform-origin: center top;
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: clamp(32px, 5vw, 60px);
  align-items: center;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease;
  overflow: hidden;
}

.wx-service-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--wx-blue)), transparent);
  opacity: 0.8;
}

.wx-service-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 30px 90px rgba(0, 102, 255, 0.2);
}

/* عمود المحتوى والتفاصيل (يمين) */
.wx-service-content {
  display: flex;
  flex-direction: column;
}

.wx-service-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.wx-service-index {
  font-family: var(--wx-font-lat);
  font-size: 14px;
  font-weight: 800;
  color: var(--wx-sky);
  letter-spacing: 1px;
}

.wx-service-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--wx-radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--wx-sky);
}

.wx-service-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 800;
  color: var(--wx-snow);
  margin-bottom: 14px;
  line-height: 1.3;
}

.wx-service-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--wx-slate-300);
  margin-bottom: 24px;
}

.wx-service-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.wx-service-feat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--wx-slate-200);
}

.wx-service-feat-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--wx-sky);
  flex-shrink: 0;
}

.wx-service-cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* عمود المخطط البصري الهندسي (يسار) */
.wx-service-visual {
  position: relative;
  background: rgba(5, 14, 36, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--wx-radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  overflow: hidden;
}

.wx-service-visual-grid-bg {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.wx-service-schematic-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  position: relative;
  z-index: 2;
}

.wx-service-visual-metric {
  position: relative;
  z-index: 3;
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 102, 255, 0.2);
  border: 1px solid var(--wx-blue);
  border-radius: var(--wx-radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--wx-snow);
}

@media (max-width: 1024px) {
  .wx-service-card {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 28px;
  }
  .wx-service-visual {
    display: none; /* إخفاء المخطط على الشاشات الصغيرة لإعطاء مساحة للقراءة */
  }
}
