/* ==========================================================================
   COMPONENT: STICKY STACKING CARDS (KEUNGGULAN UTAMA)
   ========================================================================== */

.section-features {
  padding-top: var(--_sizes---spacing--spacing-massive, 5rem);
  padding-bottom: var(--_sizes---spacing--spacing-massive, 5rem);
  background-color: var(--nx-bg-body, #f8fafc);
}

.features-header {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 3.5rem;

  .nx-h2 {
    color: var(--nx-c-heading, #090e17);
    line-height: 1.2;
  }

  .nx-body {
    color: var(--nx-c-body, #475569);
  }
}

/* Pembungkus Semua Kartu */
.features-stack-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  position: relative;
  padding-bottom: 5rem; /* di desktop */

}

@media screen and (max-width: 860px) {
  .features-stack-wrapper {
    padding-bottom: 8rem; /* ruang scroll ekstra 8rem (~128px) di HP */
  }
}

/* Item Kartu Menumpuk (Sticky Logic) */
.feature-card {
  position: sticky;
  top: calc(5.5rem + (var(--stack-index) * 1.5rem)); /* Memberi celah tumpukan di atas */
  background-color: var(--nx-bg-surface, #ffffff);
  border: 1px solid var(--nx-border-subtle, #e2e8f0);
  border-radius: var(--nx-radius-lg, 16px);
  padding: clamp(1.75rem, 4vw, 3.5rem);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);

  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 2.5rem;
  overflow: hidden;

  /* Responsif Layar Menengah & Mobile */
  @media screen and (max-width: 860px) {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    position: relative;
    top: 0 !important; /* Nonaktifkan sticky di mobile agar scroll tidak kaku */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  }
}

/* Konten Teks Kartu */
.feature-card-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;

  .feature-card-num {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--nx-fs-eyebrow, 0.8125rem);
    color: var(--nx-c-primary, #ff5d18);
    letter-spacing: 0.12em;
  }

  .nx-h3 {
    color: var(--nx-c-heading, #090e17);
    margin: 0;
  }

  .nx-body {
    color: var(--nx-c-body, #475569);
    margin: 0;
    line-height: 1.65;
  }
}

/* Area Foto Kartu */
.feature-card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  border-radius: var(--nx-radius-md, 10px);
  overflow: hidden;
  background-color: #e2e8f0;

  img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
    transition: transform var(--nx-dur-normal, 300ms) ease;
  }

  &:hover img {
    transform: scale(1.03);
  }
}

/* Penyesuaian Mobile */
@media screen and (max-width: 860px) {
  .feature-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem; /* Padding lebih ramping agar visual luas */
  }

  .feature-card-media {
    width: 100%;
    aspect-ratio: 16 / 9; /* Proporsi video/layar lebar yang pas di HP */
    height: auto;
    border-radius: 8px;
  }
}
/* ==========================================================================
   RESPONSIF MOBILE: TETAP STICKY & MENUMPUK RAPI
   ========================================================================== */
@media screen and (max-width: 860px) {
  /* Pangkas ruang kosong ekstra agar transisi ke section berikutnya rapat */
  .features-stack-wrapper {
    padding-bottom: 1rem; /* Sebelumnya 8rem */
  }

  /* Pastikan kartu terakhir tidak menyumbang margin bawah ekstra */
  .feature-card:last-child {
    margin-bottom: 0 !important;
  }
}
  .feature-card {
    /* 1. Kunci posisi sticky aktif di browser ponsel & Safari iOS */
    position: -webkit-sticky !important;
    position: sticky !important;

    /* 2. Offset top rapat khusus layar vertikal HP */
    top: calc(4.5rem + (var(--stack-index) * 0.85rem)) !important;
    z-index: var(--stack-index);

    /* 3. Penataan visual 1 kolom */
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
    border-radius: 14px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  /* 4. Gambar proporsional & memenuhi lebar kartu di HP */
  .feature-card-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 8px;
  }
}