/* ============================================
   MOBILE FLOATING CATEGORY BUTTON + BOTTOM SHEET
   ============================================ */

/* Floating Category Button (Draggable) */
.floating-category-btn {
    position: fixed;
    right: 20px;
    bottom: calc(var(--tab-bar-height) + 20px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.4);
    cursor: pointer;
    z-index: 150;
    display: none; /* Hidden by default, shown on mobile via JS */
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s;
    touch-action: none; /* For drag functionality */
}

.floating-category-btn:active {
    transform: scale(0.95);
}

.floating-category-btn.dragging {
    box-shadow: 0 8px 24px rgba(220, 20, 60, 0.6);
    transform: scale(1.1);
}

/* Bottom Sheet Overlay */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.bottom-sheet-overlay.active {
    display: block;
    opacity: 1;
}

/* Bottom Sheet Container */
.bottom-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 70vh;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    padding-bottom: calc(var(--tab-bar-height) + 10px); /* 하단 탭바 피하기 */
}

.bottom-sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

/* Bottom Sheet Handle (Swipe Indicator) */
.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px auto 8px;
    cursor: grab;
}

.bottom-sheet-handle:active {
    cursor: grabbing;
}

/* Bottom Sheet Header */
.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.bottom-sheet-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bottom-sheet-header h3 i {
    color: var(--primary-color);
}

.bottom-sheet-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.bottom-sheet-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Bottom Sheet Content */
.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: calc(var(--tab-bar-height) + 20px);
}

/* Bottom Sheet Category Item */
.bottom-sheet-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    text-align: left; /* 🆕 v4.2.40: 좌측 정렬 */
}

.bottom-sheet-category-item:hover {
    background: var(--border-color);
}

.bottom-sheet-category-item.active {
    background: rgba(220, 20, 60, 0.1);
    border-color: var(--primary-color);
}

.bottom-sheet-category-item.active .category-name {
    color: var(--primary-color);
    font-weight: 600;
}

.category-name {
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s;
    text-align: left; /* 🆕 v4.2.40: 좌측 정렬 */
    flex: 1; /* 🆕 v4.2.40: 남은 공간 차지 */
    display: flex; /* 🆕 v4.2.40: 아이콘과 텍스트 정렬 */
    align-items: center; /* 🆕 v4.2.40: 수직 중앙 */
    gap: 8px; /* 🆕 v4.2.40: 아이콘과 텍스트 간격 */
}

.category-count {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.bottom-sheet-category-item.active .category-count {
    background: var(--primary-dark);
}

/* Desktop: Hide floating button and show sidebar */
@media (min-width: 1024px) {
    .floating-category-btn,
    .bottom-sheet-overlay {
        display: none !important;
    }
}

/* Mobile: Show floating button, hide category button in header */
@media (max-width: 1023px) {
    .floating-category-btn {
        display: flex;
    }
}
