/* Filter Sidebar Styles */
.filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 360px;
    height: 100%;
    background-color: #faf6e9;
    z-index: 1000;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 0 10px 10px 0;
    will-change: transform;
    visibility: hidden;
}

/* Fix for scrollbar issue - special class to prevent scroll but keep scrollbar */
body.no-scroll-but-keep-bar {
    position: fixed;
    width: 100%;
    overflow-y: scroll;
}

/* Styles for when filter is open */
.filter-sidebar.show {
    transform: translate3d(0, 0, 0);
    visibility: visible;
}

.filter-content {
    padding: 20px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0d8c0;
}

.filter-header h3 {
    font-weight: bold;
    color: #5d4037;
    margin: 0;
}

.filter-close {
    background: none;
    border: none;
    color: #8d6e63;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.filter-close:hover {
    transform: scale(1.1);
    color: #5d4037;
}

/* Search Input Styles */
.filter-search {
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 25px;
    border: 1px solid #d9c9a3;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    padding: 8px 15px;
}

.search-input-wrapper.focused,
.search-input-wrapper:focus-within {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    border-color: #c8b790;
}

.search-input-wrapper i.fa-search {
    color: #8d6e63;
    margin-right: 10px;
}

.filter-search-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #5d4037;
}

.filter-search-input::placeholder {
    color: #a39281;
    transition: opacity 0.3s ease;
}

.filter-search-input:focus::placeholder {
    opacity: 0.5;
}

/* Button Styles */
.price-range-buttons, 
.style-buttons, 
.location-options, 
.trust-options,
.amenities-options,
.sort-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.price-button, 
.style-button, 
.location-button, 
.trust-button,
.amenity-button,
.sort-button {
    background-color: #f0e9d2;
    border: 1px solid #d9c9a3;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    color: #5d4037;
    cursor: pointer;
    transition: all 0.2s ease;
}

.price-button:hover, 
.style-button:hover, 
.location-button:hover, 
.trust-button:hover,
.amenity-button:hover,
.sort-button:hover {
    background-color: #e6ddc4;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.price-button.active, 
.style-button.active, 
.location-button.active, 
.trust-button.active,
.amenity-button.active,
.sort-button.active {
    background-color: #c8b790;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Style buttons with icons */
.style-button, 
.location-button[data-location="current"], 
.trust-button[data-trust],
.amenity-button {
    display: flex;
    align-items: center;
    gap: 5px;
}

.style-button i, 
.location-button i, 
.trust-button i,
.amenity-button i,
.sort-button i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.style-button.active i, 
.location-button.active i, 
.trust-button.active i,
.amenity-button.active i,
.sort-button.active i {
    transform: scale(1.2);
}

/* Filter Pills Container */
.filter-pills-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 5px 0 15px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0d8c0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.filter-pills-container::-webkit-scrollbar {
    display: none;
}

.filter-pill-item {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #d9c9a3;
    background-color: #f0e9d2;
    color: #5d4037;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill-item:hover {
    background-color: #e6ddc4;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-pill-item.active {
    background-color: #7a5c2e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Filter Sections */
.filter-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #e0d8c0;
    padding-bottom: 20px;
}

.filter-section h4 {
    color: #5d4037;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Action buttons */
.filter-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

.filter-clear, .filter-apply {
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-clear {
    background-color: transparent;
    border: 1px solid #d9c9a3;
    color: #5d4037;
}

.filter-apply {
    background-color: #e0d8c0;
    border: 1px solid #d9c9a3;
    color: #5d4037;
}

.filter-apply.active {
    background-color: #7a5c2e;
    border-color: #7a5c2e;
    color: #fff;
    box-shadow: 0 4px 10px rgba(122, 92, 46, 0.3);
}

/* Overlay for filter */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-overlay.show {
    opacity: 1;
}

/* Loading indicator */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #7a5c2e;
    font-size: 16px;
}

.loading-indicator i {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

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

/* Error message */
.error-message {
    text-align: center;
    padding: 20px;
    color: #f44336;
    font-size: 16px;
    background-color: rgba(244, 67, 54, 0.1);
    border-radius: 8px;
    margin: 10px 0;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .filter-sidebar {
        width: 100%;
        max-width: none;
        border-radius: 0;
    }
    
    .filter-buttons {
        position: sticky;
        bottom: 0;
        padding: 15px 0;
        background-color: #faf6e9;
        margin-top: 20px;
        margin-bottom: 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
}

/* Đơn giản hóa CSS cho body khi filter đang mở */
html, body {
    /* Removed transitions that cause content shifts */
    /* transition: padding-right 0.3s ease, margin-right 0.3s ease; */
    /* will-change: padding-right; */
}

body.no-scroll {
    overflow: hidden;
    padding-right: 17px; /* Standard scrollbar width */
}

/* Đảm bảo container không bị dịch chuyển */
/* .container-custom {
    transition: padding-right 0.3s ease;
}

body.no-scroll .container-custom {
    padding-right: var(--scrollbar-width, 0);
} */

/* Content transition styles */
#post-list {
    transition: opacity 0.3s ease;
    /* No transform here */
}

/* Kỹ thuật WordPress cho body */
html.has-filter-open {
    overflow: hidden;
    /* margin-right: var(--scrollbar-width, 15px); */
}

/* Kỹ thuật này cho phép fixed elements cũng có margin right */
html.has-filter-open .navbar-custom {
    /* padding-right: var(--scrollbar-width, 15px); */
}

/* Khôi phục pointer-events cho sidebar và overlay */
body.no-scroll-but-keep-bar .filter-sidebar,
body.no-scroll-but-keep-bar .filter-overlay {
    pointer-events: auto !important;
}

/* Style cho navbar để không bị nhảy */
.navbar-custom {
    /* transition: padding-right 0.3s ease; */
    /* will-change: padding-right; */
}

body.no-scroll .navbar-custom {
    /* padding-right: 17px; */ /* Removed to prevent content shift */
}

/* CSS đơn giản cho body */
html.filter-open {
    /* overflow đặt tại thẻ HTML */
    overflow: hidden;
}

/* Khi đóng filter, đảm bảo overflow được reset */
html:not(.filter-open) {
    overflow: auto;
    overflow-x: hidden;
}

/* Bù đắp cho thân trang */
html.filter-open body {
    /* padding-right: 17px; */ /* Removed to prevent content shift */
    overflow-y: hidden;
}

/* Style cho navbar */
html.filter-open .navbar-custom {
    /* padding-right: 17px; */ /* Removed to prevent content shift */
}

/* Filter Pills in Sidebar */
.filter-pills-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.filter-pill-item {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #d9c9a3;
    background-color: #f0e9d2;
    color: #5d4037;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill-item:hover {
    background-color: #e6ddc4;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-pill-item.active {
    background-color: #7a5c2e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Filter Sections Wrapper */
.filter-sections {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    transition-delay: 0.15s;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.filter-sidebar.show .filter-sections {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 40px 20px;
    margin: 20px 0;
    background-color: #f9f5e8;
    border-radius: 10px;
    color: #7a5c2e;
    font-size: 16px;
    border: 1px dashed #d9c9a3;
}

.no-results i {
    display: block;
    font-size: 32px;
    margin-bottom: 15px;
    color: #c8b790;
}

/* Result Count */
.result-count {
    background-color: #f1ebd7;
    color: #7a5c2e;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 15px;
    display: inline-block;
}

.result-count span {
    font-weight: 500;
}

/* No More Results Message */
.no-more-results {
    text-align: center;
    color: #9b8a6c;
    padding: 15px;
    margin: 10px 0;
    font-style: italic;
    transition: opacity 0.5s ease;
} 