/* ============ Service switch bar (소셜러스 서비스군 전환) ============ */
.service-switch {
  /* 메인앱(Socialerus25Ex) .header_top과 동일한 배경색 (wwwroot/css/FromSocialerus5/common_kr.css) */
  background: #583bd4;
}

.service-switch .container-xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  gap: var(--space-3);
  /* 여기에 overflow를 걸면 언어 드롭다운이 40px 바 안에 갇혀 잘리고 스크롤바가 생긴다.
     좁은 화면의 가로 넘침은 .service-switch-links에서만 처리한다. */
}

.service-switch-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.service-switch-links::-webkit-scrollbar { display: none; }

.service-switch-links a {
  color: var(--color-white);
  font-size: var(--fs-xs);
  white-space: nowrap;
  text-decoration: none;
}

.service-switch-links a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

.service-switch-links a:not(:first-child)::before {
  content: "|";
  display: inline-block;
  margin-right: var(--space-2);
  color: var(--color-white);
}

.service-switch .lang-switcher {
  flex: 0 0 auto;
}

/* ============ Header / GNB ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--color-dark);
  display: flex;
  align-items: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.site-header .container-xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  max-width: var(--container-max);
}

.brand-logo img {
  height: 26px;
  width: auto;
}

.gnb {
  display: flex;
  align-items: center;
}

.gnb-list,
.gnb-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gnb-list {
  display: flex;
  align-items: center;
  gap: var(--space-7);
}

.gnb-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.82);
  font-weight: 600;
  font-size: var(--fs-body);
  white-space: nowrap;
  text-decoration: none;
}

.gnb-link:hover,
.gnb-link.active {
  color: var(--color-white);
}

.gnb-link.active {
  position: relative;
}

.gnb-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--color-primary);
}

/* 데스크톱 전용: 아이콘·드로어 머리/꼬리·하위 메뉴 토글 버튼은 숨김 */
.gnb-ico,
.gnb-drawer-head,
.gnb-drawer-foot,
.gnb-sub-toggle {
  display: none;
}

.gnb-caret {
  font-size: 11px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

/* ---- 데스크톱 드롭다운 (쇼츠 자동 생성 하위) ---- */
@media (min-width: 992px) {
  .gnb-has-sub {
    position: relative;
  }

  /* 링크와 패널 사이 빈 공간에서 hover가 끊기지 않도록 다리 역할 */
  .gnb-has-sub::before {
    content: "";
    position: absolute;
    left: -16px; right: -16px; top: 100%;
    height: 28px;
  }

  .gnb-sub {
    position: absolute;
    top: calc(100% + 24px);
    left: 50%;
    width: 320px;
    padding: 8px;
    background: var(--color-white);
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(15,15,30,0.22), 0 0 0 1px rgba(15,15,30,0.05);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 1100;
  }

  .gnb-has-sub:hover .gnb-sub,
  .gnb-has-sub:focus-within .gnb-sub {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  .gnb-has-sub:hover .gnb-caret,
  .gnb-has-sub:focus-within .gnb-caret {
    transform: rotate(180deg);
  }

  .gnb-sub a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--color-dark);
    text-decoration: none;
    transition: background 0.15s ease;
  }

  .gnb-sub a > i {
    flex: 0 0 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--color-primary-50);
    color: var(--color-primary);
    font-size: 18px;
  }

  .gnb-sub a span { display: flex; flex-direction: column; line-height: 1.35; }
  .gnb-sub a b { font-size: 15px; font-weight: 700; }
  .gnb-sub a small { font-size: 12.5px; color: var(--color-gray-500, #8a8a96); }

  .gnb-sub a:hover { background: var(--color-gray-100, #f4f4f6); }
  .gnb-sub a.active { background: var(--color-primary-50); }
  .gnb-sub a.active b { color: var(--color-primary); }
}

/* 992~1199px: 메뉴 5개 + 신청 버튼이 한 줄에 들어가도록 간격·글자 크기를 줄인다 (일본어 메뉴명이 더 길다) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .gnb-list { gap: var(--space-5); }
  .gnb-link { font-size: 15px; }
}

.btn.header-cta-desktop.is-current {
  box-shadow: 0 0 0 3px rgba(5,110,204,0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.lang-switcher {
  position: relative;
}

.lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--color-white);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}

.lang-switcher-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 140px;
  padding: var(--space-2);
  display: none;
  z-index: 1100;
}

.lang-switcher.is-open .lang-switcher-menu { display: block; }

.lang-switcher-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-dark);
  font-weight: 500;
  font-size: var(--fs-small);
}

.lang-switcher-menu a:hover { background: var(--color-gray-100); }
.lang-switcher-menu a.active { color: var(--color-primary); font-weight: 700; }

.gnb-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.gnb-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.gnb-overlay {
  display: none;
}

/* ============ Mobile GNB (풀하이트 드로어) ============ */
@media (max-width: 991.98px) {
  .gnb-toggle { display: flex; order: 3; }
  .header-actions { order: 2; margin-left: auto; }
  .site-header .container-xl { gap: var(--space-3); }

  /* 모바일 헤더에는 작은 '신청' 알약 버튼만 노출 (ko만) */
  .btn.header-cta-desktop:not(.header-cta-mobile) { display: none; }
  .btn.header-cta-desktop {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-pill);
  }

  .gnb-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .gnb-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .gnb-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .gnb {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(100vw, 420px);
    flex-direction: column;
    align-items: stretch;
    padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
      radial-gradient(120% 60% at 100% 0%, rgba(5,110,204,0.28) 0%, rgba(5,110,204,0) 60%),
      radial-gradient(90% 50% at 0% 100%, rgba(88,59,212,0.26) 0%, rgba(88,59,212,0) 65%),
      #131218;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.45s;
    z-index: 1050;
    box-shadow: -24px 0 60px rgba(0,0,0,0.35);
  }

  .gnb.is-open { transform: translateX(0); visibility: visible; }

  /* 드로어 머리 */
  .gnb-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 10px;
  }

  .gnb-drawer-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: rgba(255,255,255,0.45);
  }

  .gnb-close {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--color-white);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.3s ease;
  }

  .gnb-close:hover { background: rgba(255,255,255,0.12); }
  .gnb.is-open .gnb-close { transform: rotate(90deg); }

  /* 메뉴 목록 + 순차 등장 */
  .gnb-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .gnb-list > li {
    position: relative;
    opacity: 0;
    transform: translateX(28px);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .gnb.is-open .gnb-list > li {
    opacity: 1;
    transform: none;
    transition-delay: calc(var(--i, 0) * 55ms + 120ms);
  }

  .gnb-link {
    display: flex;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: rgba(255,255,255,0.9);
    transition: background 0.15s ease;
  }

  .gnb-link:hover { background: rgba(255,255,255,0.05); }
  .gnb-link.active::after { display: none; }

  .gnb-link.active {
    background: linear-gradient(135deg, rgba(5,110,204,0.26), rgba(88,59,212,0.14));
    border-color: rgba(90,160,255,0.28);
    color: var(--color-white);
  }

  .gnb-ico {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.07);
    font-size: 18px;
    color: rgba(255,255,255,0.85);
  }

  .gnb-link.active .gnb-ico {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 6px 16px rgba(5,110,204,0.45);
  }

  /* 하위 메뉴(아코디언) */
  .gnb-caret { display: none; }
  .gnb-has-sub > .gnb-link { padding-right: 56px; }

  .gnb-sub-toggle {
    display: grid;
    place-items: center;
    position: absolute;
    top: 7px;
    right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
  }

  .gnb-sub-toggle i { transition: transform 0.3s ease; }
  .gnb-has-sub.is-expanded .gnb-sub-toggle i { transform: rotate(180deg); }

  .gnb-sub {
    max-height: 0;
    overflow: hidden;
    margin-left: 33px;
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,0.1);
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), margin 0.3s ease;
  }

  .gnb-has-sub.is-expanded .gnb-sub {
    max-height: 420px;
    margin-top: 6px;
    margin-bottom: 6px;
  }

  .gnb-sub a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 12px;
    color: rgba(255,255,255,0.72);
    text-decoration: none;
  }

  .gnb-sub a > i { font-size: 17px; width: 20px; text-align: center; opacity: 0.8; }
  .gnb-sub a span { display: flex; flex-direction: column; line-height: 1.35; }
  .gnb-sub a b { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.88); }
  .gnb-sub a small { font-size: 12px; color: rgba(255,255,255,0.45); }
  .gnb-sub a:hover { background: rgba(255,255,255,0.05); }
  .gnb-sub a.active { background: rgba(5,110,204,0.18); }
  .gnb-sub a.active b,
  .gnb-sub a.active > i { color: #7fbaff; opacity: 1; }

  /* 드로어 꼬리: CTA + 언어 */
  .gnb-drawer-foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .gnb.is-open .gnb-drawer-foot {
    opacity: 1;
    transform: none;
    transition-delay: 0.42s;
  }

  .gnb-cta-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(120deg, var(--color-primary) 0%, #583bd4 100%);
    color: var(--color-white);
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(5,110,204,0.35);
  }

  .gnb-cta-primary span { display: flex; flex-direction: column; line-height: 1.35; }
  .gnb-cta-primary b { font-size: 17px; font-weight: 800; }
  .gnb-cta-primary small { font-size: 12.5px; opacity: 0.82; }

  .gnb-cta-primary > i {
    flex: 0 0 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    font-size: 17px;
  }

  .gnb-cta-primary:hover { color: var(--color-white); filter: brightness(1.06); }

  .gnb-cta-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.88);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
  }

  .gnb-cta-secondary .bi-box-arrow-up-right { font-size: 12px; opacity: 0.6; }
  .gnb-cta-secondary:hover { color: var(--color-white); background: rgba(255,255,255,0.08); }

  .gnb-drawer-lang {
    display: flex;
    gap: 4px;
    align-self: center;
    margin-top: 6px;
    padding: 4px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.06);
  }

  .gnb-drawer-lang a {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
  }

  .gnb-drawer-lang a.active { background: var(--color-white); color: var(--color-dark); }

  .gnb-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10,10,16,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 1040;
  }

  .gnb-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  html.gnb-locked,
  html.gnb-locked body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .gnb, .gnb-list > li, .gnb-drawer-foot, .gnb-sub { transition: none !important; }
}

/* ============ Footer ============ */
.site-footer {
  background: var(--color-dark);
  color: rgba(255,255,255,0.6);
  padding: var(--space-10) 0 var(--space-6);
  font-size: var(--fs-small);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
}

.footer-logo img { height: 22px; margin-bottom: var(--space-4); }

.footer-nav {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.footer-nav h6 {
  color: var(--color-white);
  font-size: var(--fs-small);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.footer-nav ul { list-style: none; padding: 0; margin: 0; }
.footer-nav li { margin-bottom: var(--space-2); }
.footer-nav a { color: rgba(255,255,255,0.6); }
.footer-nav a:hover { color: var(--color-white); }

.footer-meta {
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-meta address {
  font-style: normal;
  line-height: 1.9;
}

.footer-styleguide-link {
  color: rgba(255,255,255,0.35);
  font-size: var(--fs-xs);
}

.footer-styleguide-link:hover { color: rgba(255,255,255,0.7); }

@media (max-width: 767.98px) {
  .footer-top { flex-direction: column; gap: var(--space-6); }
  .footer-meta { flex-direction: column; align-items: flex-start; }
}
