/* ===================================
   검색 사이드바 전용 CSS
   파일명: sidebar_search.css
   작성일: 2025-01-07
   설명: 검색 페이지 사이드바 스타일
   =================================== */

/* 기본 사이드바 스타일 (PC) */
.sok-catalog-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0;
}

/* 모바일 슬라이드 메뉴 관련 스타일 */
@media (max-width: 1023px) {
    .sok-catalog-sidebar {
        position: fixed !important;
        top: 0;
        right: -350px;
        width: 350px;
        height: 100vh;
        background: #fff;
        z-index: 1200;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -2px 0 8px rgba(0,0,0,0.15);
        display: block !important; /* 강제로 표시 */
        border-radius: 0; /* 모바일에서는 둥근 모서리 제거 */
    }
    
    .sok-catalog-sidebar.sok-mobile-active {
        right: 0 !important;
    }
    
    /* 사이드바 열려있을 때 body 스크롤 방지 */
    body.sok-sidebar-open {
        overflow: hidden !important;
    }
    
    /* 오버레이 */
    .sok-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1100;
        opacity: 1;
        transition: opacity 0.3s ease;
    }
}

/* 매우 작은 화면에서 사이드바 너비 조정 */
@media (max-width: 480px) {
    .sok-catalog-sidebar {
        width: 300px !important;
        right: -300px !important;
    }
}

/* 검색 전용 필터 버튼 스타일 */
.sok-search-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 10px;
}

.sok-search-filter-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.sok-search-filter-btn.active {
    background: #b82647;
    color: white;
    border-color: #b82647;
}

.sok-search-filter-btn svg {
    transition: transform 0.2s ease;
}

.sok-search-filter-btn.active svg {
    transform: rotate(180deg);
}

.sok-filter-text {
    font-size: 13px;
}

/* PC에서 필터 버튼 숨김 */
@media (min-width: 1024px) {
    .sok-search-filter-btn {
        display: none !important;
    }
}

/* 모바일에서만 필터 버튼 표시 */
@media (max-width: 1023px) {
    .sok-search-filter-btn {
        display: flex !important;
    }
}

/* 사이드바 닫기 버튼 (모바일용) */
.sok-sidebar-close {
    display: none;
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.sok-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.sok-close-btn:hover {
    background-color: #f0f0f0;
}

/* 사이드바 콘텐츠 */
.sok-sidebar-content {
    padding: 20px 15px;
}

/* 사이드바 위젯 */
.sok-sidebar-widget {
    margin-bottom: 30px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.sok-sidebar-widget:last-child {
    margin-bottom: 0;
}

/* 위젯 제목 */
.sok-widget-title {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.sok-widget-title h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 위젯 콘텐츠 */
.sok-widget-content {
    padding: 15px 20px;
}

/* 사이드바 리스트 */
.sok-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    /* PC에서는 스크롤 없음 */
}

/* 모바일에서만 스크롤 적용 */
@media (max-width: 1023px) {
    .sok-sidebar-list {
        max-height: 300px;
        overflow-y: auto;
    }

    .sok-sidebar-list::-webkit-scrollbar {
        width: 4px;
    }

    .sok-sidebar-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }

    .sok-sidebar-list::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
    }

    .sok-sidebar-list::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
}

.sok-list-item {
    margin-bottom: 8px;
}

.sok-list-item:last-child {
    margin-bottom: 0;
}

/* 네비게이션 링크 */
.sok-nav-link {
    display: block;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
}

.sok-nav-link:hover {
    background-color: #f0f0f0;
    color: #333;
    transform: translateX(3px);
}

/* 하이라이트 링크 (전체상품보기) */
.sok-nav-link.sok-highlight {
    color: #b82647;
    font-weight: 600;
    background-color: rgba(184, 38, 71, 0.05);
}

.sok-nav-link.sok-highlight:hover {
    background-color: rgba(184, 38, 71, 0.1);
    color: #b82647;
}

/* 비활성화 링크 */
.sok-nav-link.sok-disabled {
    color: #999;
    cursor: not-allowed;
    font-style: italic;
}

.sok-nav-link.sok-disabled:hover {
    background-color: transparent;
    color: #999;
    transform: none;
}

/* 모바일 반응형 */
@media (max-width: 1023px) {
    .sok-sidebar-close {
        display: block;
    }
    
    .sok-sidebar-content {
        padding: 15px;
    }
    
    .sok-sidebar-widget {
        margin-bottom: 20px;
    }
    
    .sok-widget-title {
        padding: 12px 15px;
    }
    
    .sok-widget-title h3 {
        font-size: 13px;
    }
    
    .sok-widget-content {
        padding: 12px 15px;
    }
    
    .sok-nav-link {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* 태블릿 */
@media (min-width: 768px) and (max-width: 1023px) {
    .sok-sidebar-content {
        padding: 18px;
    }
    
    .sok-sidebar-widget {
        margin-bottom: 25px;
    }
}

/* 위젯 호버 효과 */
.sok-sidebar-widget:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* 링크 카운트 표시 (필요시) */
.sok-nav-link .sok-count {
    float: right;
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

/* 액티브 상태 */
.sok-nav-link.sok-active {
    background-color: #b82647;
    color: white;
    font-weight: 600;
    position: relative;
}

.sok-nav-link.sok-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #fff;
    border-radius: 0 2px 2px 0;
}

.sok-nav-link.sok-active:hover {
    background-color: #a02040;
    color: white;
    transform: translateX(0); /* 활성화된 링크는 이동 효과 없음 */
}

/* 하이라이트 + 액티브 상태 (전체상품보기) */
.sok-nav-link.sok-highlight.sok-active {
    background-color: #b82647;
    color: white;
}

.sok-nav-link.sok-highlight.sok-active:hover {
    background-color: #a02040;
    color: white;
}

/* 가격 필터 전용 스타일 (price_filter() 함수 결과물 대응) */
.sok-sidebar-content .price-filter {
    margin-bottom: 20px;
}

.sok-sidebar-content .price-filter .widget-title {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
}

.sok-sidebar-content .price-filter .widget-title h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.sok-sidebar-content .price-filter .widget-content {
    padding: 15px;
}

/* 반응형 개선 */
@media (max-width: 480px) {
    .sok-sidebar-content {
        padding: 12px;
    }
    
    .sok-widget-title {
        padding: 10px 12px;
    }
    
    .sok-widget-content {
        padding: 10px 12px;
    }
    
    .sok-nav-link {
        padding: 5px 8px;
        font-size: 12px;
    }
}

.sok-product-count-text {
    display: none; /* 기본적으로 숨김 */
    font-size: 14px;
    color: #666;
    text-align: center;
    padding: 10px 0;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

@media (max-width: 767px) {
    .sok-toolbar-center {
        display: none !important;
    }
    .sok-product-count-text {
        display: block !important;
    }
}

