.derma-header {
  position: absolute;
  top: 0;
  left: 30px;
  right: 0;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  background: #fff;
  border-bottom: 1px solid #F2F2F2;
  z-index: 50;
}

.derma-header-wrap {
  max-width: 1080px;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.derma-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
  gap: 16px;
}

.derma-header-top-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.derma-header-top-menu li {
  display: flex;
  align-items: center;
}

.derma-header-top-menu li > a {
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 500;
}

.derma-header-top-menu li > a.mobile {
  display: none;
}

.derma-header-top-menu li > a:hover {
  color: var(--point-color);
}

.header-hamburger {
  width: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-hamburger i {
  display: block;
  width: 24px;
  height: 2px;
  background: #000;
}

/* PC 기본: 모바일 전용 지구본 아이콘 완전 숨김 (!important 로 특이도 문제 방지) */
.derma-header-top-menu li.derma-header-lang-icon {
  display: none !important;
}

.derma-header-inner {
  width: 100%;
  display: none;
  align-items: center;
  padding: 0 16px 8px;
  gap: 8px;
}

.derma-header-logo {
  display: flex;
  align-items: center;
  min-width: 308px;
  height: 56px;
}

.derma-header-logo a.mobile {
  display: none;
}

.derma-header-logo a.pc {
  display: block;
  width: 66%;
  height: 100%;
}

.derma-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.derma-header-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: #F2F3F3;
  border-radius: 24px;
  padding: 0 12px;
  margin-right: 12px;
  height: 40px;
  box-shadow: 0 1px 4px rgba(80, 60, 120, 0.04);
}

.derma-header-search input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  flex: 1;
  padding: 0 8px;
}

.derma-header-search button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
}

.derma-header-search img {
  width: 20px;
  height: 20px;
}

.derma-header-menu {
  display: flex;
  align-items: center;
  gap: 18px;
}

.derma-header-menu a {
  color: #222;
  font-size: 15px;
  text-decoration: none;
  font-weight: 500;
}

.derma-header-link-btn {
  background: #fff;
  border: 1px solid #EDEDED;
  border-radius: 18px;
  padding: 6px 25px;
  font-size: 14px;
  color: #444;
  font-weight: 500;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.3s, border 0.3s;
}

.derma-header-link-btn:hover {
  background: #f5f0fa;
  border-color: #a48ad4;
}

.derma-header-profile {
  margin-left: 18px;
}

.profile-circle {
  width: 40px;
  height: 40px;
  background: #7c4dff;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(80, 60, 120, 0.18);
}

.derma-header-menu-mobile {
  display: none;
}

.derma-header-lang-list {
  position: absolute;
  flex-direction: column;
  display: flex;
  right: 13px;
  top: 50px;
  gap: 5px;
  display: none;
  z-index: 999;
}

.derma-header-lang-list img {
  width: 32px;
}


/* 햄버거 메뉴 */
.derma-header-hamburger-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 320px;
  height: 100vh;
  background: #fff;
  z-index: 1000;
  transition: right 0.3s ease-in-out;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.derma-header-hamburger-menu.active {
  right: 0;
}

.hamburger-menu-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hamburger-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.hamburger-menu-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
}

.hamburger-close {
  background: none;
  border: none;
  font-size: 24px;
  width: 40px;
  height: 40px;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.hamburger-close:hover {
  background-color: #eee;
}

.hamburger-menu-body {
  flex: 1;
  min-height: 0;          /* flex 자식 내부 스크롤 허용 */
  overflow-y: auto;
  /* 하단 고정 '장바구니 보기' 바에 마지막 항목(언어 목록)이 가려지지 않도록 여유 */
  padding: 20px 20px 90px;
}

.hamburger-menu-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.hamburger-menu-list li {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.hamburger-menu-list a {
  display: block;
  padding: 12px 15px;
  color: #1d1d1f;
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.2s;
  font-size: 16px;
}

.hamburger-menu-list a:hover {
  background-color: #f0f0f0;
}

.hamburger-menu-divider {
  height: 1px;
  background: #eee;
  margin: 20px 0;
}

.hamburger-menu-language h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
}

.language-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.language-list li {
  margin-bottom: 8px;
}

.language-list a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #1d1d1f;
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.2s;
  font-size: 14px;
}

.language-list a:hover {
  background-color: #f0f0f0;
}

.language-list img {
  height: 15px;
  margin-right: 10px;
  border-radius: 2px;
}

.header-hamburger i {
  width: 20px;
  height: 2px;
  background: #333;
  margin: 2px 0;
  transition: all 0.3s ease;
}

/* 오버레이 */
.hamburger-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.hamburger-overlay.active {
  opacity: 1;
  visibility: visible;
}


@media (max-width: 1280px) {
  .derma-header {
    left: 0;
    right: auto;
    width: 100%;
    max-width: none;
    margin: 0;
  }
}

@media (max-width: 1024px) {
  .derma-header-top {
    margin: 8px 16px;
  }

  .derma-header-logo a.pc {
    display: none;
  }

  .derma-header-logo a.mobile {
    display: block;
  }

  .derma-header-logo a.mobile span {
    font-size: 28px;
  }

  .derma-header {
    left: 0;
    right: auto;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .derma-header-top-menu {
    gap: 10px;
    transform: scale(1.2);
  }

  .derma-header-top-menu li > a.pc {
    display: none;
  }

  .derma-header-top-menu li > a.mobile {
    display: block;
    transform: scale(1.2);
  }

  /* 회원가입 메뉴 모바일에서 숨김 — 로그인 페이지로 이동됨 */
  .derma-header-top-menu li.register-menu {
    display: none;
  }

  .derma-header-inner {
    display: flex;
    padding: 0 16px 8px;
    gap: 8px;
  }

  .derma-header-top .derma-header-search {
    display: none;
  }

  .derma-header-search-mobile {
    display: flex !important;
    flex: 1;
  }

  .derma-header-logo {
    min-width: auto;
    height: auto;
    font-size: 14px;
  }

  .profile-circle {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .derma-header-top-menu li.link-btn-wrap {
    display: none;
  }

  /* 모바일: 헤더 두 행의 레이어 분리 — top 행(지구본 포함)을 inner(모바일 메뉴) 위로 */
  .derma-header-top {
    position: relative;
    z-index: 20;
  }
  .derma-header-inner {
    position: relative;
    z-index: 1;
  }

  /* 모바일: 햄버거 좌측 지구본 언어 아이콘 노출 */
  .derma-header-top-menu li.derma-header-lang-icon {
    display: flex !important;
    align-items: center;
    position: relative;
    z-index: 1100;
  }
  .derma-header-top-menu li.derma-header-lang-icon .language_icon {
    position: relative;
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
  }
  .derma-header-top-menu li.derma-header-lang-icon .lang-toggle > a {
    display: flex;
    align-items: center;
    color: #1d1d1f;
    text-decoration: none;
  }
  .derma-header-top-menu li.derma-header-lang-icon .lang-toggle > a .material-symbols-outlined {
    font-size: 24px;
    font-weight: 400;
  }
  .derma-header-top-menu li.derma-header-lang-icon .lang-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;
    top: 34px;
    right: 50%;
    transform: translateX(50%);
    width: 48px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(.4,0,.2,1), opacity 0.2s;
    z-index: 1100;
    pointer-events: none;
  }
  .derma-header-top-menu li.derma-header-lang-icon .lang-list.open {
    max-height: 300px;
    opacity: 1;
    pointer-events: auto;
  }
  .derma-header-top-menu li.derma-header-lang-icon .lang-list li {
    margin: 0;
    padding: 8px 0;
    text-align: center;
    display: block;
  }
  .derma-header-top-menu li.derma-header-lang-icon .lang-list li:hover {
    background-color: rgba(0, 0, 0, 0.05);
  }
  .derma-header-top-menu li.derma-header-lang-icon .lang-list li a {
    display: block;
  }
  .derma-header-top-menu li.derma-header-lang-icon .lang-list li a img {
    width: 32px;
    height: auto;
    border-radius: 0;
    object-fit: contain;
    display: inline-block;
    margin: 0;
  }

  /* 모바일 메뉴 */
  .derma-header-menu-mobile {
    display: flex;
    align-items: center;
    gap: 6px;
    transform: scale(1.2);
  }

  .derma-header-menu-mobile a {
    color: #222;
  }

  .derma-header-hamburger-menu {
    max-width: 100%;
  }

  /* 모바일: 장바구니 열림 상태에서 헤더 숨김 (PC는 영향 없음) */
  body.derma-cart-open .derma-header {
    display: none;
  }
}
