/* ===== Base ===== */
:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --chip: #f3f4f6;
  --chipOn: #111827;
  --chipOnText: #ffffff;
  --btn: #111827;
  --btnText: #ffffff;
  --radius: 14px;

  --primary: #1d2088;       /* 보람상조 남색 */
  --primary-dark: #0f135e;
  --accent: #d32f2f;        /* 강조 빨강 */
  --kakao: #fee500;         /* 카카오 노랑 */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(17,24,39,.2);
  outline-offset: 2px;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* ===== Global Header + Pure CSS Navigation ===== */
.global-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 2000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.global-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
}

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

/* 체크박스 숨김 */
.menu-checkbox {
  display: none;
}

/* 햄버거 아이콘 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  z-index: 10;
}

.menu-toggle span {
  width: 26px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.35s ease;
}

/* 체크 시 X 모양 변환 */
#menu-toggle:checked ~ .menu-toggle span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
#menu-toggle:checked ~ .menu-toggle span:nth-child(2) {
  opacity: 0;
}
#menu-toggle:checked ~ .menu-toggle span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* 네비게이션 기본 상태 */
.main-nav {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

/* 데스크톱 (992px 이상) */
@media (min-width: 993px) {
  .menu-toggle { display: none; }
  .main-nav {
    width: auto;
    max-height: none;
    overflow: visible;
  }
  .nav-list {
    flex-direction: row;
    gap: 32px;
    align-items: center;
    padding: 0;
  }
  .nav-cta {
    margin-top: 0;
    width: auto;
  }
  .nav-link {
    padding: 10px 4px;
  }
  .nav-link.is-active::after {
    bottom: -6px;
    left: 0;
    width: 100%;
  }
}

/* 모바일 (992px 이하) */
@media (max-width: 992px) {
  .menu-toggle { display: flex; }
  #menu-toggle:checked ~ .main-nav {
    max-height: 500px;  /* 메뉴 항목 많으면 600~800px로 늘려도 됨 */
  }
  .nav-list {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
  }
  .nav-cta {
    margin-top: 8px;
    width: 100%;
    text-align: center;
  }
  .nav-link {
    padding: 8px 12px;
  }
  .nav-link.is-active::after {
    left: 12px;
    width: calc(100% - 24px);
  }
}

/* 공통 네비 스타일 */
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link.is-active {
  color: var(--accent);
  font-weight: 700;
}

.nav-link.is-active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* 카카오 상담 버튼 */
.btn-consult {
  background: var(--kakao);
  color: #3b1e1e;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.25s ease;
  white-space: nowrap;
  display: inline-block;
}

.btn-consult:hover {
  background: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* ===== Top / Tabs ===== */
.top {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 20;
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  flex-wrap: wrap;
}

.plan-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
}

.tab.is-active {
  background: var(--chipOn);
  border-color: var(--chipOn);
  color: var(--chipOnText);
}

/* Search */
.search {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input {
  height: 38px;
  width: min(360px, 60vw);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  font-size: 14px;
}

.search-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

/* ===== Content / Meta ===== */
.content { padding-top: 16px; }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 12px;
}

.count {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  font-size: 14px;
  border: 1px solid transparent;
}

.chip.is-active {
  background: var(--chipOn);
  color: var(--chipOnText);
}

/* ===== List / Cards ===== */
.list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.thumb {
  flex: 0 0 108px;
  height: 108px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fafafa;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btnText);
  font-size: 14px;
  white-space: nowrap;
}

/* ===== Pager ===== */
.pager {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}

.page-num {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}

.page-num.is-active {
  background: var(--chipOn);
  border-color: var(--chipOn);
  color: var(--chipOnText);
}

/* ===== Footer ===== */
.footer {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* ===== Hero ===== */
.plan-hero {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.plan-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
}

.hero-media {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Pricing ===== */
.plan-pricing {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.plan-pricing-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px 18px;
}

.price-box { display: none; }
.price-box.is-active { display: block; }

.price-title {
  font-size: 16px;
  font-weight: 700;
  margin: 6px 0 10px;
}

.price-table {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.price-table .row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
}

.price-table .row.head {
  background: #f5f6f8;
  font-weight: 700;
}

.price-table .cell {
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 14px;
}

.price-table .row.head .cell { border-top: none; }

.price-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #6b7280;
}

/* ===== Kakao Floating Button ===== */
.kakao-float {
  position: fixed;
  right: 20px;
  bottom: 96px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--kakao);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  z-index: 3000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kakao-float img {
  width: 28px;
  height: 28px;
  display: block;
}

.kakao-float:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .list { grid-template-columns: 1fr; }
  .search { width: 100%; margin-left: 0; }
  .search-input { width: 100%; }
}

@media (max-width: 768px) {
  .kakao-float {
    right: 14px;
    bottom: 88px;
    width: 52px;
    height: 52px;
  }
  .kakao-float img {
    width: 26px;
    height: 26px;
  }
  .plan-hero img {
    min-height: 240px;
    object-fit: contain;
  }
}

@media (max-width: 560px) {
  .price-table .row {
    grid-template-columns: 1.2fr 1fr 0.9fr 1fr;
  }
  .price-table .cell {
    padding: 9px 5px;
    font-size: 11px;
  }
}

/* 데스크톱에서 메뉴를 가로로 강제 정렬 */
@media (min-width: 993px) {
  .global-header-inner {
    flex-wrap: nowrap !important;           /* 강제 가로 배치 */
  }

  .brand-logo {
    flex-shrink: 0;
  }

  .menu-toggle {
    display: none !important;
  }

  .main-nav {
    display: block !important;
    width: auto !important;
    max-height: none !important;
    margin-left: auto;                      /* 오른쪽으로 밀어붙임 */
    order: 2;
  }

  .nav-list {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 32px !important;
    justify-content: flex-end;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
  }

  .nav-cta {
    margin-top: 0 !important;
    width: auto !important;
  }

  .nav-link {
    padding: 10px 4px !important;
  }

  /* 카카오 버튼이 잘리지 않도록 */
  .btn-consult {
    padding: 10px 20px;
    font-size: 15px;
  }
}

/* 모바일에서는 기존처럼 세로 유지 */
@media (max-width: 992px) {
  .main-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  #menu-toggle:checked ~ .main-nav {
    max-height: 600px;  /* 메뉴 많아도 충분히 열리게 */
  }

  .nav-list {
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
  }
}

/* PC(데스크톱)에서 메뉴를 무조건 가로 한 줄로 강제 정렬 + 오른쪽 정렬 */
@media (min-width: 993px) {
  .global-header-inner {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: 40px !important;              /* 로고와 메뉴 사이 간격 넓히기 */
  }

  .brand-logo {
    flex: 0 0 auto;
  }

  .menu-toggle {
    display: none !important;
  }

  .main-nav {
    display: block !important;
    width: auto !important;
    max-height: none !important;
    margin-left: auto !important;       /* 메뉴를 오른쪽 끝으로 밀기 */
    flex: 1 1 auto;
  }

  .nav-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;       /* 절대 줄바꿈 금지 */
    gap: 40px !important;              /* 메뉴 아이템 간격 넓게 (필요시 32px~50px 조정) */
    justify-content: flex-end !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .nav-cta {
    margin: 0 !important;
    width: auto !important;
  }

  .nav-link {
    padding: 12px 6px !important;
    font-size: 16px !important;         /* 글씨 조금 키워도 좋음 */
  }

  .btn-consult {
    padding: 12px 28px !important;
    font-size: 16px !important;
  }
}

/* 모바일용 (기존 그대로 유지) */
@media (max-width: 992px) {
  .global-header-inner {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: flex !important;
  }

  .main-nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    order: 99;  /* 맨 아래로 */
  }

  #menu-toggle:checked ~ .main-nav {
    max-height: 600px !important;  /* 메뉴 많아도 열림 */
  }

  .nav-list {
    flex-direction: column !important;
    gap: 20px !important;
    padding: 20px 0 !important;
  }

  .nav-cta {
    width: 100% !important;
    text-align: center !important;
  }
}