/* [HEADER] PC Wide GNB & Mobile Sidebar */
.header-top {
    width: 100%;
    height: 40px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.header-top-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
}

.top-left { display: flex; align-items: center; gap: 20px; }
.top-logo img { height: 18px; filter: grayscale(0); opacity: 0.8; transition: var(--transition); }
.top-logo img:hover { filter: grayscale(0); opacity: 1; }

.top-nav ul { display: flex; gap: 15px; }
.top-nav ul li a { font-size: 13px; color: #666; font-weight: 500; }
.top-nav ul li a:hover { color: var(--point-color); }

.top-right { display: flex; align-items: center; gap: 20px; }
.top-auth { display: flex; gap: 15px; border-right: 1px solid #ddd; padding-right: 20px; }
.top-auth li a { font-size: 13px; color: #666; }

.top-sns { display: flex; gap: 12px; align-items: center; }
.top-sns li a { color: #888; transition: var(--transition); display: flex; align-items: center; }
.top-sns li a:hover { color: var(--point-color); }
.top-sns li a svg { fill: currentColor; }

.header { 
    position:sticky; top:0; left:0; width:100%; height:var(--header-height); 
    background:rgba(255, 255, 255, 1); z-index:1000; 
    transition: var(--transition); border-bottom:1px solid var(--gray-100); 
}
.header.scrolled { 
    height: var(--header-scrolled-height); 
    background:rgba(255, 255, 255, 1); 
    backdrop-filter:none; -webkit-backdrop-filter:none; 
    border-bottom: 1px solid var(--gray-100);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.header-inner {
    max-width: var(--container-width); margin:0 auto; height:100%; 
    display:flex; align-items:center; justify-content:space-between; padding:0 18px; 
}

.header-left { display: flex; align-items: center; gap: 40px; height: 100%; }

.logo { flex-shrink:0; display: flex; align-items: center; height: 100%; }
.logo a { display: flex; align-items: center; height: 100%; font-size:28px; font-weight:800; color:var(--black); letter-spacing: -1.5px; }
.logo img { height:42px; transition: var(--transition); display: block; }

.header.scrolled .logo img { height: 32px; }

.gnb { height: 100%; }
.gnb > ul { display:flex; gap:0; height: 100%; }
.gnb > ul > li { position:relative; height: 100%; display: flex; align-items: center; }
.gnb > ul > li > a { 
    position: relative;
    display:flex; align-items:center; height:100%; padding:0 13px; 
    font-size:19px; font-weight:700; color: var(--black);
    transition: all 0.3s ease;
    letter-spacing: -0.5px;
}

.header.scrolled .gnb > ul > li > a {
    font-size: 16px;
}

.gnb > ul > li:hover > a,
.gnb > ul > li.active > a { 
    color: var(--point-color); 
}

.sub-menu { 
    position:absolute; top:100%; left:50%; transform:translateX(-50%) translateY(10px); 
    min-width:180px; width:max-content; max-width:300px; background:#fff; padding:15px; border-radius: var(--round-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); opacity:0; visibility:hidden; transition: var(--transition);
}
.gnb > ul > li:hover .sub-menu { opacity:1; visibility:visible; transform:translateX(-50%) translateY(0); }
.sub-menu li a { 
    display:flex; align-items:center; justify-content:space-between; gap:15px;
    padding:10px 15px; font-size:15px; color:var(--gray-500); border-radius: var(--round-sm); 
    white-space:nowrap;
}
.sub-menu li a:hover { background: var(--gray-50); color: var(--point-color); }

.header-right { display: flex; align-items: center; gap: 20px; }

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: 1px solid var(--gray-200);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    transition: var(--transition);
}

.btn-login:hover {
    background: var(--gray-50);
    border-color: var(--gray-500);
}

/* User Profile (Logged In) */
.user-profile { position: relative; height: 100%; display: flex; align-items: center; }
.btn-user { display: flex; align-items: center; gap: 10px; height: 100%; }
.profile-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gray-200); }
.profile-img-none { width: 36px; height: 36px; border-radius: 50%; background: var(--gray-100); border: 1px solid var(--gray-200); }
.user-profile .nick { font-size: 15px; font-weight: 600; color: var(--black); }

.user-dropdown {
    position: absolute; top: 100%; right: 0; transform: translateY(10px);
    width: 150px; background: #fff; padding: 10px; border-radius: var(--round-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); opacity: 0; visibility: hidden; transition: var(--transition);
}
.user-profile:hover .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown li a { display: block; padding: 10px 15px; font-size: 14px; color: var(--gray-500); border-radius: var(--round-sm); }
.user-dropdown li a:hover { background: var(--gray-50); color: var(--point-color); }

/* Mobile Sidebar */
.sidebar-mobile {
    position: fixed; top: 0; right: -100%; width: 85%; max-width: 500px; height: 100%;
    background: #fff; z-index: 2000; transition: var(--transition);
    padding: 40px; display: flex; flex-direction: column; gap: 40px;
    border-radius: 0;
    box-shadow: -20px 0 50px rgba(0,0,0,0.1);
}
.sidebar-mobile.active { right: 0; }

.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
    z-index: 1900; opacity: 0; visibility: hidden; transition: var(--transition);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.m-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.m-logo { font-size: 20px; font-weight: 800; color: var(--black); }
.m-logo img { height: 35px; width: auto; vertical-align: middle; }
.m-logo a { font-size: 20px; font-weight: 800; color: var(--black); letter-spacing: -1px; }
.btn-close-menu { font-size: 24px; color: var(--gray-500); }

.m-gnb ul { display: flex; flex-direction: column; }
.m-gnb > ul > li { border-bottom: 1px solid var(--gray-100); }
.m-gnb > ul > li:last-child { border-bottom: none; }
.m-gnb ul li { position: relative; }
.m-gnb ul li a { 
    display: flex; 
    align-items: center; 
    gap: 8px;
    padding: 15px 0; 
    font-size: 18px; 
    font-weight: 700; 
    color: var(--black); 
    transition: color 0.3s ease; 
}
.m-gnb ul li.has-sub > a { padding-right: 40px; }

.m-gnb ul li.active > a,
.m-gnb ul li a:active { color: var(--point-color); }

.btn-toggle-sub {
    position: absolute; right: 0; top: 0; width: 50px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-400); transition: transform 0.3s ease;
}
.m-gnb li.open > .btn-toggle-sub { transform: rotate(180deg); color: var(--point-color); }

.m-sub { 
    display: none !important; 
    margin-bottom: 10px; padding-left: 15px; 
    border-left: 1px solid var(--gray-100); 
}
.m-gnb li.open > .m-sub { display: block !important; }
.m-sub li a { 
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 10px 0 !important;
    font-size: 15px !important; 
    font-weight: 500 !important; 
    color: var(--gray-500) !important; 
}
.m-sub li.active a { color: var(--point-color) !important; }

/* Menu Badge */
.menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--point-color);
    color: #fff !important;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 700;
    line-height: 1;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
}

/* PC GNB Badge Size */
.gnb > ul > li > a .menu-badge { font-size: 11px; margin-top: -2px; }
.sub-menu li a .menu-badge { font-size: 10px; padding: 2px 6px; }

/* Mobile GNB Badge Size */
.m-gnb ul li a .menu-badge { font-size: 11px; padding: 2px 6px; margin-left: 0; }
.m-sub li a .menu-badge { font-size: 10px; padding: 1px 5px; margin-left: 0; }

/* Badge New (N) */
.menu-badge.badge-new,
.gnb > ul > li > a .menu-badge.badge-new,
.sub-menu li a .menu-badge.badge-new,
.m-gnb ul li a .menu-badge.badge-new,
.m-sub li a .menu-badge.badge-new {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 1px 0 0 !important; /* Move text 1px to the left by adding right padding */
    border-radius: 50% !important;
    font-size: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    margin-left: 0 !important; /* gap will handle spacing */
}

/* PC GNB Badge New position */
.gnb > ul > li > a .menu-badge.badge-new { margin-top: -1px; margin-left: 6px !important; }
.sub-menu li a .menu-badge.badge-new { 
    font-size: 9px !important; 
    width: 16px !important; 
    height: 16px !important; 
    min-width: 16px !important;
    margin-left: 8px !important;
}

/* Mobile GNB Badge New position */
.m-gnb ul li a .menu-badge.badge-new { margin-top: 0; }
.m-sub li a .menu-badge.badge-new { 
    width: 15px !important; 
    height: 15px !important; 
    min-width: 15px !important;
    font-size: 9px !important; 
    margin-top: 0;
}

.m-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--gray-100); color: var(--gray-500); font-weight: 600; }
