/* Airbnb-Inspired Horizontal Filter System */

/* Horizontal Filter Bar */
.filter-bar-container {
    position: sticky;
    top: 80px;
    z-index: 100;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 16px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: #222;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
    position: relative;
}

.filter-chip:hover {
    border-color: #222;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.filter-chip.active {
    background: #222;
    color: white;
    border-color: #222;
}

.filter-chip.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.filter-chip-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.filter-chip.active .filter-chip-icon {
    transform: rotate(180deg);
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #f0f0f0;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #222;
}

/* Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
}

.bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    max-height: 90vh;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

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

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.bottom-sheet-title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin: 0;
}

.bottom-sheet-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #222;
}

.bottom-sheet-close:hover {
    background: #e0e0e0;
}

.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

.bottom-sheet-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    background: white;
}

/* Filter Panel Styles */
.filter-panel-section {
    margin-bottom: 32px;
}

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

.filter-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0 0 16px 0;
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.category-item:hover {
    background: #f8f8f8;
}

.category-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.category-checkbox input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.category-checkbox input:checked + .checkmark {
    display: block;
}

.category-checkbox:has(input:checked) {
    background: #222;
    border-color: #222;
}

.checkmark {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.category-label {
    flex: 1;
    font-size: 15px;
    color: #222;
    cursor: pointer;
}

.category-count {
    font-size: 13px;
    color: #888;
}

/* Tag Chips */
.tag-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #222;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tag-chip:hover {
    border-color: #222;
    background: #f8f8f8;
}

.tag-chip.selected {
    background: #222;
    color: white;
    border-color: #222;
}

.tag-chip.selected .tag-count {
    color: rgba(255, 255, 255, 0.8);
}

.tag-count {
    margin-left: 6px;
    font-size: 12px;
    color: #888;
}

/* Price Slider */
.price-slider-container {
    padding: 8px 0;
}

.price-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.price-input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    background: white;
}

.price-input:focus {
    outline: none;
    border-color: #222;
}

.price-slider-wrapper {
    position: relative;
    padding: 20px 0;
}

.price-slider-track {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    position: relative;
}

.price-slider-fill {
    height: 100%;
    background: #222;
    border-radius: 2px;
    position: absolute;
    transition: all 0.2s ease;
}

.price-slider-handle {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #222;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 2;
}

.price-slider-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.price-slider-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.15);
}

/* Buttons */
.btn-filter {
    flex: 1;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
}

.btn-filter-clear {
    background: #f0f0f0;
    color: #222;
}

.btn-filter-clear:hover:not(:disabled) {
    background: #e0e0e0;
}

.btn-filter-clear:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-filter-apply {
    background: #222;
    color: white;
}

.btn-filter-apply:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Sort Options */
.sort-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sort-option:hover {
    background: #f8f8f8;
}

.sort-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.sort-radio input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.sort-radio:has(input:checked) {
    border-color: #222;
}

.sort-radio:has(input:checked)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #222;
    border-radius: 50%;
}

.sort-label {
    flex: 1;
    font-size: 15px;
    color: #222;
    cursor: pointer;
}

/* Responsive */
@media (min-width: 768px) {
    .filter-bar-container {
        top: 100px;
    }
    
    .bottom-sheet {
        max-width: 600px;
        left: 50%;
        transform: translate(-50%, 100%);
        border-radius: 24px;
    }
    
    .bottom-sheet.open {
        transform: translate(-50%, 0);
    }
}

/* Swipe Indicator */
.bottom-sheet-swipe-indicator {
    width: 40px;
    height: 4px;
    background: #d0d0d0;
    border-radius: 2px;
    margin: 8px auto 0;
    flex-shrink: 0;
}

/* Loading State */
.filter-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #888;
}

/* Empty State */
.filter-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.filter-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.filter-empty-text {
    font-size: 15px;
}

/* Smooth Scroll */
.filter-bar,
.bottom-sheet-content {
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 transparent;
}

.filter-bar::-webkit-scrollbar,
.bottom-sheet-content::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.filter-bar::-webkit-scrollbar-track,
.bottom-sheet-content::-webkit-scrollbar-track {
    background: transparent;
}

.filter-bar::-webkit-scrollbar-thumb,
.bottom-sheet-content::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

.filter-bar::-webkit-scrollbar-thumb:hover,
.bottom-sheet-content::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

