/* Main section */
.minlong-certificate-section {
  position: relative;
  padding: var(--component-gap) 0;
  background: #F5F5F5;
  /* overflow-x: visible; Allow right-side peek */
  /* overflow-y: hidden; */
  overflow: hidden;
}

/* Section header */
.minlong-certificate-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--component-gap-sm);
  position: relative;
  z-index: 40; /* Keep header above full-width carousel */
}

/* Section title */
.minlong-certificate-section .section-title {
  position: relative;
  font-family: var(--semibold-font-family);
  font-size: var(--title-size-h3);
  font-weight: 600;
  line-height: 1.5;
  color: #103862;
  margin: 0;
  padding-bottom: var(--text-gap-lg);
}

/* Decorative lines under title */
.minlong-certificate-section .section-title::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 1px;
  background: #103862;
}

.minlong-certificate-section .section-title::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 15px;
  height: 1px;
  background: #103862;
}

/* Navigation buttons wrapper */
.minlong-certificate-section .swiper-nav {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 50; /* Ensure buttons are clickable */
}

/* Ensure nav buttons are clickable */
.minlong-certificate-section .swiper-nav .swiper-button-prev,
.minlong-certificate-section .swiper-nav .swiper-button-next {
  cursor: pointer;
  pointer-events: auto;
  position: unset;
    transform: none;
    margin: 0;
    padding: 0;
}

/* Force correct arrow direction (avoid rtl swapping) */
.minlong-certificate-section .swiper-nav .swiper-button-prev:after {
  content: 'prev';
}
.minlong-certificate-section .swiper-nav .swiper-button-next:after {
  content: 'next';
}

/* Stats carousel wrapper */
.minlong-certificate-section .stats-carousel-wrapper {
  position: absolute;
  left: calc(var(--page-padding));
  margin-bottom: var(--component-gap-sm);
  top: 0;
}

/* Stats row */
.minlong-certificate-section .stats-row {
  gap: var(--component-gap-lg);
}

/* Stat item */
.minlong-certificate-section .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: var(--text-gap) 0;
  position: relative;
}

/* Separator line between stats */
.minlong-certificate-section .stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: calc( 0px - var(--component-gap-lg) / 2);
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 60px;
  background: #999999;
}

/* Stat content */
.minlong-certificate-section .stat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

/* Stat number */
.minlong-certificate-section .stat-number {
  font-family: var(--title-font-family);
  font-size: var(--title-size-h1);
  font-weight: 700;
  line-height: 1.52;
  color: #103862;
}

.minlong-certificate-section .stat-number .symbol {
  margin-left: 2px;
}

/* Stat label */
.minlong-certificate-section .stat-label {
  font-family: var(--medium-font-family);
  font-size: var(--text-title-size);
  font-weight: 500;
  line-height: 1.56;
  color: #333333;
}

/* Certificate carousel section - full width */
.minlong-certificate-section .certificate-carousel-section {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: var(--component-gap-sm) 0 0;
}

/* Certificate carousel wrapper */
.minlong-certificate-section .certificate-carousel-wrapper {
  position: relative;
  visibility: hidden; /* Avoid initial misalignment flash */
  will-change: transform;
  transform: translateX(0);
  transition: none; /* JS locks alignment per-frame to remove rebound */
  height: 532px; /* Lock height to active size on desktop */
}

.minlong-certificate-section.is-ready .certificate-carousel-wrapper {
  visibility: visible;
}

/* Certificate swiper */
.minlong-certificate-section .minlong-certificate-swiper {
  overflow: visible;
  height: 100%;
}

.minlong-certificate-section .minlong-certificate-swiper .swiper-wrapper {
  transition-timing-function: ease-in-out;
  align-items: flex-end; /* Bottom align all slides */
  height: 100%;
}

/* Certificate slide */
.minlong-certificate-section .minlong-certificate-swiper .swiper-slide {
  width: auto;
  transition: all 0.5s ease;
  display: flex; /* Bottom align slide content */
  align-items: flex-end;
  padding: 0; /* Use swiper spaceBetween for spacing */
}

/* Certificate item */
.minlong-certificate-section .cert-item {
  position: relative;
  height: 280px; /* Align by height, width auto */
  width: auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: height 600ms ease; /* Smooth active size change */
}

/* Certificate image */
.minlong-certificate-section .cert-image {
  height: 100%;
  position: relative;
  z-index: 1;
}

.minlong-certificate-section .cert-image img {
  height: 100%;
  width: auto; /* Width adapts to image ratio */
  object-fit: contain; /* Avoid cropping when ratio varies */
  display: block;
}

/* Active certificate item - 1.9x by height on desktop (keeps spacing + bottom align) */
.minlong-certificate-section .minlong-certificate-swiper .swiper-slide-active .cert-item {
  height: 532px; /* 280 * 1.9 */
  z-index: 10;
}

/* Responsive styles */
@media screen and (max-width: 1200px) {
  .minlong-certificate-section .certificate-carousel-wrapper {
    height: 494px; /* 260 * 1.9 */
  }
  .minlong-certificate-section .cert-item {
    height: 260px;
  }

  .minlong-certificate-section .minlong-certificate-swiper .swiper-slide-active .cert-item {
    height: 494px; /* 260 * 1.9 */
  }
  
  .minlong-certificate-section .stat-icon {
    width: 56px;
    height: 56px;
  }
}

@media screen and (max-width: 992px) {
  .minlong-certificate-section .stats-carousel-wrapper{
    position:static;
    padding-left: var(--page-padding);
  }
  .minlong-certificate-section .certificate-carousel-wrapper {
    height: auto;
  }
  .minlong-certificate-section .cert-item {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    height: auto;
  }

  .minlong-certificate-section .stat-icon {
    width: 48px;
    height: 48px;
  }
  
  /* Remove scaling on mobile */
  .minlong-certificate-section .minlong-certificate-swiper .swiper-slide-active .cert-item {
    height: auto;
  }
  
  /* Full width slides on mobile */
  .minlong-certificate-section .minlong-certificate-swiper .swiper-slide {
    width: 100%;
    padding: 0; /* No extra gutter on mobile */
  }
}

@media screen and (max-width: 768px) {
  .minlong-certificate-section .section-header {
    /* flex-direction: column; */
    align-items: center;
    gap: var(--text-gap);
  }
  
  .minlong-certificate-section .stat-item {
    gap: var(--text-gap-md);
  }
  
  /* Remove separator on mobile */
  .minlong-certificate-section .swiper-slide:not(:last-child) .stat-item::after {
    display: none;
  }
  
  .minlong-certificate-section .stat-icon {
    width: 42px;
    height: 42px;
  }
}

@media screen and (max-width: 576px) {
  .minlong-certificate-section .stat-icon {
    width: 36px;
    height: 36px;
  }
  
  .minlong-certificate-section .stat-content {
    gap: 4px;
  }
}