/* [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; 
    box-sizing: border-box;
}

.header-left { display: flex; align-items: center; gap: 40px; height: 100%; }

.logo { flex-shrink:0; display: flex; align-items: stretch; 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: 100%; max-height: 100%; padding: 5px 0; box-sizing: border-box; transition: var(--transition); display: block; }

.header.scrolled .logo img { height: 100%; padding: 5px 0; }

.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: stretch; height: 100%; }

/* Interactive Canvas Buttons (PC) */
.auth-buttons-v2 {
    display: flex;
    align-items: stretch;
    height: 100%;
}

.btn-container {
    position: relative;
    display: flex;
    align-items: stretch;
    height: 100%;
    overflow: visible; /* 잘림 방지: 컨테이너 밖으로 애니메이션 허용 */
}

.btn-interactive {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 25px;
    width: 100%;
    height: 100%;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    box-sizing: border-box;
    z-index: 5;
}

.btn-container .btn-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.btn-interactive .btn-text-wrap,
.btn-interactive .profile-img-wrap,
.btn-interactive .nick,
.btn-interactive .arrow,
.btn-interactive .header-cart-icon-v2 {
    position: relative;
    z-index: 10;
}

.btn-interactive .btn-text-wrap,
.btn-interactive .profile-img-wrap,
.btn-interactive .nick,
.btn-interactive .arrow {
    pointer-events: none;
}

/* Button Text Wrap & Animation - 원천 해결 버전 */
.btn-text-wrap {
    display: block;
    position: relative;
    height: 40px;
    width: max-content; /* 텍스트 너비에 맞춤 */
    overflow: visible; /* 잘림 방지: 핵심 */
    text-align: center;
}

.btn-interactive .btn-text {
    display: block;
    height: 40px;
    line-height: 40px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    white-space: nowrap;
    transform-origin: center center; /* 중심점 고정 */
    width: 100%;
    padding: 0 10px; /* 텍스트 양옆 안전 여백 조정 */
    box-sizing: border-box;
}

.btn-interactive .hover-text {
    position: absolute;
    top: 0;
    left: 0;
    font-style: italic;
    transform: translateY(40px) skewX(0); /* 아래에 대기 */
    opacity: 0;
}

.btn-interactive:hover .btn-text:not(.hover-text) {
    transform: translateY(-40px);
    opacity: 0;
}

.btn-interactive:hover .hover-text {
    transform: translateY(0) skewX(-1deg) scale(1.1); /* 기울기 각도를 10도로 완만하게 조정 */
    opacity: 1;
    color: #fff;
    text-shadow: 0 0 15px rgba(255,255,255,0.8);
}

/* Specific Button Colors/Gradients (Fallback) */
.btn-container:has(.btn-request) {
    background: #000;
    border-left: 1px solid rgba(255,255,255,0.1);
}
.btn-container:has(.btn-login-v2), .btn-container:has(.btn-user.btn-interactive) {
    background: var(--point-color);
}

.btn-request .btn-text {
    font-size: 18px;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

/* User Profile adjustment for Interactive */
.user-profile { position: relative; height: 100%; display: flex; align-items: stretch; }
.user-profile .btn-container { min-width: auto; }
.user-profile .btn-user.btn-interactive {
    padding: 0 25px;
    border-radius: 0;
    color: #fff;
    gap: 10px;
}
.user-profile .btn-user.btn-interactive .nick {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.user-profile .btn-user.btn-interactive .arrow {
    color: #fff;
    opacity: 0.8;
}

/* Profile Image in Button */
.user-profile .profile-img-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}
.user-profile .profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* User Dashboard Dropdown V2 */
.header-user-wrap { display: flex; align-items: stretch; height: 100%; }

/* Interactive Cart Icon V2 (Inside Button) */
.header-cart-icon-v2 {
    position: relative;
    margin-right: 12px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
}
.header-cart-icon-v2:hover {
    color: #fff;
    transform: scale(1.1);
}
.header-cart-icon-v2.active {
    color: #fff;
}
.header-cart-icon-v2 .count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #fff;
    color: var(--point-color);
    font-size: 10px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: none;
}

.user-dropdown-v2 {
    position: absolute; top: 100%; right: 0; transform: translateY(15px);
    width: 280px; background: #fff; border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15); opacity: 0; visibility: hidden; transition: var(--transition);
    overflow: hidden; z-index: 100; border: 1px solid #eee;
}
.user-profile:hover .user-dropdown-v2 { opacity: 1; visibility: visible; transform: translateY(5px); }

.dropdown-header { padding: 20px; background: #fcfcfc; border-bottom: 1px solid #f5f5f5; display: flex; flex-direction: column; gap: 4px; }
.dropdown-header .label { font-size: 11px; font-weight: 700; color: #999; letter-spacing: 0.5px; }
.dropdown-header .point { font-size: 20px; font-weight: 800; color: var(--black); }

.dropdown-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-bottom: 1px solid #f5f5f5; }
.stat-item { padding: 15px 10px; text-align: center; border-right: 1px solid #f5f5f5; transition: var(--transition); }
.stat-item:last-child { border-right: none; }
.stat-item:hover { background: #fafafa; }
.stat-val { display: block; font-size: 14px; font-weight: 700; color: var(--black); margin-bottom: 2px; }
.stat-label { display: block; font-size: 11px; color: #888; font-weight: 500; }

.dropdown-links { padding: 10px; list-style: none; }
.dropdown-links li a { 
    display: flex; align-items: center; gap: 10px; padding: 10px 15px; 
    font-size: 14px; font-weight: 500; color: #555; border-radius: 8px; transition: var(--transition);
}
.dropdown-links li a:hover { background: #f5f5f5; color: var(--point-color); }
.dropdown-links li.logout { border-top: 1px solid #f5f5f5; margin-top: 5px; padding-top: 5px; }
.dropdown-links li.logout a { color: #999; }
.dropdown-links li.logout a:hover { color: #f44336; background: #fff1f0; }

/* Mobile Sidebar */
.sidebar-mobile {
    position: fixed; top: 0; right: -100%; width: 85%; max-width: 400px; height: 100%;
    background: #fff; z-index: 2000; transition: var(--transition);
    padding: 0; display: flex; flex-direction: column;
    border-radius: 0;
    box-shadow: -20px 0 50px rgba(0,0,0,0.1);
    overflow-y: auto;
}
.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; padding: 20px 25px; border-bottom: 1px solid var(--gray-100); order: -1; }
.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 { padding: 0 25px; }
.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;
}

/* Mobile Request Menu - Button Style Upgrade */
.m-gnb-btns {
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.m-btn-request-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    background: var(--point-color);
    color: #fff !important;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--point-color), transparent 70%);
    transition: all 0.3s ease;
}
.m-btn-request-v2:active {
    transform: scale(0.97);
    filter: brightness(0.9);
}

.m-footer { margin-top: auto; padding: 30px 25px; border-top: 1px solid var(--gray-100); color: var(--gray-500); font-weight: 600; }

/* Mobile User Area Styling */
.m-user-area {
    padding: 30px 25px;
    background: #fcfcfc;
    border-bottom: 1px solid var(--gray-100);
}

.m-login-area {
    text-align: center;
    padding: 10px 0;
}
.m-login-area p {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}
.m-btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    background: var(--black);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
}

.m-user-profile {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.profile-info {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}
.m-profile-img-wrap {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.m-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.m-profile-img-none {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
}
.m-profile-img-none svg {
    width: 28px;
    height: 28px;
}
.m-user-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.m-nick {
    font-size: 18px;
    font-weight: 800;
    color: var(--black);
}
.m-point {
    font-size: 14px;
    font-weight: 700;
    color: var(--point-color);
}
.m-user-btns {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.m-btn-logout, .m-btn-mypage {
    font-size: 12px;
    color: #999;
    font-weight: 600;
}
.m-btn-mypage {
    color: var(--point-color);
    background: color-mix(in srgb, var(--point-color), transparent 90%);
    padding: 2px 8px;
    border-radius: 4px;
}

.m-user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
}
.m-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 5px;
    border-right: 1px solid #eee;
}
.m-stat-item:last-child {
    border-right: none;
}
.m-stat-item .val {
    font-size: 14px;
    font-weight: 800;
    color: var(--black);
}
.m-stat-item .lab {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
