:root {
  --menu-navy: #071b2e;
  --menu-blue: #0879bd;
  --menu-ink: #14202b;
  --menu-line: rgba(12, 30, 44, 0.08);
  --header-side: clamp(24px, 4vw, 80px);
}

/* 햄버거 전체 메뉴 */
.all-menu {
  position: fixed;
  z-index: 200;
  inset: 0;
  overflow-y: auto;
  color: #fff;
  background: radial-gradient(circle at 78% 28%, rgba(16,115,181,.3), transparent 34%), linear-gradient(120deg, #061727 0%, #082b49 52%, #03111e 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.all-menu.open { opacity: 1; visibility: visible; pointer-events: auto; }
.all-menu::before {
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 90px 90px;
  content: "";
  pointer-events: none;
}
.all-menu-header {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 48px));
  height: 96px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.all-menu-header img {
  display: block;
  width: 188px;
  height: auto;
  filter: grayscale(1) brightness(0) invert(1);
  opacity: .82;
}
.all-menu-close {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #071b2e;
  background: #fff;
  cursor: pointer;
}
.all-menu-close span {
  position: absolute;
  top: 27px;
  left: 15px;
  width: 26px;
  height: 3px;
  display: block;
  background: currentColor;
}
.all-menu-close span:first-child { transform: rotate(45deg); }
.all-menu-close span:last-child { transform: rotate(-45deg); }
.all-menu-content {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 48px));
  margin: 70px auto 80px;
}
.all-menu-item { position: relative; width: 430px; min-height: 100px; }
.all-menu-title {
  display: inline-block;
  color: rgba(255,255,255,.56);
  font-size: clamp(38px, 3.4vw, 58px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -2px;
  text-decoration: none;
  transition: color .15s ease;
}
.all-menu-item:hover .all-menu-title,
.all-menu-item:focus-within .all-menu-title { color: #159be8; }
.all-menu-submenu {
  position: absolute;
  top: 9px;
  left: 430px;
  min-width: 300px;
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.all-menu-item:hover .all-menu-submenu,
.all-menu-item:focus-within .all-menu-submenu { opacity: 1; visibility: visible; pointer-events: auto; }
.all-menu-submenu li + li { margin-top: 18px; }
.all-menu-submenu a { color: rgba(255,255,255,.82); font-size: 18px; font-weight: 600; text-decoration: none; }
.all-menu-submenu a:hover,
.all-menu-submenu a:focus-visible { color: #38b2f7; }

@media (max-width: 860px) {
  .all-menu-header, .all-menu-content { width: calc(100% - 40px); }
  .all-menu-header { height: 74px; }
  .all-menu-header img { width: 155px; }
  .all-menu-close { width: 50px; height: 50px; }
  .all-menu-close span { top: 24px; left: 13px; width: 24px; }
  .all-menu-content { margin-top: 45px; }
  .all-menu-item { width: 100%; min-height: auto; border-bottom: 1px solid rgba(255,255,255,.12); }
  .all-menu-title { padding: 18px 0; font-size: 32px; }
  .all-menu-submenu { position: static; min-width: 0; max-height: 0; padding-left: 15px; overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none; }
  .all-menu-item:hover .all-menu-submenu,
  .all-menu-item:focus-within .all-menu-submenu { max-height: 0; padding-bottom: 0; opacity: 0; visibility: hidden; pointer-events: none; }
  .all-menu-item:hover .all-menu-title,
  .all-menu-item:focus-within .all-menu-title { color: rgba(255,255,255,.56); }
  .all-menu-item.submenu-open .all-menu-title { color: #159be8; }
  .all-menu-item.submenu-open .all-menu-submenu { max-height: 330px; padding-bottom: 22px; opacity: 1; visibility: visible; pointer-events: auto; }
  .all-menu-submenu a { font-size: 16px; }
}

.header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 96px;
  padding: 0 var(--header-side);
  display: flex;
  align-items: center;
  color: #fff;
  transform: none;
  box-sizing: border-box;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.brand {
  flex: 0 0 auto;
  margin-right: 46px;
  display: flex;
  align-items: center;
}

.brand img {
  display: block;
  width: 188px;
  height: auto;
  filter: brightness(0) invert(1);
}

.nav {
  display: flex;
  align-items: center;
  gap: 50px;
}

@media (min-width: 1101px) {
  .nav {
    margin-left: -40px;
    display: grid;
    grid-template-columns: repeat(5, 128px);
    gap: 0;
  }

  .nav a {
    width: 100%;
    text-align: center;
  }
}

.nav a {
  position: relative;
  padding: 38px 0;
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.nav a::after {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--menu-blue);
  content: "";
  transition: width 0.2s ease;
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a.active::after {
  width: 100%;
}

.menu-toggle {
  position: fixed;
  z-index: 4;
  top: 20px;
  right: var(--header-side);
  width: 56px;
  height: 56px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.phone-button {
  position: fixed;
  z-index: 4;
  top: 20px;
  right: calc(var(--header-side) + 72px);
  width: 56px;
  height: 56px;
  padding: 16px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.phone-button svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
}

/* 전화 문의 팝업 */
body.contact-modal-open { overflow: hidden; }
.contact-modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease; }
.contact-modal.open { opacity: 1; visibility: visible; }
.contact-modal-backdrop { position: absolute; inset: 0; background: rgba(5, 17, 27, .74); backdrop-filter: blur(3px); }
.contact-modal-dialog { position: relative; width: min(580px, 100%); max-height: calc(100vh - 30px); padding: 52px 40px 38px; overflow-x: hidden; overflow-y: auto; border-radius: 10px; background: #fff; box-shadow: 0 28px 80px rgba(0, 18, 32, .32); color: #14202b; transform: translateY(12px); transition: transform .22s ease; }
.contact-modal.open .contact-modal-dialog { transform: translateY(0); }
.contact-modal-dialog::before { position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: linear-gradient(90deg, #075f99, #1595d2); content: ''; }
.contact-modal-close { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f2f5f7; cursor: pointer; }
.contact-modal-close span { position: absolute; left: 11px; top: 18px; width: 16px; height: 2px; background: #6d7982; transform: rotate(45deg); }
.contact-modal-close span + span { transform: rotate(-45deg); }
.contact-modal-eyebrow { margin: 0 0 8px; color: #0879bd; font-size: 11px; font-weight: 800; letter-spacing: 2px; text-align: center; }
.contact-modal-dialog h2 { margin: 0; font-size: 28px; line-height: 1.35; letter-spacing: -1.4px; text-align: center; }
.contact-modal-line { width: 54px; height: 2px; margin: 18px auto 30px; display: block; background: #0879bd; }
.contact-phone-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-phone { min-width: 0; padding: 18px 12px; display: flex; align-items: center; flex-direction: column; border: 1px solid #d8e6ee; border-radius: 7px; background: #f4f9fc; text-decoration: none; }
.contact-phone.is-primary { border-color: #b9daed; background: #eaf6fc; }
.contact-phone span { color: #4e5c66; font-size: 14px; font-weight: 700; }.contact-phone strong { margin-top: 4px; color: #076daf; font-size: 22px; letter-spacing: 0; }.contact-phone small { margin-top: 5px; color: #87939b; font-size: 11px; }
.contact-service-columns { margin: 24px 0 27px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 15px; }
.contact-services { margin: 0; padding: 0 12px; list-style: none; }
.contact-services li { position: relative; padding: 7px 0 7px 38px; color: #5e6a73; font-size: 15px; }.contact-services li::before { position: absolute; left: 7px; top: 13px; width: 8px; height: 4px; border-left: 2px solid #0879bd; border-bottom: 2px solid #0879bd; content: ''; transform: rotate(-45deg); }.contact-services li span { margin-right: 9px; color: #9ba5ac; font-size: 11px; font-weight: 700; }
.contact-email { padding-top: 22px; display: flex; align-items: center; justify-content: center; gap: 15px 28px; border-top: 1px solid #e1e6e9; font-size: 14px; }.contact-email > div { display: flex; align-items: center; gap: 9px; }.contact-email span { color: #59656e; font-weight: 700; }.contact-email a, .contact-email strong { color: #0879bd; font-weight: 800; text-decoration: none; }

@media (max-width: 560px) {
  .contact-modal { padding: 15px; }.contact-modal-dialog { padding: 47px 22px 28px; }.contact-modal-dialog h2 { font-size: 25px; }.contact-phone-grid, .contact-service-columns { grid-template-columns: 1fr; }.contact-service-columns { row-gap: 0; }.contact-phone strong { font-size: 21px; }.contact-services { padding: 0; }.contact-services li { font-size: 14px; }.contact-email { align-items: flex-start; flex-direction: column; gap: 8px; }.contact-email > div { width: 100%; justify-content: space-between; }
}

/* 상단 메뉴에 마우스를 올렸을 때 */
.header:hover,
.header:focus-within {
  color: var(--menu-ink);
  background: #fff;
  border-bottom: 1px solid #d9dde1;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.header:hover .brand img,
.header:focus-within .brand img {
  filter: none;
}

.header:hover .menu-toggle,
.header:focus-within .menu-toggle {
  right: var(--header-side);
  color: #111;
  /*background: #fff;*/
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: currentColor;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.menu-toggle.active span:first-child {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:last-child {
  transform: translateY(-9px) rotate(-45deg);
}

/* 스크롤 후 전체 너비의 흰색 헤더 */
.header.scrolled {
  top: 0;
  left: 0;
  width: 100%;
  height: 96px;
  padding: 0 var(--header-side);
  border-bottom: 1px solid var(--menu-line);
  color: var(--menu-ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  transform: none;
  backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.header.scrolled .brand img {
  filter: none;
}

.header.scrolled .menu-toggle {
  top: 20px;
  right: var(--header-side);
  color: #111;
  /*background: #fff;*/
}

.header.scrolled .phone-button {
  color: var(--menu-ink);
}

/* PC 전체 하위 메뉴 */
.mega-menu {
  position: absolute;
  z-index: 1;
  top: 96px;
  left: 0;
  width: 100%;
  color: var(--menu-ink);
  background: #fff;
  border-top: 1px solid #e1e4e7;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.nav:hover ~ .mega-menu,
.nav:focus-within ~ .mega-menu,
.mega-menu:hover,
.mega-menu:focus-within,
.header.mega-menu-open .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mega-menu-inner {
  width: 100%;
  min-height: 230px;
  margin: 0;
  position: relative;
}

.mega-column {
  position: absolute;
  top: 0;
  width: 128px;
  padding: 28px 0 32px;
  text-align: center;
}

.mega-column:nth-child(1) { left: calc(var(--header-side) + 194px); }
.mega-column:nth-child(2) { left: calc(var(--header-side) + 322px); }
.mega-column:nth-child(3) { left: calc(var(--header-side) + 450px); }
.mega-column:nth-child(4) { left: calc(var(--header-side) + 578px); }
.mega-column:nth-child(5) { left: calc(var(--header-side) + 706px); }

.mega-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mega-column li + li {
  margin-top: 15px;
}

.mega-column li a {
  color: #68737e;
  font-size: 14px;
  text-decoration: none;
}

.mega-column li a:hover,
.mega-column li a:focus-visible {
  color: var(--menu-blue);
}

/* 햄버거 버튼으로 열리는 전체 메뉴 */
.nav.open {
  position: fixed;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  margin: 0;
  color: #fff;
  background: rgba(4, 20, 34, 0.98);
}

.nav.open a {
  padding: 10px;
  font-size: clamp(26px, 3vw, 44px);
}

.nav.open a::after {
  display: none;
}

@media (max-width: 1100px) {
  .header {
    width: 100%;
    padding-right: 92px;
  }

  .nav {
    gap: 18px;
  }
}

@media (max-width: 860px) {
  .header,
  .header.scrolled {
    top: 0;
    left: 0;
    width: 100%;
    height: 74px;
    padding: 0 20px;
    border-radius: 0;
    transform: none;
  }

  .brand {
    margin-right: auto;
  }

  .brand img {
    width: 155px;
  }

  .nav {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    margin: 0;
    color: #fff;
    background: var(--menu-navy);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav.open {
    opacity: 1;
    visibility: visible;
  }

  .mega-menu {
    display: none;
  }

  .nav a,
  .nav.open a {
    padding: 9px;
    font-size: 25px;
  }

  .menu-toggle,
  .header.scrolled .menu-toggle {
    top: 9px;
    right: 18px;
  }

  .phone-button,
  .header.scrolled .phone-button {
    top: 9px;
    right: 78px;
    width: 50px;
    height: 50px;
    padding: 14px;
  }
}
