/* ==========================================================================
   사업분야 > 제어 장치 (Figma 1:6403 제어장치) — page body only
   Hero/stage: sp-common.css + sp-hero.js
   Sections: stage copy (1:6478) / Core Capabilities (1:6486) / product tabs (1:6532)
             / product list (1:6533) / product details + spec table (1:6563)
   Products are rendered from products_api.php?category=control (inline script in control.html)
   ========================================================================== */
.control-page {
  --cont-navy: #002165;
  --cont-wide: min(1520px, 100% - 2 * clamp(16px, 10.417vw, 200px));
}

/* ---------- Stage scene B copy (1:6479) ---------- */
.control-page .cont-stage-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 2.083vw, 40px);
  width: min(1085px, 100% - 32px);
  font-size: inherit;
  font-weight: inherit;
}
.control-page .cont-stage-copy .sp-eyebrow {
  font-size: clamp(15px, 1.042vw, 20px);
  margin-bottom: calc(14px - clamp(20px, 2.083vw, 40px));
}
.cont-stage-title {
  font-weight: 600;
  font-size: clamp(28px, 2.917vw, 56px);
  line-height: 1.3;
  letter-spacing: -0.04em;
  color: #fff;
  word-break: keep-all;
}
.cont-stage-desc {
  font-weight: 500;
  font-size: clamp(15px, 1.25vw, 24px);
  line-height: 1.6;
  letter-spacing: -0.03em;
  color: #fff;
  word-break: keep-all;
}

/* Stage image crop: Figma 1:6478 shows the image at ~1.5x cover, centred on the HVAC panel.
   sp-hero.js drives `transform` inline, so the extra zoom uses the separate scale/translate
   properties (applied on top of it). Covers the clip box in scene A as long as boxW >= 0.75vw. */
.control-page .sp-stage-img {
  object-position: 50% 70%;
  scale: 1.2;
  translate: -7.5% 0;
}
/* Live: the inline script in control.html sets scale/translate per scroll progress
   (scene A shows the whole panel, scene B the 1.5x crop); the image hangs from its top edge. */
.control-page .sp-stage.is-live .sp-stage-img { object-position: 50% 0; }
/* Scene B dim is 0.7 in Figma; sp-hero.js caps .sp-stage-dim at 0.4, so this layer adds
   the rest (1 - 0.6 * 0.5 = 0.7) and fades in with the headline. */
.control-page .cont-stage-copy::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 400vw;
  height: 400vh;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* style.css boxes every `section > *` into a 1440px shell with 40px gutters and gives
   sections 100px vertical padding; these sections size themselves to the Figma grid. */
.control-page section.cont-caps > .cont-caps-bg,
.control-page section.cont-list.sp-container > *,
.control-page .cont-details section.cont-detail > * {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
.control-page section.cont-caps > .cont-caps-bg { margin: 0; }
.control-page section.cont-caps > .cont-caps-inner {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  width: min(1600px, 100% - 2 * clamp(16px, 8.333vw, 160px));
}
.control-page section.cont-list,
.control-page section.cont-detail { padding-bottom: 0; }
.control-page .cont-details section.cont-detail > .cont-detail-top { max-width: 1440px; margin-left: 0; }

/* ---------- Shared section head ---------- */
.cont-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.cont-head .sp-eyebrow { font-size: clamp(15px, 1.042vw, 20px); }
.cont-title {
  font-weight: 600;
  font-size: clamp(30px, 2.917vw, 56px);
  line-height: 1.3;
  letter-spacing: -0.04em;
  color: #111;
  word-break: keep-all;
}
.cont-head-desc {
  margin-top: 4px;
  font-weight: 500;
  font-size: clamp(16px, 1.042vw, 20px);
  line-height: 1.6;
  letter-spacing: -0.03em;
  color: #333;
  word-break: keep-all;
}

/* ---------- Core Capabilities (1:6486) ---------- */
.cont-caps {
  position: relative;
  overflow: hidden;
  background: #03091a;
  padding: clamp(72px, 9.74vw, 187px) 0;
}
.cont-caps-bg {
  position: absolute;
  inset: 0;
}
.cont-caps-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1.2);
  transform-origin: 91% 44%;
}
.cont-caps-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}
.cont-caps-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 5.104vw, 98px);
}
.cont-caps .cont-title { color: #fff; }
.cont-caps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  list-style: none;
}
.cont-cap {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-height: clamp(280px, 18.594vw, 357px);
  padding: clamp(28px, 2.083vw, 40px);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
}
.cont-cap-en {
  font-family: var(--sp-font-en);
  font-weight: 500;
  font-size: clamp(14px, 0.833vw, 16px);
  line-height: 1.3;
  letter-spacing: -0.03em;
  color: var(--cont-navy);
}
.cont-cap-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.cont-cap-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
}
.cont-cap-icon img { width: auto; height: auto; }
.cont-cap h3 {
  font-weight: 600;
  font-size: clamp(24px, 1.771vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.04em;
  color: #111;
}
.cont-cap p:not(.cont-cap-en) {
  margin-top: 10px;
  font-size: clamp(15px, 0.9375vw, 18px);
  line-height: 1.4;
  letter-spacing: -0.03em;
  color: #666;
  word-break: keep-all;
}

/* ---------- Product tabs (1:6532) ---------- */
.cont-tabs {
  position: sticky;
  top: var(--sp-header-offset, 0px); /* sp-motion.js: drops below the header when it slides back in */
  z-index: 20;
  transition: top 0.35s ease;
  background: #fff;
  border-bottom: 1px solid #ddd;
}
.cont-tabs-inner {
  display: flex;
  gap: 0;
  width: min(1600px, 100% - 2 * clamp(16px, 8.333vw, 160px));
  margin-inline: auto;
  padding-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cont-tabs-inner::-webkit-scrollbar { display: none; }
.cont-tab {
  flex: 1 1 0;
  min-width: max-content; /* equal columns as in Figma 1:6532, never narrower than the label */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: -1px;
  padding: 14px 10px;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-size: clamp(16px, 1.042vw, 20px);
  line-height: 1.6;
  letter-spacing: -0.03em;
  color: #aaa;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.cont-tab:hover { color: #555; }
.cont-tab.is-active {
  border-bottom-color: var(--cont-navy);
  font-weight: 700;
  color: var(--cont-navy);
}

/* ---------- Product list (1:6533) ---------- */
.cont-list {
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 3.125vw, 60px);
  padding-top: clamp(64px, 5.99vw, 115px);
  scroll-margin-top: 80px;
}
.cont-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4.167vw, 80px);
}
.cont-card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: clamp(20px, 2.083vw, 40px) clamp(20px, 2.083vw, 40px) clamp(20px, 1.667vw, 32px);
  border: 1px solid transparent;
  border-radius: 16px;
  transition: border-color 0.25s;
}
.cont-card.is-active { border-color: var(--cont-navy); }
.cont-card-thumb {
  aspect-ratio: 680 / 400;
  border-radius: 8px;
  overflow: hidden;
  background: #aeaeae;
}
.cont-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Product shots far from the box ratio (e.g. a 3:1 cut-out) are shown whole, as in Figma */
.cont-card-thumb.is-contain,
.cont-gallery.is-contain { background: #fff; }
.cont-card-thumb img.is-contain,
.cont-gallery-slide.is-contain { object-fit: contain; }
.cont-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
}
.cont-card-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-inline: 10px;
}
.cont-card-name {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 6px;
  row-gap: 2px;
}
.cont-card-name span {
  font-weight: 600;
  font-size: clamp(24px, 1.875vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: #111;
}
.cont-card-name small {
  font-family: var(--sp-font-en);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -0.03em;
  color: #999;
}
.cont-card-text p {
  min-height: 2.8em;
  font-size: clamp(15px, 0.9375vw, 18px);
  line-height: 1.4;
  letter-spacing: -0.03em;
  color: #666;
  word-break: keep-all;
}
.cont-card-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-radius: 8px;
  background: #ebedf2;
  font-weight: 500;
  font-size: clamp(17px, 1.146vw, 22px);
  line-height: 1.3;
  letter-spacing: -0.03em;
  color: rgba(0, 0, 0, 0.6);
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s;
}
.cont-card.is-active .cont-card-more,
.cont-card-more:focus-visible {
  background: var(--cont-navy);
  color: #fff;
}
.cont-empty {
  grid-column: 1 / -1;
  padding: 60px 0;
  text-align: center;
  font-size: 18px;
  color: #666;
}

/* ---------- Product details (1:6563) ---------- */
.cont-details {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 6.25vw, 120px) 0 clamp(80px, 14.583vw, 280px);
}
.control-page .cont-glow {
  position: absolute;
  z-index: 0;
  width: clamp(600px, 65.1vw, 1250px);
  height: auto;
  max-width: none;
  pointer-events: none;
}
.cont-glow--a { top: 0; right: calc(-1 * clamp(300px, 26vw, 500px)); transform: rotate(60.93deg); }
.cont-glow--b { bottom: calc(-1 * clamp(200px, 20vw, 380px)); left: calc(-1 * clamp(100px, 10vw, 200px)); }
.cont-details-inner {
  position: relative;
  z-index: 1;
  width: var(--cont-wide);
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 6.25vw, 120px);
}
.cont-detail {
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 3.125vw, 60px);
  padding-top: clamp(64px, 6.25vw, 120px);
  border-top: 1px solid #ddd;
  scroll-margin-top: 60px;
}
.cont-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 700fr) minmax(0, 600fr);
  gap: clamp(32px, 7.292vw, 140px);
  align-items: start;
  max-width: 1440px; /* Figma: 700 gallery + 140 gap + 600 copy, left aligned in the 1520 row */
}
.cont-detail-top > .cont-detail-copy:only-child { grid-column: 1 / -1; }

/* Gallery (1:6568) */
.cont-gallery {
  position: relative;
  aspect-ratio: 700 / 467;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.cont-gallery-track,
.cont-gallery-slide {
  position: absolute;
  inset: 0;
}
.cont-gallery-slide {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s;
}
.cont-gallery-slide.is-active { opacity: 1; }
.cont-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.2s;
}
.cont-gallery-nav:hover { background: rgba(0, 0, 0, 0.4); }
.cont-gallery-nav img { width: 40px; height: 40px; }
.cont-gallery-nav.is-prev { left: 20px; }
.cont-gallery-nav.is-prev img { transform: scaleX(-1); }
.cont-gallery-nav.is-next { right: 20px; }
.cont-gallery-thumbs {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 1.146vw, 22px);
  z-index: 2;
  display: flex;
  gap: 14px;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
}
.cont-gallery-thumb {
  flex: 0 1 120px;
  width: 120px;
  aspect-ratio: 120 / 80;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
  background: #aeaeae;
  cursor: pointer;
}
.cont-gallery-thumb.is-active { border-color: var(--cont-navy); }
.cont-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Copy (1:6579) */
.cont-detail-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 3.125vw, 60px);
  max-width: 600px;
  padding-top: 14px;
}
.cont-detail-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cont-detail-title {
  font-weight: 600;
  font-size: clamp(30px, 2.292vw, 44px);
  line-height: 1.3;
  letter-spacing: -0.04em;
  color: #111;
  word-break: keep-all;
}
.cont-detail-lead {
  font-weight: 500;
  font-size: clamp(17px, 1.146vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.03em;
  color: #333;
  word-break: keep-all;
}
.cont-detail-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cont-detail-desc {
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.03em;
  color: #666;
  word-break: keep-all;
}
.cont-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.cont-chips li {
  padding: 4px 12px;
  border: 1px solid #eee;
  border-radius: 999px;
  background: #f5f6f9;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: -0.03em;
  color: #2c3c5e;
}

/* Spec table (1:6595) */
.cont-spec {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cont-spec-title {
  font-weight: 600;
  font-size: clamp(20px, 1.25vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: #333;
}
.cont-spec-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.cont-spec-table tr { border-bottom: 1px solid #fff; }
.cont-spec-table th,
.cont-spec-table td {
  padding: 18px 20px;
  font-size: clamp(14px, 0.833vw, 16px);
  line-height: 1.6;
  letter-spacing: -0.03em;
  text-align: left;
  vertical-align: middle;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.cont-spec-table th {
  width: 440px;
  background: #f8f8f8;
  font-weight: 500;
  color: #444;
}
.cont-spec-table td {
  border-bottom: 1px solid #f8f8f8;
  font-weight: 400;
  color: #666;
}

/* ---------- Contact Us (스위치 1:6206과 같은 형식) ---------- */
.control-page section.cont-contact {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0;
  color: #fff;
}
.control-page section.cont-contact > .cont-contact-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}
.cont-contact-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cont-contact-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}
.control-page section.cont-contact > .cont-contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(48px, 9.01vw, 173px);
  width: min(1440px, 100% - 2 * clamp(16px, 12.5vw, 240px));
  max-width: none;
  min-height: clamp(560px, 44.792vw, 860px);
  margin-inline: auto;
  padding: clamp(72px, 7.917vw, 152px) 0 clamp(56px, 4.792vw, 92px);
}
.cont-contact-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.control-page .cont-contact-title {
  font-family: var(--sp-font-en) !important;
  font-weight: 500;
  font-size: clamp(40px, 3.646vw, 70px);
  line-height: 1.3;
  letter-spacing: -0.03em;
  color: #fff;
}
.control-page .cont-contact-sub {
  color: #fff;
  font-weight: 500;
  font-size: clamp(16px, 1.146vw, 22px);
  line-height: 1.6;
  letter-spacing: -0.03em;
}
.cont-contact-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.083vw, 40px);
  width: 100%;
  margin-top: auto;
}
.cont-contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(24px, 1.771vw, 34px) clamp(16px, 1.25vw, 24px) clamp(28px, 2.083vw, 40px) clamp(20px, 2.083vw, 40px);
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
}
.cont-contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
.cont-contact-card--primary { background: var(--cont-navy); color: #fff; }
.cont-contact-card--ghost { background: #ebedf1; color: var(--cont-navy); }
.cont-contact-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cont-contact-icon {
  display: flex;
  align-items: center;
  width: 80px;
  height: 80px;
  margin-bottom: 6px;
}
.cont-contact-card--primary .cont-contact-icon img { width: 55px; height: auto; }
.cont-contact-card--ghost .cont-contact-icon img { width: 64px; height: 64px; margin-left: -2px; }
.cont-contact-text strong {
  font-weight: 600;
  font-size: clamp(22px, 1.458vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.04em;
}
.cont-contact-desc {
  min-height: 3.2em;
  font-size: clamp(14px, 0.833vw, 16px);
  line-height: 1.6;
  letter-spacing: -0.03em;
  word-break: keep-all;
}
.cont-contact-card--primary .cont-contact-desc { color: rgba(255, 255, 255, 0.8); }
.cont-contact-card--ghost .cont-contact-desc { color: rgba(0, 0, 0, 0.7); }
.cont-contact-chev {
  flex-shrink: 0;
  width: clamp(40px, 3.125vw, 60px);
  height: clamp(40px, 3.125vw, 60px);
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .cont-spec-table th { width: 32%; }
}
@media (max-width: 1024px) {
  .cont-caps-grid { grid-template-columns: 1fr; max-width: 640px; }
  .cont-cap { min-height: 0; }
  .cont-contact-cards { grid-template-columns: 1fr; }
  .cont-detail-top { grid-template-columns: 1fr; }
  .cont-detail-copy { max-width: none; padding-top: 0; }
  .cont-tab { flex: 0 0 auto; padding-inline: 16px; }
  /* scrollable strip runs edge to edge so tabs are not cut at the container gutter */
  .cont-tabs-inner { width: 100%; padding-inline: clamp(16px, 8.333vw, 160px); }
}
@media (max-width: 768px) {
  .cont-cards { grid-template-columns: 1fr; }
  .cont-cap br,
  .cont-stage-desc br { display: none; }
  .cont-spec-table th { width: 38%; }
  .cont-spec-table th,
  .cont-spec-table td { padding: 14px 12px; }
}
@media (max-width: 600px) {
  .cont-tabs-inner { gap: 4px; }
  .cont-tab { padding: 12px 10px; }
  .cont-gallery-nav { width: 40px; height: 40px; }
  .cont-gallery-nav img { width: 32px; height: 32px; }
  .cont-gallery-nav.is-prev { left: 10px; }
  .cont-gallery-nav.is-next { right: 10px; }
  .cont-gallery-thumbs { gap: 6px; }
  .cont-gallery-thumb { width: 56px; flex-basis: 56px; }
  .cont-spec-table,
  .cont-spec-table tbody,
  .cont-spec-table tr,
  .cont-spec-table th,
  .cont-spec-table td { display: block; width: 100%; }
  .cont-spec-table th { padding-bottom: 8px; }
  .cont-spec-table td { padding-top: 10px; }
  .cont-contact-icon { width: 56px; height: 56px; }
  .cont-contact-icon img { transform: scale(0.8); transform-origin: left center; }
}
@media (prefers-reduced-motion: reduce) {
  .cont-gallery-slide,
  .cont-card,
  .cont-card-more,
  .cont-contact-card { transition: none; }
}
