/* ============================================================
   GA501 Smart Factory – Styles
   ============================================================ */


/* ---------- CSS Variables ---------- */
:root {
}

/* ============================================================
   FACTORY SECTION
   ============================================================ */
.factory-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

/* ---- Lightened Building Background ---- */
.factory-bg {
  position: absolute;
  inset: 0;
  background-image: url('building-bg.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  /* Lighten: white overlay at ~72% opacity creates washed-out, airy look */
  filter: grayscale(25%) brightness(1.08);
}

.factory-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.68) 0%,
    rgba(235, 243, 255, 0.78) 55%,
    rgba(210, 228, 248, 0.88) 100%
  );
}

/* ---- Container ---- */
.factory-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  padding: 48px 24px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ============================================================
   INTRO ROW (text left + product image right)
   ============================================================ */
.intro-row {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
  margin-bottom: 44px;
}

/* ---- Left: text block ---- */
.intro-text {
  flex: 1 1 0;
  min-width: 0;
}

.intro-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--blue-dark);
  letter-spacing: 0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.intro-body {
  font-family: var(--font-body);
  font-size: clamp(0.82rem, 1.1vw, 1rem);
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.65;
  margin-bottom: 12px;
}

.intro-body:last-child {
  margin-bottom: 0;
}

/* ---- Right: image + badge ---- */
.intro-image-wrap {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-wrap {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
}

.product-img {
  width: clamp(220px, 28vw, 400px);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 32px rgba(0, 51, 102, 0.22));
}

.badge-img {
  position: absolute;
  top: -18px;
  right: -28px;
  width: clamp(80px, 9vw, 120px);
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.18));
}

/* ============================================================
   FEATURES ROW
   ============================================================ */
.features-row {
  width: 100%;
}

.feature-col {
  display: flex;
  justify-content: center;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px 16px 22px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(0,91,187,0.7);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 36px rgba(0, 51, 102, 0.18);
}

/* ---- Circular Feature Image ---- */
.feature-img {
  width: clamp(80px, 10vw, 120px);
  height: clamp(80px, 10vw, 120px);
  object-fit: contain;
  margin-bottom: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Feature Title ---- */
.feature-title {
  font-family: var(--font-heading);
  font-size: clamp(0.75rem, 1.1vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--blue-dark);
  text-transform: uppercase;
  margin-bottom: 10px;
  line-height: 1.3;
}

/* ---- Feature Body Text ---- */
.feature-text {
  font-family: var(--font-body);
  font-size: clamp(0.72rem, 0.9vw, 0.82rem);
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.55;
  margin-bottom: 0;
}

/* ============================================================
   RESPONSIVE – TABLET  (≥576px, <992px)
   ============================================================ */
@media (min-width: 576px) and (max-width: 991.98px) {

  .factory-container {
    padding: 36px 20px 48px;
  }

  .intro-row {
    gap: 28px;
  }

  .product-img {
    width: clamp(200px, 36vw, 320px);
  }

  .badge-img {
    right: -16px;
    top: -14px;
    width: clamp(72px, 11vw, 100px);
  }

  .feature-title {
    font-size: 0.8rem;
  }

  .feature-text {
    font-size: 0.75rem;
  }
}

/* ============================================================
   RESPONSIVE – MOBILE  (<576px)
   - Intro row stacks: image on top, paragraph below
   - 2-column grid (2x2) with last card centered
   ============================================================ */
@media (max-width: 575.98px) {

  .factory-section {
    min-height: auto;
  }

  .factory-container {
    padding: 28px 16px 40px;
    gap: 0;
  }

  /* Stack intro: image first, text second */
  .intro-row {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
    align-items: center;
  }

  /* On mobile, flip order so image is on top */
  .intro-image-wrap {
    order: -1;
  }

  .intro-text {
    order: 1;
    text-align: center;
  }

  .intro-heading {
    font-size: 1.5rem;
  }

  .intro-body {
    font-size: 0.82rem;
  }

  .product-img {
    width: clamp(200px, 72vw, 290px);
  }

  .badge-img {
    top: -12px;
    right: -10px;
    width: 72px;
  }

  .feature-card {
    padding: 16px 12px 18px;
    border-radius: 12px;
  }

  .feature-img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
  }

  .feature-title {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .feature-text {
    font-size: 0.7rem;
    line-height: 1.5;
  }

  /*
   * Center the 5th card (last odd item) in a 2-col grid.
   */
  .features-row .feature-col:last-child:nth-child(odd) {
    flex: 0 0 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
  }

  .features-row .feature-col:last-child:nth-child(odd) .feature-card {
    max-width: calc(50% - 12px);
  }
}

/* ============================================================
   RESPONSIVE – LARGE DESKTOP  (≥1200px)
   ============================================================ */
@media (min-width: 1200px) {

  .intro-row {
    gap: 56px;
  }

  .product-img {
    width: 380px;
  }

  .badge-img {
    width: 118px;
    top: -20px;
    right: -32px;
  }

  .feature-img {
    width: 110px;
    height: 110px;
  }

  .feature-title {
    font-size: 0.88rem;
  }

  .feature-text {
    font-size: 0.8rem;
  }
}
