/**
 * 필터링 매니저 스타일
 */

/* 필터 패널 기본 스타일 */
.filter-panel {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    z-index: 50;
    position: relative;
}

.filter-panel-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.filter-panel-header h6 {
    margin: 0;
    color: #495057;
    font-weight: 600;
}

.filter-panel-body {
    padding: 16px;
}

/* 필터 섹션 */
.filter-section {
    margin-bottom: 20px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section .form-label {
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

/* 가격 범위 컨테이너 */
.price-range-container {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e9ecef;
}

.price-slider-container {
    position: relative;
}

.price-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
}

/* 폼 컨트롤 스타일 */
.filter-panel .form-control,
.filter-panel .form-select {
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.filter-panel .form-control:focus,
.filter-panel .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 가격 슬라이더 */
.form-range {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
}

.form-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: #0d6efd;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0d6efd;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* 필터 액션 버튼 */
.filter-actions .btn {
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .filter-panel {
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .filter-panel-header {
        border-radius: 0;
    }
    
    .price-range-container .row .col-6 {
        margin-bottom: 8px;
    }
}

/* 애니메이션 */
.filter-panel {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 필터 버튼 스타일 */
#filterBtn {
    transition: all 0.2s ease;
}

#filterBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 필터 상태 표시 */
.filter-panel.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 체크박스 스타일 */
.filter-panel .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.filter-panel .form-check-label {
    font-size: 14px;
    color: #495057;
}

/* 드롭다운 스타일 */
.filter-panel .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
}

/* 필터 카운트 배지 */
.filter-count-badge {
    background: #dc3545;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* 필터 미리보기 */
.filter-preview {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #0066cc;
}

.filter-preview-item {
    display: inline-block;
    background: #0066cc;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}

/* 로딩 상태 */
.filter-loading {
    opacity: 0.6;
    pointer-events: none;
}

.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 필터 결과 통계 */
.filter-stats {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #6c757d;
}

.filter-stats strong {
    color: #495057;
}

/* 토스트 메시지 스타일 개선 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
}

.toast .toast-body {
    padding: 12px 16px;
    font-size: 14px;
}

/* 성공 토스트 */
.toast.bg-success {
    background-color: #198754 !important;
}

/* 정보 토스트 */
.toast.bg-info {
    background-color: #0dcaf0 !important;
}

/* 경고 토스트 */
.toast.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* 오류 토스트 */
.toast.bg-danger {
    background-color: #dc3545 !important;
}

/* 인라인 필터 옵션 스타일 */
.filter-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 8px;
    min-width: 80px;
}

.filter-option .form-label-sm {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 2px;
    text-align: center;
}

.filter-option .form-control,
.filter-option .form-select {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.filter-option .price-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-option .form-check {
    margin: 0;
    display: flex;
    align-items: center;
}

.filter-option .form-check-input {
    margin-right: 4px;
    transform: scale(0.8);
}

.filter-option .form-check-label {
    font-size: 11px;
    margin: 0;
}

/* 보기 옵션 컨테이너 스타일 개선 (진짜 2줄 레이아웃) */
#viewOptions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #dee2e6;
}

/* Row 1: 모든 옵션들을 한 줄에 배치 */
.row-1-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* 액션 버튼들 */
.row-1-container .action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 보기 옵션들 */
.row-1-container .view-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 보기 옵션 그룹 (이미지/정렬을 세로로 배치) */
.view-option-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 80px;
}

.view-option-group .view-label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    margin: 0;
    text-align: center;
}

.view-option-group .form-select {
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
    width: 100px;
}

/* Row 2: 필터링 옵션들을 한 줄로 배치 */
.filter-row-2 {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

/* 각 필터 아이템 */
.filter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 80px;
}

/* 필터 라벨 */
.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    margin: 0;
    text-align: center;
}

/* 가격 입력 필드들 */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-separator {
    font-size: 12px;
    color: #6c757d;
    font-weight: bold;
}

/* 필터 아이템 내 폼 컨트롤 */
.filter-item .form-control,
.filter-item .form-select {
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
}

/* 체크박스 스타일 */
.filter-item .form-check {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-item .form-check-input {
    margin: 0;
    transform: scale(0.9);
}

.filter-item .form-check-label {
    font-size: 11px;
    margin: 0;
}

/* 필터 옵션 그룹핑 */
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.filter-group .filter-option {
    margin: 0;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .row-1-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .row-1-container .action-buttons,
    .row-1-container .view-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .filter-group {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .filter-option {
        min-width: 70px;
        margin: 0 4px;
    }
    
    .filter-option .form-control,
    .filter-option .form-select {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .row-1-container .action-buttons,
    .row-1-container .view-controls {
        gap: 6px;
    }
    
    .row-1-container {
        gap: 8px;
    }
}

/* 이미지 표시 방식 클래스들 */
.hide-images .product-image {
    display: none !important;
}

.thumbnail-only .product-image img {
    width: 50px !important;
    height: 50px !important;
    object-fit: cover;
}
