/* ==========================================================================
   Swiper — تكامل مع تصميم SMI (أزرار مخصصة + مقاسات الكروت)
   ========================================================================== */

.smi-stat-swiper,
.smi-news-swiper,
.smi-srv-swiper,
.smi-reviews-swiper,
.smi-related-swiper {
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.smi-statbar-cards.swiper-wrapper {
  align-items: flex-start;
  gap: 0; /* spaceBetween من Swiper — gap يكسر حساب العرض */
  min-height: calc(80vh + 32px);
  box-sizing: border-box;
}

.smi-stat-swiper .smi-s-card:nth-child(odd) .smi-s-card-c {
  margin-top: auto;
  padding-bottom: 26px;
}

.smi-stat-swiper .smi-s-card:nth-child(even) .smi-s-card-c {
  margin-top: 0;
  padding-top: 26px;
}

/* لا تضبط width هنا — Swiper يضع العرض inline؛ width:% يسبب توسّع لا نهائي */
.smi-stat-swiper .smi-s-card {
  height: 80vh;
  aspect-ratio: auto;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  opacity: 1;
  visibility: visible;
}

/* Even — نص فوق */
.smi-stat-swiper .smi-s-card:nth-child(even) {
  margin-top: 0;
}

/* Odd — نص تحت + إزاحة للأسفل */
.smi-stat-swiper .smi-s-card:nth-child(odd) {
  margin-top: 32px;
}

/* لا تستخدم height:auto هنا — الصور absolute فينهار الكرت */
.smi-stat-swiper .smi-s-card.swiper-slide {
  height: 80vh;
}

.smi-news-swiper .swiper-slide,
.smi-reviews-swiper .swiper-slide,
.smi-related-swiper .swiper-slide {
  height: auto;
}

.smi-news-swiper .smi-nc,
.smi-reviews-swiper .smi-rev-card,
.smi-related-swiper .smi-ng-card {
  width: 100%;
  height: 100%;
  flex: none;
}

.smi-srv-swiper .swiper-slide {
  height: auto;
}

.smi-srv-swiper .smi-proj-card {
  width: 100%;
  flex: none;
}

/* Contributions — fade */
.smi-contrib-swiper.swiper {
  position: relative;
  width: 100%;
  min-height: 500px;
  overflow: hidden;
  border-radius: 8px;
}

.smi-contrib-swiper .swiper-slide {
  position: relative;
  min-height: 500px;
}

.smi-contrib-swiper .smi-k-img {
  position: absolute;
  inset: 0;
  opacity: 1;
}

.smi-contrib-swiper .smi-k-ov {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.smi-contrib-swiper .smi-k-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
}

.smi-contrib-dots.swiper-pagination {
  position: static;
  margin-top: 16px;
  order: 2;
}

.smi-contrib-dots .swiper-pagination-bullet {
  margin: 0 4px;
}

.smi-srv-swiper.smi-srv-tw {
  direction: inherit;
}

.smi-srv-swiper .smi-srv-tr {
  flex-direction: row;
  gap: 0;
}

.smi-news-tr.swiper-wrapper,
.smi-srv-tr.swiper-wrapper,
.smi-reviews-tr.swiper-wrapper,
.smi-post-related-tr.swiper-wrapper {
  align-items: flex-start;
  min-height: 0;
}

.smi-statbar-cards.swiper-wrapper,
.smi-news-tr.swiper-wrapper,
.smi-srv-tr.swiper-wrapper,
.smi-reviews-tr.swiper-wrapper,
.smi-post-related-tr.swiper-wrapper {
  transition-property: transform;
}

/* لا نستخدم أسهم Swiper الافتراضية */
.swiper-button-next,
.swiper-button-prev {
  display: none !important;
}

/* ==========================================================================
   Mobile — نقاط بدل الأسهم (مرجع: pill teal + dots بيضاء)
   ========================================================================== */

.smi-swiper-dots,
.smi-contrib-dots.smi-swiper-dots {
  display: none;
}

@media (max-width: 767px) {
  .smi-news-arr,
  .smi-srv-arr,
  .smi-reviews-arr,
  .smi-post-related-arr,
  #statNav,
  .smi-contrib-ken .smi-k-nav {
    display: none !important;
  }

  .smi-swiper-dots,
  .smi-contrib-dots.smi-swiper-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 0 0;
    margin-top: 0;
    position: static;
    width: 100%;
    order: 2;
    flex-shrink: 0;
  }

  .smi-news-wrap,
  .smi-srv-wrap,
  .smi-reviews-wrap,
  .smi-post-related-wrap,
  .smi-statbar-slider {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
  }

  .smi-news-tw,
  .smi-srv-tw,
  .smi-reviews-tw,
  .smi-post-related-tw,
  .smi-statbar-cards-wrap {
    order: 1;
  }

  .smi-swiper-dots .smi-dot,
  .smi-contrib-dots .smi-dot {
    width: 8px;
    height: 8px;
    margin: 0 !important;
    padding: 0;
    border: none;
    border-radius: 50%;
    opacity: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: width 0.3s ease, background 0.3s ease, border-radius 0.3s ease;
  }

  .smi-swiper-dots .smi-dot.smi-on,
  .smi-contrib-dots .smi-dot.smi-on {
    width: 28px;
    border-radius: 999px;
    background: var(--c2);
  }

  /* خلفيات داكنة */
  .smi-statbar .smi-swiper-dots .smi-dot {
    background: rgba(255, 255, 255, 0.55);
  }

  .smi-statbar .smi-swiper-dots .smi-dot.smi-on {
    background: var(--c2);
  }

  /* خلفيات فاتحة */
  .smi-news .smi-swiper-dots .smi-dot,
  .smi-srv .smi-swiper-dots .smi-dot,
  .smi-reviews .smi-swiper-dots .smi-dot,
  .smi-post-related .smi-swiper-dots .smi-dot,
  .smi-contrib-dots .smi-dot {
    background: var(--brand-soft);
  }

  .smi-news .smi-swiper-dots .smi-dot.smi-on,
  .smi-srv .smi-swiper-dots .smi-dot.smi-on,
  .smi-reviews .smi-swiper-dots .smi-dot.smi-on,
  .smi-post-related .smi-swiper-dots .smi-dot.smi-on,
  .smi-contrib-dots .smi-dot.smi-on {
    background: var(--c2);
  }

  .smi-srv-wrap,
  .smi-reviews-wrap,
  .smi-post-related-wrap {
    padding-bottom: 0;
  }

  /* موبايل: كرت + لمحة من التالي، ارتفاع 80vh */
  .smi-stat-swiper {
    min-height: calc(80vh + 24px);
  }

  .smi-statbar-cards.swiper-wrapper {
    gap: 0;
    min-height: calc(80vh + 24px);
    height: auto;
  }

  .smi-stat-swiper .smi-s-card,
  .smi-stat-swiper .smi-s-card.swiper-slide {
    height: 80vh !important;
    min-height: 80vh !important;
    max-height: 80vh;
    aspect-ratio: auto;
    flex-shrink: 0;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .smi-stat-swiper .smi-s-card:nth-child(odd) {
    margin-top: 24px;
  }

  .smi-stat-swiper .smi-s-card-n {
    font-size: clamp(42px, 11vw, 56px);
    margin-bottom: 12px;
  }

  .smi-stat-swiper .smi-s-card-l {
    font-size: clamp(14px, 3.8vw, 17px);
    line-height: 1.45;
  }
}

@media (min-width: 768px) {
  .smi-statbar-cards.swiper-wrapper {
    min-height: calc(80vh + 32px);
  }
}

@media (min-width: 992px) {
  .smi-stat-swiper .smi-s-card {
    height: 80vh;
  }

  .smi-stat-swiper .smi-s-card:nth-child(odd) {
    margin-top: 72px;
  }

  .smi-statbar-cards.swiper-wrapper {
    min-height: calc(80vh + 72px);
  }
}
