/* =============================================================================
   Manufacturing — Footprint Section
   Figma: 590:2071 (desktop) / 615:1428 (mobile)

   Layout: section header (centered) → 2-col body (map | panel) → stats bar
   The India map uses absolute-positioned pin buttons (currentColor-based SVG).
   Clicking a pin updates the right panel via manufacturing.js.
   ============================================================================= */

/* ── Section ──────────────────────────────────────────────────────────────── */

.mfg-footprint {
  background: var(--color-bg);
  padding: var(--section-pad-desktop) var(--section-pad-x);
}

.mfg-footprint__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap-desktop);
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.mfg-footprint__header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.mfg-footprint__title {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-darker);
  margin: 0 0 16px;
  line-height: 1.2;
}

.mfg-footprint__subtitle {
  font-size: var(--font-size-body-md);
  color: var(--color-grey);
  line-height: 1.6;
  margin: 0;
}

/* ── Body: map + panel (2 columns) ───────────────────────────────────────── */

.mfg-footprint__body {
  display: flex;
  gap: 47px;
  align-items: stretch;
}

/* ── India map ────────────────────────────────────────────────────────────── */

.mfg-footprint__map-wrap {
  flex: 0 0 auto;
  width: 50%;
  border: 1px solid var(--color-black);
  border-radius: var(--radius-md);
  /* overflow must stay visible so pins near map edges aren't clipped */
  overflow: visible;
  padding: 50px;
}

/* Inner div — the actual positioning context for pin overlays.
   No padding here so left/top % values track exactly against
   the rendered image dimensions at any container width. */
.mfg-footprint__map-inner {
  position: relative;
  line-height: 0;
  /* collapse whitespace below img */
}

/* Inline SVG map — replaces the old india-map.png <img> */
.mfg-footprint__map-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Theme the state paths: strip default fill/stroke, apply CSS variables */
.mfg-footprint__map-svg path {
  fill: var(--color-bg);
  stroke: rgba(0, 0, 0, 0.18);
  /* viewBox is 2500×2843; at ~600px rendered width scale ≈0.24, so 5 units ≈ 1.2px */
  stroke-width: 5;
  fill-rule: nonzero;
}

/* Pin buttons — transparent 36×36 overlays that sit on top of the
   India map SVG. Active state shown via a ::after ring.
   The inner .mfg-footprint__pin-icon SVG provides the visible marker. */

.mfg-footprint__pin {
  position: absolute;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  /* Centre the button over the pin’s tip point */
  transform: translate(-50%, -50%);
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
  outline-offset: 3px;
}

/* Inline SVG icon inside each pin button */
.mfg-footprint__pin-icon {
  display: block;
  width: 100%;
  height: 100%;
  color: var(--color-dark);
  transition: color 0.2s ease;
}

.mfg-footprint__pin:hover .mfg-footprint__pin-icon,
.mfg-footprint__pin--active .mfg-footprint__pin-icon {
  color: var(--color-primary);
}

/* Ring indicator — rotated diamond shape matching presence.php */
.mfg-footprint__pin::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2.5px solid transparent;
  transition: border-color 0.2s ease;
  pointer-events: none;
}

.mfg-footprint__pin:hover::after {
  border-color: rgba(205, 38, 29, 0.5);
}

.mfg-footprint__pin--active::after {
  border-color: var(--color-primary);
}

/* ── Location panel ───────────────────────────────────────────────────────── */

.mfg-footprint__panel {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: opacity 0.15s ease;
}

.mfg-footprint__panel--fade {
  opacity: 0;
}

.mfg-footprint__location-img {
  width: 100%;
  height: 316px;
  object-fit: cover;
  border-radius: 23px;
  display: block;
}

.mfg-footprint__location-img--placeholder {
  background: var(--color-grey);
  opacity: 0.25;
  border-radius: 23px;
}

.mfg-footprint__location-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mfg-footprint__location-name {
  font-size: var(--font-size-body-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-darker);
  margin: 0;
  line-height: 1.4;
}

.mfg-footprint__location-address {
  font-size: var(--font-size-body-md);
  font-weight: var(--font-weight-light);
  color: var(--color-darker);
  line-height: 1.6;
  margin: 0;
}

/* ── Capabilities list ────────────────────────────────────────────────────── */

.mfg-footprint__caps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mfg-footprint__cap-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Red circular badge — matches industry4 card icon pattern */
.mfg-footprint__cap-badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Pass light stroke to the SVG icon (same pattern as industry4 icons) */
  --stroke-0: #F8FAF0;
}

.mfg-footprint__cap-icon {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

.mfg-footprint__cap-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mfg-footprint__cap-title {
  font-size: var(--font-size-body-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-darker);
}

.mfg-footprint__cap-desc {
  font-size: 14px;
  color: var(--color-grey);
  line-height: 1.5;
}

/* ── Stats bar ────────────────────────────────────────────────────────────── */

.mfg-footprint__stats {
  display: flex;
  justify-content: center;
  gap: 80px;
  padding-top: var(--section-gap-desktop);
  border-top: 1px solid rgba(55, 55, 55, 0.15);
}

.mfg-footprint__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.mfg-footprint__stat-value {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  line-height: 1;
}

.mfg-footprint__stat-label {
  font-size: var(--font-size-body-md);
  color: var(--color-darker);
  line-height: 1.4;
}

/* ── Tablet (≤1024px) ─────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .mfg-footprint {
    padding: var(--section-pad-desktop) 60px;
  }

  .mfg-footprint__body {
    gap: 32px;
  }

  .mfg-footprint__map-wrap {
    width: 48%;
    padding: 30px;
  }

  .mfg-footprint__stats {
    gap: 40px;
  }
}

/* ── Mobile (≤768px) ──────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .mfg-footprint {
    padding: var(--spacing-between-sections-mobile) var(--section-pad-mobile);
  }

  .mfg-footprint__body {
    flex-direction: column;
    gap: 32px;
  }

  .mfg-footprint__map-wrap {
    width: 100%;
    padding: 16px;
    /* Restore hidden on mobile: SVG scales down cleanly, no pin-edge risk at full width */
    overflow: hidden;
  }

  /* On mobile, let the SVG scale naturally — no fixed-height crop needed */
  .mfg-footprint__map-inner {
    height: auto;
    overflow: visible;
  }

  .mfg-footprint__location-img {
    height: 220px;
  }

  /* Stats: 2×2 grid on mobile */
  .mfg-footprint__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    justify-items: center;
  }
}

/* ── Small mobile (≤480px) ────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .mfg-footprint__stats {
    gap: 24px;
  }

  .mfg-footprint__stat-value {
    font-size: var(--font-size-h2-mobile);
  }
}