/* ── AUTH 깜빡임 방지: auth.js가 auth-ready 추가 전까지 숨김 ── */
[data-auth-guest],
[data-auth-member] {
  opacity: 0 !important;
  transition: opacity 0.15s ease;
}
body.auth-ready [data-auth-guest],
body.auth-ready [data-auth-member] {
  opacity: 1 !important;
}

/* ── NAV BAR ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3vw, 48px);
  background: var(--white);
  border-bottom: 1px solid #e5e5e5;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  height: clamp(40px, 4.5vw, 64px);
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  height: 100%;
}

.nav-item {
  position: static;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-item > a {
  text-decoration: none;
  color: var(--black);
  font-size: clamp(14px, 1.2vw, 20px);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  position: relative;
  padding: 4px 0;
  transition: opacity 0.2s;
}

.nav-item > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--black);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-item:hover > a::after {
  transform: scaleX(1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-contact {
  background: var(--black);
  color: var(--white);
  border: none;
  padding: clamp(8px, 0.7vw, 12px) clamp(16px, 1.5vw, 28px);
  border-radius: 24px;
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

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

.nav-text-link {
  text-decoration: none;
  color: var(--black);
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.nav-text-link:hover {
  opacity: 0.6;
}

.globe-icon {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 500;
  color: var(--black);
  cursor: pointer;
  transition: opacity 0.2s;
}

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

.globe-icon svg {
  width: 18px;
  height: 18px;
}

/* ── MOBILE NAV ── */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  margin: 5px 0;
  transition: all 0.3s;
}

/* ── MOBILE MENU ── */
.mobile-menu {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--white);
    z-index: 99;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #e5e5e5;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .mobile-menu.open {
    max-height: calc(100vh - var(--nav-height));
    max-height: calc(100svh - var(--nav-height));
    border-bottom: 1px solid #e5e5e5;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.mobile-menu-item {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: var(--black);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  padding: 16px 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.mobile-menu-toggle::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  transition: transform 0.3s;
}

.mobile-menu-item.open .mobile-menu-toggle::after {
  content: '−';
}

.mobile-menu-toggle:hover {
  background: #f5f5f5;
}

.mobile-menu-link {
  display: block;
  text-decoration: none;
  color: var(--black);
  font-size: 18px;
  font-weight: 600;
  padding: 16px 24px;
  transition: background 0.2s;
}

.mobile-menu-link:hover {
  background: #f5f5f5;
}

.mobile-menu-divider {
  height: 1px;
  background: #eee;
  margin: 8px 24px;
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  background: #fafafa;
}

.mobile-menu-item.open .mobile-submenu {
  max-height: 500px;
}

.mobile-sub-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.04em;
  padding: 12px 32px 4px;
}

.mobile-submenu a {
  display: block;
  text-decoration: none;
  color: var(--black);
  font-size: 15px;
  font-weight: 400;
  padding: 10px 32px;
  transition: background 0.2s;
}

.mobile-submenu a:hover {
  background: #f0f0f0;
}

/* 햄버거 → X 애니메이션 */
.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1024px) {
  .nav-links {
    display: none;
  }

  .mega-menu,
  .mega-backdrop {
    display: none;
  }

  .nav-right .nav-text-link,
  .nav-right > a[data-auth-guest],
  .nav-right > a[data-auth-member],
  .nav-right > span[data-auth-member],
  .nav-right > a[data-auth-order-link] {
    display: none !important;
  }

  .nav-right .lang-switcher {
    display: inline-flex !important;
  }
  .nav-right .lang-switcher .globe-icon {
    display: flex !important;
  }

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

  nav {
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 0 12px;
  }

  .logo img {
    height: clamp(32px, 8vw, 40px);
  }

  .btn-contact {
    padding: 8px 14px;
    font-size: 12px;
  }
}

/* ── MEGA MENU (all pages - moved from products.css) ── */
.mega-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 100vw;
  background: var(--white);
  border-top: 1px solid #e5e5e5;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  pointer-events: none;
  z-index: 99;
}

.nav-item:hover .mega-menu,
.nav-item.menu-open .mega-menu {
  max-height: 500px;
  opacity: 1;
  pointer-events: auto;
}

.mega-menu-inner {
  width: 100%;
  padding: clamp(32px, 3.5vw, 56px) clamp(32px, 5vw, 80px);
  padding-left: var(--menu-left, 80px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 320px));
  gap: clamp(40px, 5vw, 80px);
  justify-content: start;
}

.mega-col {
  display: flex;
  flex-direction: column;
}
.mega-col:nth-child(2) a {
  font-weight: 600;
}

.mega-col-title {
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 600;
  color: #888;
  letter-spacing: 0.02em;
  padding-bottom: clamp(12px, 1.2vw, 20px);
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0;
}

.mega-col a {
  text-decoration: none;
  color: var(--black);
  font-size: clamp(16px, 1.6vw, 26px);
  font-weight: 400;
  padding: clamp(14px, 1.4vw, 22px) 0;
  border-bottom: 1px solid #e0e0e0;
  transition: opacity 0.2s;
}

.mega-col a:hover {
  opacity: 0.5;
}

.mega-weight {
  font-size: 12px;
  font-weight: 400;
  color: #999;
}

/* Mega menu backdrop overlay */
.mega-backdrop {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mega-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
