/* =================================================================
   원앤원 모바일 사이드바 - 홈페이지 전용
   페이지별 섹션 + 카테고리 구조
   ================================================================= */

/* PC에서 모바일 사이드바 완전 숨김 */
@media (min-width: 769px) {
    .mobile-sidebar,
    .mobile-sidebar *,
    .mobile-sidebar-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

@media (max-width: 768px) {
    /* 사이드바 오버레이 */
    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* 사이드바 컨테이너 */
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        max-width: 300px;
        height: 100vh;
        background: #ffffff;
        z-index: 10001;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 4px 0 16px rgba(0,0,0,0.1);
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .mobile-sidebar.active {
        left: 0;
    }
    
    .mobile-sidebar::-webkit-scrollbar {
        display: none;
    }
    
    /* 사이드바 헤더 */
    .sidebar-header {
        padding: 1.5rem;
        background: #f8f9fa;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .sidebar-logo {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .sidebar-logo h2 {
        color: #333;
        font-size: 1.2rem;
        font-weight: bold;
        margin: 0;
    }
    
    .sidebar-logo .logo-icon {
        color: #6b4a2e;
        font-size: 1.4rem;
    }
    
    /* 페이지별 로켓 아이콘 컬러 */
    .page-home .sidebar-logo .logo-icon {
        color: #0d6efd !important; /* 홈페이지 - primary blue */
    }
    
    .page-carrot .sidebar-logo .logo-icon {
        color: #ffc107 !important; /* 당근마켓 - warning yellow */
    }
    
    .page-naver .sidebar-logo .logo-icon {
        color: #198754 !important; /* 네이버 - success green */
    }
    
    .page-automation .sidebar-logo .logo-icon {
        color: #0d6efd !important; /* 자동화 - primary blue */
    }
    
    .page-qna .sidebar-logo .logo-icon {
        color: #0d6efd !important; /* Q&A - primary blue */
    }
    
    .page-homepage-creation .sidebar-logo .logo-icon {
        color: #6f42c1 !important; /* 홈페이지제작 - purple */
    }
    
    /* 닫기 버튼 */
    .close-sidebar {
        border: none;
        background: #e9ecef;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #666;
        font-size: 1.2rem;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .close-sidebar:hover {
        background: #dee2e6;
        color: #333;
    }
    
    /* 현재 페이지 섹션 */
    .current-page-section {
        padding: 1.5rem;
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        position: relative;
    }
    
    .current-page-section::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, #e2e8f0 50%, transparent 100%);
    }
    
    .section-title {
        color: #6b4a2e;
        font-size: 1rem;
        font-weight: bold;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .section-title .icon {
        font-size: 1.2rem;
    }
    
    .section-menu {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .section-menu a {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        padding: 0.8rem 1rem;
        color: #666;
        text-decoration: none;
        border-radius: 8px;
        transition: all 0.3s ease;
        font-size: 0.95rem;
    }
    
    .section-menu a:hover {
        background: #f8f9fa;
        color: #333;
    }
    
    .section-menu a .menu-icon {
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }
    
    /* 다른 페이지 카테고리 */
    .other-pages-section {
        padding: 1.5rem;
        background: #ffffff;
        position: relative;
    }
    
    .other-pages-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, #e2e8f0 50%, transparent 100%);
    }
    
    .category-title {
        color: #6b4a2e;
        font-size: 1rem;
        font-weight: bold;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .category-title .icon {
        font-size: 1.2rem;
    }
    
    .category-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .category-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding: 1rem 0.8rem;
        color: #666;
        text-decoration: none;
        border-radius: 8px;
        transition: all 0.3s ease;
        background: #f8f9fa;
        border: 1px solid #e2e8f0;
        text-align: center;
    }
    
    .category-item:hover {
        background: #6b4a2e;
        color: #ffffff;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(107, 74, 46, 0.2);
    }
    
    .category-item .category-icon {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }
    
    .category-item .category-label {
        font-size: 0.85rem;
        font-weight: 500;
        line-height: 1.2;
    }
    
    /* 사이드바 푸터 */
    .sidebar-footer {
        padding: 1.5rem;
        background: #f8f9fa;
        border-top: 1px solid #e2e8f0;
        text-align: center;
    }
    
    .footer-logo {
        color: #6b4a2e;
        font-weight: bold;
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .footer-description {
        color: #666;
        font-size: 0.9rem;
        margin: 0;
    }
}

/* 작은 화면 대응 */
@media (max-width: 480px) {
    .mobile-sidebar {
        width: 280px;
        max-width: 280px;
        left: -280px;
    }
}

@media (max-width: 375px) {
    .mobile-sidebar {
        width: 260px;
        max-width: 260px;
        left: -260px;
    }
}