.site-header {
  border-bottom: 1px solid var(--border-light);
  background-color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.4rem;
  flex-wrap: nowrap;
  min-width: 0;
}

/* 로고 */
.logo {
  height: 80px;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.logo-img {
  height: 100px;
  width: auto;
  display: block;
}

/* 가운데 메뉴 + 검색 */
.header-center {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 13.4rem;
  min-width: 0;
}

.gnb {
  display: flex;
  align-items: center;
  gap: clamp(1.6rem, 2.5vw, 4rem);
  font-size: 1.4rem;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.gnb a,
.gnb-item,
.gnb-link {
  white-space: nowrap;
  word-break: keep-all;
}

/* 강의목록/공지사항 동일 색(검정) */
.gnb-link {
  color: #111;
  text-decoration: none;
  font-weight: 700;
}

/* =========================
   드롭다운 (사라짐 방지)
========================= */
.gnb-item.has-sub {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.gnb-item.has-sub::after {
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 16px;
}

.gnb-item.has-sub:hover .submenu,
.gnb-item.has-sub:focus-within .submenu,
.gnb-item.has-sub .submenu:hover {
  display: block;
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;

  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 0.6rem;
  padding: 0.6rem 0;
  min-width: 16rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  z-index: 9999;
}

.submenu a {
  display: block;
  padding: 0.7rem 1.6rem;
  font-size: 1.4rem;
  line-height: 1.4;
  color: #111;
  text-decoration: none;
}
.submenu a:hover { background: rgba(0,0,0,0.04); }

/* =========================
   ✅ 검색바 (요청 반영)
   - 기본: 굵은 검정 밑줄 + 오른쪽 아이콘
   - 클릭/포커스: 둥근 검색틀(3번째 캡처 느낌)
========================= */
.header-search {
  /* 반응형 수축 */
  flex: 1 1 32rem;
  max-width: 42rem;
  min-width: 12rem;

  position: relative;
  display: flex;
  align-items: center;

  /* ✅ 기본(언더라인) */
  border: none;
  border-bottom: 3px solid #3a3a3a;
  border-radius: 0;
  background: transparent;

  padding: 0.35rem 0;     /* 아래줄만 보이게 */
}

/* ✅ 포커스 되면 “검색틀”로 변신
.header-search:focus-within {
  border: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  border-radius: 999px;
  background: #fff;

  padding: 0.6rem 1.2rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
*/

.search-input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.4rem;

  /* ✅ 오른쪽 아이콘 공간 확보 */
  padding-right: 3.2rem;
  min-width: 0;
}

.search-input::placeholder { color: #b5b5b5; }

/* 버튼: 오른쪽 고정 */
.search-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);

  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ✅ 포커스 상태에서 버튼이 안쪽으로 들어가게
.header-search:focus-within .search-btn {
  right: 10px;
}
*/

.search-icon-img {
  width: 20px;     /* 원하면 18~24로 조절 */
  height: 20px;
  display: block;
}

/* =========================
   오른쪽
========================= */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  flex-wrap: nowrap;
}

/* 관리자 버튼 */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  background-color: #222;
  color: #fff;
  font-size: 1.3rem;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* 이름 */
.user-name {
  color: #333;
  font-size: 1.3rem;
  font-weight: 500;
  text-decoration: none;

  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  margin-right: 0.2rem;
  flex: 0 1 auto;
  min-width: 0;
}

.logout-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
  font-size: 1.2rem;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* 장바구니 */
.header-cart-btn{
  margin-right: 1.2rem;
    display: inline-flex;
    align-items: center;
    position: relative;
  flex: 0 0 auto;
}
.header-cart-icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}
.cart-count-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}

/* 겹침 방지 */
@media (max-width: 1100px) {
  .header-search { max-width: 34rem; min-width: 10rem; }
  .user-name { max-width: 120px; }
}
@media (max-width: 920px) {
  .header-search { max-width: 26rem; min-width: 9rem; }
  .user-name { max-width: 100px; }
}

/* 햄버거 버튼 */
.menu-toggle {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* 모바일 드로어 */
.mobile-nav { position: fixed; inset: 0; pointer-events: none; z-index: 99999; }
.mobile-nav.is-open { pointer-events: auto; }

.mobile-nav__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mobile-nav.is-open .mobile-nav__overlay { opacity: 1; }

.mobile-nav__panel {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 78%;
  max-width: 360px;
  background: #fff;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  overflow-y: auto;
}
.mobile-nav.is-open .mobile-nav__panel { transform: translateX(0); }

.mobile-nav__header {
  position: relative;
  padding: 16px 16px 10px;
  border-bottom: 1px solid #eee;
}

.mobile-nav__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 26px;
  line-height: 40px;
  cursor: pointer;
}

.mobile-nav__logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.mobile-nav__logo {
  width: 120px;
  height: auto;
  display: block;
}

.mobile-nav__toprow {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-nav__toprow--guest { justify-content: flex-end; }
.mobile-nav__toprow--login { justify-content: space-between; }

.mobile-nav__rightpack {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav__login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  color: #111;
  font-size: 14px;
  text-decoration: none;
}

.mobile-nav__cart {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.mobile-nav__user-name {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  color: #111;
  text-decoration: none;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-nav__logout {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.mobile-nav__cards {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-card {
  border: 1px solid rgba(56, 120, 255, 0.30);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(31, 79, 255, 0.10);
  padding: 14px;
}

.mobile-card--compact { padding: 12px 14px; }
.mobile-card--notice { margin-top: 10px; align-self: stretch; }

.mobile-card__title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #111;
  text-decoration: none;
  margin-bottom: 14px;
}

.mobile-card__sublist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mobile-card__sublist--single { grid-template-columns: 1fr; }

.mobile-card__sublist a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(56, 120, 255, 0.18);
  background: rgba(56, 120, 255, 0.06);
  color: #1a2a5a;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 768px 이하 */
@media (max-width: 768px) {
  .header-inner {
    position: relative;
    justify-content: center;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
  }

  .header-center,
  .header-right {
    display: none;
  }
}
