.header-search-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;

  height: 90px;

  padding: 0 2.5%;
  display: flex;
  align-items: center;

  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.header-wrapper:not(.scrolled) .icon-btn {
  color: #fff;
}

.header-wrapper.scrolled .icon-btn {
  color: #000;
}
.header-search-bar.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  /* box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04); */
}

.header-search-form {
  width: 100%;
}

.header-search-input-wrap {
  position: relative;
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
}

.header-search-icon {
  position: absolute;
  left: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b0b0b0;
}

.header-search-input {
  flex: 1;
  height: 100%;
  border: none;
  border-bottom: 1px solid #eee;
  outline: none;
  background: transparent;
  font-size: 17px;
  padding: 0 38px 0 36px;
  color: #333;
}

.header-search-input::placeholder {
  color: #c0c0c0;
}

.header-search-close {
  position: absolute;
  right: 14px;
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #b0b0b0;
  padding: 0;
}

.header-search-close:hover {
  color: #666;
}
.header-wrapper {
  position: absolute;
  width: 100%;
  height: calc(45px + 90px);
  /* height: calc(45px); */
  z-index: 1000;
  background-color: transparent;
}

.header-wrapper.scrolled {
  background-color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-wrapper.scrolled .top-bar {
  height: 0;
  padding: 0;
  overflow: hidden;
}

.header-wrapper.scrolled .header {
  position: relative;
  top: 0;
}

.top-bar {
  position: relative; /* 기준 + stacking context 생성 */
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  height: 45px;
  background: #1a1a1a;
  color: #ffffff;
  text-align: left;
  padding: 12px 2.5%;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.shipto-wrapper {
  position: relative;
  flex-direction: column;
  align-items: flex-end;
  cursor: pointer;
  padding-bottom: 20px;
}

.shipto-main {
  line-height: 1.2;
  font-size: 14px;
  font-weight: 100;
}

.shipto-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 30px;
  /* 드롭다운까지의 거리 + 여유 */
  background: transparent;
}

/* 드롭다운: 기본은 안 보이게, absolute로 아래에 띄우기 */
.shipto-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  /* shipto-main 바로 아래 */
  right: 40px;
  padding: 4px 8px;
  z-index: 3;
  background: #fff;
  color: #1a1a1a;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 2px;

  opacity: 0;
  /* transform: translateY(8px); */
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* shipto-wrapper에 마우스를 올렸을 때만 딱 나타나게 */
.shipto-wrapper:hover .shipto-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.logo-img {
  height: 45px;
}

.top-bar.hidden {
  transform: translateY(-100%);
  opacity: 0;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background-color: transparent;
  z-index: 1;
  transition: top 0.3s ease;
}

.header-container {
  margin: 0 auto;
  padding: 0 2.5%;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  position: relative;
}

.header-main {
  display: flex;
  align-items: center;
  gap: 100px;
}

.logo a {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #1a1a1a;
}

.nav {
  display: flex;
  gap: 20px;
}

.nav.desktop-nav {
  align-items: center;
  height: 100%;
}

.nav-item {
  position: relative;
  /* 메뉴 간 간격 */
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-link {
  display: block;
  text-decoration: none;
  color: #000;

  padding: 10px 0;
  /* (헤더 높이에 맞춰 조절) */
  transition: color 0.2s;
}

/* --- 하위 메뉴 (Dropdown Area) --- */
.sub-menu-wrapper {
  display: none;
  opacity: 0;
  visibility: hidden;

  position: absolute;
  top: 100%;
  left: -20px;
  z-index: 999;
  padding-top: 10px;
  border: none;
  background-color: #ffffff;
  /* box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); */
  padding: 2rem;
  /* 내부 여백 */
  min-width: 550px;
  max-width: 820px;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.category-list-v1-header {
  display: flex;
  flex-direction: column;
}

.sub-menu-wrapper.width-fit {
  left: -185px;
}

/* 6. 하위 메뉴 3단 컬럼 (Flexbox) */
.sub-menu-content {
  display: flex;
  gap: 2rem;
  /* 컬럼 사이 간격 */
}

.sub-menu-column {
  flex: 1;
  width: 230px;
}

.sub-menu-column h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 0.5rem;
  color: #000;
}

.sub-menu-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sub-menu-column li a {
  display: block;
  font-size: 0.9rem;
  color: #333;
  text-decoration: none;
  padding: 0.4rem 0;
  transition: color 0.2s;
}

.sub-menu-column li a:hover {
  color: #000;
  /* font-weight: 500; */
}

/* --- 3. [핵심 동작] Hover 효과 --- */

/* .nav-item에 마우스를 올렸을 때 */
.nav-item:hover .sub-menu-wrapper {
  /* 7. 하위 메뉴 보이기 (불투명, 클릭 가능) */
  display: block;
  opacity: 1;
  visibility: visible;
}

/* (선택) 하위 메뉴가 열렸을 때 상위 링크 색상 변경 */
.nav-item:hover .nav-link {
  color: #a0b8ae;
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: #ffffff;
  padding: 15px 10px;
  transition: opacity 0.2s;

  &:last-child {
    border-bottom: none;
  }
}

.nav-link:hover {
  color: #a0b8ae;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  position: relative;
  padding: 8px;
  /* color: #1a1a1a; */
  transition: opacity 0.2s;
}

.icon-btn:hover {
  opacity: 0.6;
}

.cart-count {
  position: absolute;
  top: 0px;
  right: 0px;

  color: #a0b8ae;
  font-size: 14px;
  font-weight: 600;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* .cart-count:empty {
  display: none;
} */

.mobile-menu-btn {
  display: none;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  top: 80%;
  opacity: 0;
  width: 100%;
  background: #ffffff;
  z-index: 0;
  transition: top 0.3s ease;
  position: absolute;
  box-shadow: 0px 5px 10px -1px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
  display: block;
  top: 100%;
  opacity: 1;
  z-index: 200;
}

.mobile-menu-content {
  position: relative;
  padding: 24px 5px;
}

.mobile-menu-close {
  padding: 8px;
  position: absolute;
  right: 5px;
  top: 5px;

  -webkit-tap-highlight-color: transparent;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
}

.mobile-nav-group {
  border-bottom: 1px solid #eee;
}

.mobile-nav-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 15px 10px;
  font-weight: 300;
  font-size: 18px;
  color: #000;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid #d0d0d0;
}

.mobile-nav-group:hover {
  opacity: 0.8;
}

.moblie-mypage-wrapper {
  margin-top: 10px;
}

.nav-sub-group {
  padding: 15px;
  font-size: 15px;
  margin-left: 8px;
}
.nav-sub-group:hover {
  cursor: pointer;
}

.nav-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: #f9f9f980;
}

.nav-list.active {
  max-height: 100vh;
  transition: max-height 0.5s ease-in;
}

.sub-menu-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: #f9f9f980;
}

.sub-menu-panel.active {
  max-height: 100vh;
  transition: max-height 0.5s ease-in;
}

.sub-menu-panel ul {
  list-style: none;
  padding: 0.5rem 1.5rem 1.5rem 2.5rem;
  margin: 0;
}

.sub-menu-panel li {
  &:first-child {
    a {
      border-top: none;
    }
  }
}

.sub-menu-panel li a {
  display: block;
  padding: 16px;
  text-decoration: none;
  color: #333;
  width: 90%;
  font-size: 13px;
  margin: 0 auto;
  border-top: 1px solid #eaeaea80;
}

.sub-menu-panel li a:hover {
  color: #000;
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: #ffffff;
  z-index: 200;
  transition: right 0.3s ease;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

.cart-sidebar.active {
  right: 0;
}

.cart-sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #e5e5e5;
}

.cart-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.cart-close {
  padding: 8px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.cart-empty {
  text-align: center;
  color: #666;
  padding: 48px 0;
}

.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #e5e5e5;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 14px;
  color: #666;
}

.cart-item-remove {
  padding: 4px;
  color: #dc2626;
  font-size: 12px;
}

.cart-footer {
  padding: 24px;
  border-top: 1px solid #e5e5e5;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.checkout-btn {
  width: 100%;
  padding: 16px;
  background: #1a1a1a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 4px;
  transition: background 0.2s;
}

.checkout-btn:hover {
  background: #333;
}

/* 기본은 안 보이게 (데스크탑에서 숨김) */
.mobile-search {
  display: none;
}

/* 모바일에서만 노출 */
@media (max-width: 1024px) {
  .mobile-search {
    display: block;
    padding: 10px 0px 16px;
  }

  .mobile-search-form {
    width: 100%;
  }

  .mobile-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
  }

  .mobile-search-icon {
    position: absolute;
    left: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b0b0b0;
  }

  .mobile-search-input {
    flex: 1;
    height: 100%;
    border: none;
    border-bottom: 1px solid #eee;
    outline: none;
    background: transparent;
    font-size: 18px;
    padding: 10px 70px 10px 32px;

    color: #333;
  }

  .mobile-search-input::placeholder {
    color: #c0c0c0;
  }

  .mobile-search-submit {
    position: absolute;
    right: 0;
    height: 100%;
    padding: 0 14px;
    border: none;
    background: none;
    font-size: 13px;
    cursor: pointer;
    color: #555;
  }

  .mobile-search-submit:hover {
    color: #000;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .top-bar span {
    display: none;
  }

  .top-bar {
    justify-content: flex-end;
    font-size: 14px;
  }

  .feature-grid {
    gap: 48px;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-btn {
    display: none;
  }
  .user-profile-v1-header {
    display: none;
  }

  .user-profile-v1-wishlist {
    display: none;
  }
  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 48px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .feature-content h2 {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 16px;
  }

  .logo a {
    font-size: 20px;
  }

  .hero {
    padding: 48px 0;
  }

  .hero-title {
    font-size: 36px;
  }

  .products {
    padding: 48px 0;
  }

  .feature {
    padding: 48px 0;
  }

  .footer {
    padding: 48px 0 24px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
