/* ========================================
   공통 레이아웃 CSS
======================================== */
/* ================================================
   색상 테마 - 차콜 그레이 + 오렌지
   ================================================ */
:root {
    /* 메인 테마: 차콜 그레이 */
    --primary-color: #34495e;
    --primary-light: #4a5f7f;
    --primary-dark: #2c3e50;
    --primary-bg: rgba(52, 73, 94, 0.05);
    
    /* 서브 컬러 */
    --accent-color: #95a5a6;
    --accent-light: #bdc3c7;
    
    /* 포인트 컬러 (오렌지) */
    --point-color: #e67e22;
    --point-light: #f39c12;
    --point-dark: #d35400;
    
    /* 공통 색상 */
    --text-dark: #333;
    --text-gray: #666;
    --text-light: #999;
    --border-color: #e5e5e5;
    --bg-light: #f9f9f9;
    --bg-white: #fff;
}


/* ========================================
   헤더 (스크롤 시 넘어감)
======================================== */
.main-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo a {
    display: block;
    text-decoration: none;
    color: var(--text-dark);
}

.logo h1 {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.logo img {
    height: 40px;
}

/* 검색 */
.search-box {
    flex: 1;
    max-width: 500px;
    margin: 0 auto;
}

.search-box form {
    display: flex;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-size: 14px;
}

.search-btn {
    background: var(--primary-color);
    color: var(--bg-white);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-light);
}

/* 사용자 메뉴 */
.user-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.2s;
}

.menu-item:hover {
    color: var(--primary-color);
}

.menu-item.cart {
    position: relative;
}

.menu-item .badge {
    background: #ff4444;
    color: var(--bg-white);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
}

/* ================================================
   메인 네비게이션 (스크롤 시 고정)
   ================================================ */
.main-nav {
    background: var(--bg-white);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 🔥 스크롤 시 나타나는 작은 로고 (왼쪽에 독립적으로) */
.nav-logo {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.nav-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
}

.nav-logo img {
    height: 30px;
}

.nav-logo .site-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-dark);
}

/* 스크롤 후: 로고 나타남 */
.main-nav.scrolled .nav-logo {
    opacity: 1;
    pointer-events: auto;
}

/* 메뉴 컨테이너 (가운데 정렬 유지) */
.main-nav .container {
    /* 기본 container 스타일 유지 */
}

/* 메뉴 목록 */
.nav-menu {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    position: relative;
    border: 1px solid #eee;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.nav-link .icon {
    font-size: 18px;
}

.nav-link .badge {
    padding: 2px 6px;
    font-size: 11px;
    background: #ff4444;
    color: white;
    border-radius: 3px;
    font-weight: 500;
}

/* 현재 페이지의 1차 카테고리 */
.nav-item.current-category .nav-link {
    background: var(--primary-color);
    color: var(--bg-white);
    border-bottom-color: var(--point-color);
    font-weight: 600;
}

/* 드롭다운 나올 때 오렌지 선 유지 */
.nav-item.current-category::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--point-color);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mega-dropdown.show ~ .nav-menu .nav-item.current-category::after,
.main-nav:hover .nav-item.current-category::after {
    opacity: 1;
}

.nav-item.current-category .nav-link:hover {
    background: var(--primary-light);
    color: var(--bg-white);
}

.nav-item.current-category .nav-link .badge {
    background: var(--bg-white);
    color: var(--primary-color);
}

/* 마우스 오버 시 하이라이트 */
.nav-item.highlight .nav-link {
    background: var(--primary-light);
    color: var(--bg-white) !important;
}

.nav-item.highlight .nav-link .badge {
    background: var(--bg-white);
    color: var(--primary-color);
}

/* ================================================
   서브 카테고리 네비게이션 (스크롤 시 고정)
   ================================================ */
.sub-category-nav {
    background: var(--primary-color);
    padding: 0;
    position: sticky;
    top: 50px; /* main-nav 높이만큼 (조정 필요) */
    z-index: 99;
}

.sub-category-list {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.sub-category-list::-webkit-scrollbar {
    display: none;
}

.sub-category-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.sub-category-item:hover {
    color: var(--bg-white);
    background: var(--primary-dark);
}

.sub-category-item.active {
    color: var(--bg-white);
    font-weight: 700;
}

.sub-category-item .sub-badge {
    padding: 2px 6px;
    font-size: 11px;
    background: var(--point-color);
    color: white;
    border-radius: 3px;
    font-weight: 500;
}

/* 3차 메뉴 (자식 카테고리) */
.child-category-list {
    display: flex;
    gap: 0;
    background: #E5E7E1;
    padding-left: 40px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-top: 1px solid #e9ecef;
}

.child-category-list::-webkit-scrollbar {
    display: none;
}

.child-category-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.child-category-item:hover {
    color: var(--primary-color);
    background: #e9ecef;
}

.child-category-item.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
}

.child-category-item .child-badge {
    padding: 2px 5px;
    font-size: 10px;
    background: var(--point-color);
    color: white;
    border-radius: 3px;
    font-weight: 500;
}  

/* ========================================
   Mega 드롭다운 (전체 메뉴)
======================================== */
.mega-dropdown {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-top: 3px solid #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.mega-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mega-dropdown .container {
    display: flex;
    gap: 0;
    flex-wrap: nowrap;
    justify-content: center;
    padding-top: 0;
}

.mega-category {
    flex: 0 0 150px;
    min-width: 150px;
    max-width: 150px;
    padding: 15px 10px;
    border-right: 1px solid var(--border-color);
    transition: background 0.2s;
}

.mega-category:last-child {
    border-right: none;
}

.mega-category.active {
    background: var(--bg-light);
}

.mega-category.empty {
    opacity: 0.5;
}

.empty-category {
    text-align: center;
    padding: 20px 0;
    color: var(--text-light);
    font-size: 13px;
}

/* 2차 카테고리 */
.mega-subcategory {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-subcategory li {
    padding: 0;
    margin: 0;
}

.mega-subcategory > li > .sub-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 16px;
    display: block;
    padding: 2px 10px;
    transition: all 0.2s;
    border-radius: 4px;
    word-break: keep-all;
    line-height: 1.4;
}

.mega-subcategory > li > .sub-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.mega-subcategory > li.highlight-parent > .sub-link {
    background: var(--accent-light);
    font-weight: bold;
    color: var(--primary-color);
    padding-left: 12px;
    border-radius: 4px;
}

.mega-subcategory .badge-small {
    background: #ff4444;
    color: var(--bg-white);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    margin-left: 5px;
    font-weight: bold;
}

.mega-subcategory li.has-children > .sub-link {
    font-weight: 500;
    position: relative;
}

.sub-link.expandable {
    display: block;
    padding-right: 8px;
}

.expand-icon {
    display: none;
}

/* 3차 카테고리 */
.mega-third-category {
    list-style: none;
    max-height: none;
    overflow: visible;
    padding-left: 12px;
    margin-top: 3px;
    margin-left: 0;
    border-left: none;
}

.mega-third-category li {
    margin-bottom: 1px;
}

.mega-third-category a {
    color: var(--text-light);
    font-size: 14px;
    padding: 2px 8px;
    display: block;
    transition: all 0.2s;
    border-radius: 3px;
}

.mega-third-category a:hover {
    color: var(--primary-color);
    background: var(--bg-light);
    padding-left: 12px;
}

/* ========================================
   반응형 (모바일)
======================================== */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-box {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 10px 0 0 0;
    }
    
    /* 모바일에서는 로고 숨김 */
    .nav-logo {
        display: none;
    }
    
    .nav-link {
        padding: 14px 16px;
        font-size: 13px;
    }
    
    .mega-category {
        flex: 0 0 100px;
        min-width: 100px;
        max-width: 100px;
        padding: 10px 8px;
    }
    
    .mega-subcategory > li > .sub-link {
        font-size: 13px;
        padding: 6px 8px;
    }
    
    .mega-third-category a {
        font-size: 11px;
    }
}



/* 상품 리스트 - Input 옵션 표시 */
.product-options-list {
    display:block;
    margin: 5px 0;
    font-size: .9em;
    color: #666;
    line-height: 1.5;
    padding-left:10px
}

/* 🔥 이걸 살려야 해요! */
.product-options-list .option-item {
    display: block;  /* ← 이게 핵심! */
}
/*
.product-options-list .option-item {
    display: inline-block;
    margin-right: 8px;
}

.product-options-list .option-item:not(:last-child)::after {
    content: '·';
    margin-left: 8px;
    color: #ccc;
}
*/
