/* ==========================================================================
   MG Electronic — Homepage Sections B, C, D, E
   All sections share the black background used in Section A (hero).
   ========================================================================== */

.mg-section {
  position: relative;
  background: #000000;
  padding: 90px 6% 70px;
}

/* ---------- Section B ---------- */

.mg-section-b {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.mg-section-b__heading {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 61.9px;
  line-height: 1.05;
  color: #ffffff;
  margin: 0;
  flex: 1 1 420px;
}

.mg-section-b__heading span {
  display: block;
}

.mg-section-b__heading-highlight {
  background: linear-gradient(90deg, #ff0106 0%, #fef204 50%, #09b3f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.mg-section-b__subtext {
  margin: 16px 0 0;
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
}

.mg-section-b__machines {
  position: relative;
  flex: 1 1 380px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.mg-section-b__carousel {
  position: relative;
  width: 260px;
  height: 320px;
}

.mg-section-b__carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.mg-section-b__carousel img.is-active {
  opacity: 1;
  visibility: visible;
}

.mg-section-b__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mg-section-b__arrow:hover {
  background: rgba(255, 1, 6, 0.15);
  border-color: #ff0106;
}

.mg-section-b__arrow svg {
  width: 18px;
  height: 18px;
}

.mg-section-b__stats {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mg-section-b__stat {
  font-family: 'Roboto', sans-serif;
  text-align: left;
}

.mg-section-b__stat-figure {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 40px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.mg-section-b__stat-label {
  display: block;
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
}

.mg-section-b__stat--red .mg-section-b__stat-figure { color: #ff0106; }
.mg-section-b__stat--green .mg-section-b__stat-figure { color: #22c55e; }
.mg-section-b__stat--yellow .mg-section-b__stat-figure { color: #fef204; }
.mg-section-b__stat--blue .mg-section-b__stat-figure { color: #09b3f1; }

.mg-section-b__stat--red .mg-section-b__stat-label { color: #ff0106; }
.mg-section-b__stat--green .mg-section-b__stat-label { color: #22c55e; }
.mg-section-b__stat--yellow .mg-section-b__stat-label { color: #fef204; }
.mg-section-b__stat--blue .mg-section-b__stat-label { color: #09b3f1; }

/* ---------- Section C ---------- */

.mg-section-c {
  padding-top: calc(var(--mg-nav-height) + 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
}

.mg-section-c__heading {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 28px;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  line-height: 1.05;
}

.mg-section-c__word {
  font-size: clamp(48px, 11vw, 116px);
}

.mg-section-c__word--red { color: #ff0106; }
.mg-section-c__word--yellow { color: #fef204; }
.mg-section-c__word--blue { color: #09b3f1; }

.mg-section-c__subtitle {
  margin: 0;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  font-size: 22px;
  font-weight: 400;
}

.mg-section-c__boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 1000px;
  margin-top: 26px;
}

.mg-section-c__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 36px 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.mg-section-c__box-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 1, 6, 0.12);
  color: var(--mg-accent, #ff0106);
}

.mg-section-c__box-icon svg {
  width: 26px;
  height: 26px;
}

.mg-section-c__box-title {
  margin: 0;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 16px;
}

/* ---------- Section D ---------- */

.mg-section-d {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.mg-section-d__heading {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  color: #ffffff;
  text-align: left;
}

.mg-section-d__heading-highlight {
  background: linear-gradient(90deg, #ff0106 0%, #09b3f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.mg-section-d__boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.mg-section-d__box {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #ffffff;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mg-section-d__box:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--mg-accent, #ff0106);
}

.mg-section-d__box-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.mg-section-d__box-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 28px);
  color: #ffffff;
}

/* ---------- Section: Events ---------- */

.mg-section-events {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 40px;
  min-height: 640px;
}

.mg-section-events__intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 320px;
}

.mg-section-events__heading {
  margin: 0 0 16px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  color: #ffffff;
  text-align: left;
}

.mg-section-events__subheading {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 420px;
}

.mg-section-events__images {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.mg-section-events__images img {
  height: 100%;
  width: auto;
  max-width: 320px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

@media (max-width: 860px) {
  .mg-section-events {
    flex-direction: column;
    min-height: 0;
  }

  .mg-section-events__images {
    margin-left: 0;
    width: 100%;
  }

  .mg-section-events__images img {
    height: auto;
    max-width: none;
    flex: 1 1 0;
  }


  .mg-section {
    padding: 60px 6% 50px;
  }

  .mg-section-b__heading {
    font-size: clamp(34px, 9vw, 61.9px);
    text-align: center;
  }

  .mg-section-b {
    justify-content: center;
    text-align: center;
  }

  .mg-section-b__machines {
    order: 3;
    min-height: 220px;
  }

  .mg-section-b__carousel {
    width: 200px;
    height: 240px;
  }

  .mg-section-b__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 16px;
    text-align: center;
  }

  .mg-section-b__stat {
    min-width: 0;
  }

  .mg-section-b__stat-figure {
    font-size: clamp(18px, 6vw, 26px);
    overflow-wrap: break-word;
  }

  .mg-section-b__stat-label {
    font-size: 13px;
    overflow-wrap: break-word;
  }

  .mg-section-c__boxes {
    grid-template-columns: 1fr;
  }

  .mg-section-d__heading {
    text-align: center;
  }

  .mg-section-d__boxes {
    grid-template-columns: 1fr;
  }

  .mg-section-d__box {
    aspect-ratio: auto;
    padding: 40px 24px;
  }
}
