/* 라이트만 지원 선언 (UA 자동 다크 방지용) */
:root { color-scheme: light only; }

/* OS가 다크여도 우리 페이지는 라이트 유지 */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: light only !important; }

  /* 핵심 영역은 확실한 라이트 배경으로 고정 */
  html, body { background:#ffffff !important; color:#111 !important; }

  /* 네 사이트 구조에 맞춰 추가: 반투명/블러가 있으면 어둡게 보여서 라이트 고정 */
  header, .global-header, .global-nav, .site-nav,
  .hero, .hero-overlay, .cd-pricing-hero,
  .cd-card, .cd-result {
    background:#ffffff !important;
    /* 혹시 배경에 반투명/그라데이션을 쓰면 여기서 라이트 값으로 재정의 */
  }

  /* 자동 다크가 이미지/비디오에 필터를 먹일 때 해제 */
  html { filter: none !important; }
  img, picture, video, canvas { filter: none !important; }
}


:root {
  --cd-blue: #0066f5;
  --cd-dark: #000749;
  --cd-text: #282a29;
  --cd-border: #e9e9ee;
  --cd-bg: rgba(255, 255, 255, 0.85);
}

/* 헤더 기본 */
.cd-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: var(--cd-bg);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--cd-border);
  transition: padding 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
}
.cd-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  transition: padding 0.18s ease;
}

/* 마우스 오버 확장 */
.cd-header.is-expanded .cd-container {
  padding-top: 26px;
  padding-bottom: 26px;
}
.cd-header.is-expanded {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

/* 멀티라인 대응 */
.cd-header:has(.nav-link br) .cd-container,
.cd-header:has(.nav-link.multiline) .cd-container {
  padding-top: 34px;
  padding-bottom: 34px;
}

/* 로고 */
.cd-logo-img {
  display: block;
  height: clamp(36px, 5vw, 60px);
  width: auto;
}

/* 네비게이션 */
.cd-nav {
  margin-left: auto;
}

/* 작은 화면에서는 margin 제거 + 가운데 정렬 */
@media (max-width: 768px) {
  .cd-nav {
    margin-left: 0;
    width: 100%;
    justify-content: center; /* flex라면 가운데 */
  }
}

/* 햄버거 버튼 제거 */
.cd-menu-toggle {
  display: none !important;
}

.cd-nav-list {
  display: flex;
  gap: 28px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 화면 줄어들면 gap 축소 */
@media (max-width: 1199px) {
  .cd-nav-list {
    gap: 20px;
  }
  .cd-logo-img {
    height: 70px;
  }
}
@media (max-width: 991px) {
  .cd-nav-list {
    gap: 14px;
  }
  .cd-logo-img {
    height: 70px;
  }
}

/* 네비 링크 */
.nav-link {
  display: inline-block;
  padding: 8px 8px;
  border-radius: 10px;
  font-family: "Arita Dotum";
  font-size: 14px;
  font-weight: 500;
  color: #282a29;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  min-width: 64px;
}
.nav-link:hover {
  background: #f6f8ff;
  color: var(--cd-blue);
  font-weight: 600;
}

/* 줄바꿈 허용 */
.nav-link:has(br),
.nav-link.multiline {
  white-space: normal;
  line-height: 1.12;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* 활성화 */
.nav-item.is-active .nav-link {
  color: var(--cd-blue);
  font-weight: 700;
}

/* 가격 버튼 */
.nav-link.primary {
  font-family: "ArialDotum";
  font-size: clamp(9px, 1.1vw, 14px);
  font-weight: 600;
  background: var(--cd-blue);
  color: #fff;
  border: 1px solid var(--cd-blue);
  border-radius: 999px;
  padding: clamp(8px, 0.9vw, 10px) 0;
  width: clamp(140px, 14vw, 180px);
  text-align: center;
}
.nav-link.primary:hover {
  background: #fff;
  color: var(--cd-blue);
  border-color: var(--cd-blue);
}

/* ===== 모바일 (<=768px): 태블릿과 같은 상단 로고|버튼 + 하단 3x2 그리드 ===== */
@media (max-width: 768px) {
  .cd-container {
    position: relative;
    flex-wrap: wrap;
    align-items: center;
  }
  .cd-logo-img {
    height: 60px;
  }

  /* 상단 우측 버튼 고정 (그리드에서 제외) */
  .cd-nav-list .nav-item:last-child {
    display: contents;
  }
  .cd-nav-list .nav-item:last-child .nav-link.primary {
    position: absolute;
    right: 16px;
    top: 30px;
    width: clamp(150px, 40vw, 220px);
    font-size: clamp(13px, 3.8vw, 16px);
    padding: 10px 0;
  }

  /* 카테고리 3x2 */
  .cd-nav {
    width: 100%;
    order: 2;
  }
  .cd-nav-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 24px;
    justify-items: center;
    padding-top: 12px;
    width: 100%;
  }

  .nav-link {
    font-size: 13px;
    padding: 6px 8px;
    min-width: auto;
  }
}

/* ===== 태블릿 ~ 좁은 PC (769px~1100px): 동일한 상단/그리드 레이아웃 ===== */
@media (min-width: 769px) and (max-width: 1100px) {
  .cd-container {
    position: relative;
    flex-wrap: wrap;
  }
  .cd-nav {
    width: 100%;
    order: 2;
  }
  .cd-nav-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 48px;
    justify-items: center;
    padding-top: 16px;
  }
  /* 버튼을 그리드에서 제외하고 우상단 고정 */
  .cd-nav-list .nav-item:last-child {
    display: contents;
  }
  .cd-nav-list .nav-item:last-child .nav-link.primary {
    position: absolute;
    right: 16px;
    top: 30px;
    width: clamp(180px, 22vw, 280px);
    font-size: clamp(14px, 1.6vw, 20px);
    padding: clamp(10px, 1.2vw, 14px) 0;
  }
  .cd-logo-img {
    height: clamp(48px, 7vw, 80px);
  }
}

/* 헤더 여백 */
body {
  padding-top: 90px;
}




/* 전체 레이아웃에서 가로 스크롤 방지 */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}


/* === 370px 이하 헤더 전용 최적화 === */
@media (max-width: 370px) {
  
  /* 헤더 배경/패딩 살짝 압축 */
  .cd-header { backdrop-filter: saturate(180%) blur(8px); }
  .cd-container {
    padding: 12px 12px;
    gap: 12px;
    
  }

  /* 마우스 오버 확장치도 축소 */
  .cd-header.is-expanded .cd-container {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  /* 멀티라인 패딩 보정(작게) */
  .cd-header:has(.nav-link br) .cd-container,
  .cd-header:has(.nav-link.multiline) .cd-container {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  /* 로고 축소 */
  .cd-logo-img {
    height: 44px;   /* 기존 60~70px → 48px */
    margin-top: 4px;
  }

  /* 카테고리 그리드(3x2 유지, 간격만 압축) */
  .cd-nav { width: 100%; }
  .cd-nav-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 14px;
    padding-top: 8px;
    justify-items: center;
  }

  /* 네비 링크 타이포/패딩 축소 */
  .nav-link {
    font-size: 12px;
    padding: 6px 6px;
    min-width: auto;
  }

  /* 상단 우측 가격 버튼(긴 문구 그대로, 2줄 허용) */
  .cd-nav-list .nav-item:last-child .nav-link.primary {
    right: 16px;            /* 기존 16px → 12px */
    top: 22px;              /* 기존 30px → 22px */
    width: min(64vw, 120px);/* 너무 길면 폭을 화면의 64%로 제한 */
    font-size: 13px;        /* 글자 살짝 축소 */
    padding: 8px 0;
    line-height: 1.15;
    word-break: keep-all;   /* 한국어 단어 단위 유지 */
    text-align: center;
  }

  /* 본문이 헤더에 가려지지 않도록 상단 여백도 축소 */
  body { padding-top: 72px; } /* 기존 90px → 72px */
}


