/* Archive */
@media (max-width: 768px) {
    .bds-list-wrapper, .bds-sidebar {
        width: 100% !important;
        padding: 0;
    }
}

.bds-main-container.container:after{
    content: none;
    padding: 0 15px;
}

.form-filter-container.container {
    padding-top: 40px;
}

.bds-main-container {
    display: flex;
    justify-content: space-between;
    padding-top: 40px !important;
    gap: 30px;
}

body.archive main#main {
    background: #F9FAFB;
}

.bds-list-wrapper.left-col {
    width: 75%; 
}


.bds-information p {
    color: #EE1D25;
    font-weight: 600;
    font-size: 16px;
}

p.bds-date {
	margin-bottom: 0;
    font-size: 14px;
    font-weight: 500;
    color: #637E9C;
}

.bds-content p {
    margin-bottom: 7px;
}

.bds-information {
    display: flex;
    gap: 8px;
}

.bds-image img {
    border-radius: 5px;
}

.bds-list-wrapper.left-col .bds-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}


.bds-item .bds-image img {
    width: 100%;
    height: auto;
}

.bds-item .bds-content h2 {
    color: #002956;
    font-weight: 700;
    line-height: 24px;
    font-size: 16px;
    margin: 10px 0;
}

p.bds-address {
    font-size: 14px;
    font-weight: 500;
    color: #002956;
}

.bds-price {
    font-weight: bold;
    color: #333;
}

.bds-area {
    font-size: 14px;
    color: #666;
}
.bds-pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 24px 0;
  flex-wrap: wrap;
}

.bds-pagination a,
.bds-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  color: #1e3a8a;
  background-color: #fff;
}

.bds-pagination a:hover {
  background-color: #e0e7ff;
  border-color: #6366f1;
}

.bds-pagination .current-page {
  background-color: #3b82f6;
  color: #fff;
  font-weight: bold;
  border-color: #3b82f6;
  pointer-events: none;
}

.bds-pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

.bds-pagination .dots {
  border: none;
  background: transparent;
  cursor: default;
  color: #6b7280;
}


/* Sidebar tùy chỉnh */
.bds-sidebar {
    width: 25%; 
    box-sizing: border-box;
}

li.bds-popular-item {
    margin-left: 0 !important;
}

.bds-sidebar-banner {
    margin-bottom: 20px;
}

.bds-popular-title {
    color: #002956;
    font-size: 14px;
}


li.bds-popular-item.h-thumbnail .bds-popular-title {
    font-weight: 700;
}

.bds-popular-thumbnail {
    margin-bottom: 10px;
}

.bds-popular-thumbnail img {
    border-radius: 5px;
    height: 200px;
    object-fit: cover;
    object-position: center;
}

.sidebar-popular-posts {
    padding: 20px;
    background: #fff;
    border-radius: 10px;
}

.bds-sidebar h3 {
    font-size: 18px;
    color: #002956;
}

.sidebar-content h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.sidebar-content ul {
    list-style: none;
    padding: 0;
}

.sidebar-content ul li {
    margin-bottom: 10px;
}

/* Phân trang */
.bds-pagination {
    margin-top: 20px;
    text-align: center;
}

.bds-pagination .page-numbers {
    padding: 5px 10px;
    margin: 0 5px;
    background-color: #ddd;
    border-radius: 5px;
}

.bds-pagination .current {
    background-color: #4caf50;
    color: white;
}

/* Mobile Styles (Tối ưu cho màn hình nhỏ) */
@media (max-width: 768px) {
    
    .bds-main-container {
        flex-direction: column;
    }

    .bds-list-wrapper {
        width: 100%; 
        margin-bottom: 20px; 
    }

    .bds-sidebar {
        width: 100%;
        padding: 15px; 
    }

    .bds-list {
        grid-template-columns: 1fr 1fr !important; 
    }


    .sidebar-content h3 {
        font-size: 18px; 
    }

    .sidebar-content ul li {
        font-size: 14px; 
    }

    .bds-pagination .page-numbers {
        font-size: 14px; 
        padding: 4px 8px; 
    }
}

/* Mobile Styles cho màn hình cực nhỏ (như điện thoại) */
@media (max-width: 480px) {


    .bds-item .bds-content h2 {
        font-size: 16px; 
    }

    .bds-price {
        font-size: 14px; 
    }

    .bds-area {
        font-size: 12px; 
    }

    .sidebar-content ul li {
        font-size: 12px; 
    }
}

/*Single post*/

/* Đảm bảo container có chiều rộng đầy đủ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
body.single-bds #main {
    background: #F9FAFB;
}

.bds-sidebar.single-sidebar li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: solid 2px #E0E4F0;
}

.bds-sidebar.single-sidebar li:last-child {
    border: none;
    margin: 0;
    padding: 0;
}

.bds-box-1 {
    background: #fff;
    padding: 15px;
    border-radius: 5px;
}

.bds-content h3, .bds-meta-ggmap h3, .bds-danh-cho-ban h3 {
    color: #002956;
    font-size: 18px;
}

h1.post-title {
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
    margin: 0 0 15px 0;
    line-height: 1;
    font-size: 24px;
    color: #002956;
}

body.single-bds .bds-content {
    font-weight: 500;
    color: #002956;
    font-size: 16px;
}

.bds-meta-address {
    font-size: 16px;
    color: #002956;
}

.bds-meta > p {
    display: flex;
    flex-direction: column;
}

p.bds-meta-price span.bds-meta-price-m2 {
    font-weight: 500;
    color: #002956;
    font-size: 14px;
    margin: 0;
}

p.bds-meta-area, p.bds-meta-bedrooms {
    padding-left: 15px;
    border-left: 2px solid #ddd;
}

.bds-meta p {
    width: 30%;
}

p.bds-meta-price span {
	font-size: 18px;
    font-weight: 700;
    color: #EE1D25;
}

.bds-meta {
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    color: #002956;
}

.bds-meta span {
    margin-top: 10px;
}

/* Bố cục thumbnail */
.post-thumbnail img {
    width: 100%;
    height: auto;
    margin-bottom: 20px;
}

/* Cấu trúc carousel */
.carousel-container {
    margin-bottom: 20px;
}

.carousel {
    display: flex;
    flex-wrap: wrap; /* Đảm bảo các item trong carousel không bị tràn ra ngoài */
    gap: 10px; /* Khoảng cách giữa các ảnh */
}

.carousel-item {
    flex: 1 0 16%; /* Mỗi item có độ rộng là 16%, 6 ảnh mỗi lần */
    box-sizing: border-box;
}

.carousel-item img {
    object-position: center;
    width: 100%;
    height: 100px;
    max-width: 100%;
    object-fit: cover;
}

/* Tiêu đề bài viết */
.post-title {
    font-size: 2em;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Các phần khác */


body.single-bds .bds-content, .bds-meta-ggmap, .bds-danh-cho-ban {
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    margin: 20px 0;
}

/* Bố cục cột nội dung chính và sidebar */
.content-and-sidebar {
    padding-top: 40px;
    display: flex;
    flex-wrap: wrap;  
    gap: 20px;
}

/* Cột nội dung chính */
.main-content {
    flex: 3; /* Nội dung chiếm 75% */
    margin-bottom: 20px;
}

/* Cột sidebar */
body.single-bds .bds-sidebar {
    flex: 1; /* Sidebar chiếm 25% */
    margin-bottom: 20px;
}

.sidebar-dich-vu-ht, .sidebar-tv-mua-nha {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.sidebar-moi-gioi-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
}

.sidebar-moi-gioi-phone a:hover{
    color: #fff;
}

.tu-van-form p {
    margin-bottom: 10px !important;
    font-size: 14px;
    color: #637E9C;
}

.tu-van-form p > span {
    color: #002956;
}

.tu-van-form p > i {
    font-size: 10px;
    border-radius: 100%;
    margin-right: 5px;
    background: #0FD9CC;
    color: #fff;
    padding: 5px;
}
.tu-van-form span.wpcf7-spinner{
    display: none;
}

p.ho-ten input, p.sdt input {
    height: 50px;
    border-color: #CBD2E6;
}

p.ho-ten input::placeholder, p.sdt input::placeholder{
    font-size: 16px;
    color: #637E9C;
}

.bds-featured {
    height: 24px;
    margin-top: -24px;
    width: fit-content;
    left: 10px;
    top: 34px;
    font-size: 12px;
    border-radius: 100px;
    color: #fff;
    padding: 2px 8px;
    background: #EE1D25;
    position: relative;
}

p.ho-ten {
    padding-top: 10px !important;
}

.sidebar-tv-mua-nha input.wpcf7-submit {
    margin: 0;
    padding: 7px;
    width: 100%;
    border-radius: 100px;
    background: #334D95;
}

.sidebar-moi-gioi-head {
    display: flex;
    gap: 10px;
    margin-top: -50px;
}

.sidebar-moi-gioi-head-left img {
    width: 72px;
    height: 72px;
    border-radius: 100%;
    object-fit: cover;
    object-position: center;
}

.sidebar-moi-gioi-head-right p {
    color: #fff;
    font-size: 14px;
}

p.sidebar-moi-gioi-zalo span {
    margin-right: 8px;
    padding: 9px 5px;
    border-radius: 100%;
    background: #3C6BF6;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

p.sidebar-moi-gioi-zalo, p.sidebar-moi-gioi-phone {
    padding: 8px;
    border-radius: 100px;
    text-align: center;
    border: solid 2px #002956;
}

.sidebar-moi-gioi-phone, .sidebar-moi-gioi-phone a {
    font-size: 18px;
    color: #fff;
    background: #334D95;
    margin-bottom: 0;
}

p.sidebar-moi-gioi-zalo a {
    font-size: 14px;
    color: #002956;
}

p.sidebar-moi-gioi-address span, p.sidebar-moi-gioi-email span, p.sidebar-moi-gioi-experience span {
    font-size: 12px;
    color: #637E9C;
}

p.sidebar-moi-gioi-address, p.sidebar-moi-gioi-email, p.sidebar-moi-gioi-experience {
    font-size: 16px;
    color: #002956;
}

p.sidebar-moi-gioi-name {
    font-size: 18px;
    color: #002956;
}

.sidebar-moi-gioi-cn {
    background: linear-gradient(223.34deg, #386AF3 1.78%, #334D95 97.87%);
    padding: 50px 10px 10px 10px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Responsive: Tối ưu cho các màn hình nhỏ */
@media (max-width: 1024px) {
    /* Carousel: Điều chỉnh để hiển thị 4 ảnh trên màn hình nhỏ hơn 1024px */
    .carousel-item {
        flex: 1 0 23%;
    }

    /* Cột nội dung và sidebar trên màn hình nhỏ */
    .main-content {
        flex: 2; /* Khi màn hình nhỏ, cột nội dung chính chiếm 2/3 */
    }

    .bds-sidebar {
        flex: 1; /* Sidebar chiếm 1/3 */
    }
}

@media (max-width: 768px) {
    /* Carousel: Hiển thị 3 ảnh trên tablet */
    .carousel-item {
        flex: 1 0 30%;
    }

    /* Cột nội dung chính chiếm toàn bộ trên tablet */
    .main-content {
        flex: 1;
    }

    /* Ẩn sidebar trên màn hình nhỏ hơn */
    .bds-sidebar {
        display: none;
    }
}

@media (max-width: 480px) {
    /* Carousel: Hiển thị 1 ảnh trên di động */
    .carousel-item {
        flex: 1 0 90%;
    }
}
/*single*/
@media (max-width: 768px) {
    /* Đảm bảo mọi phần tử không bị tràn */
    .container,
    .content-and-sidebar,
    .main-content,
    .bds-sidebar,
    .bds-box-1,
    .bds-content,
    .sidebar-content,
    .sidebar-moi-gioi-cn,
    .sidebar-dich-vu-ht,
    .sidebar-tv-mua-nha {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Text dài không tràn ra ngoài */
    body,
    p,
    h1, h2, h3, h4, h5, h6,
    .bds-meta,
    .bds-meta p,
    .bds-meta-address,
    .sidebar-moi-gioi-body,
    .sidebar-moi-gioi-footer {
        word-break: break-word;
    }

    /* Ảnh chính */
    .main-image-wrapper img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    /* Ảnh thumbnail nhỏ lại */
    .gallery-thumbnail {
        width: 90px;
        height: 60px;
    }

    /* Gallery arrows nhỏ gọn hơn */
    .carousel-arrow {
        font-size: 18px;
        padding: 4px 8px;
    }

    /* Đảm bảo flex xuống dòng nếu cần */
    .sidebar-moi-gioi-head {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .sidebar-moi-gioi-head-left img {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: 50%;
    }

    .sidebar-moi-gioi-head-right {
        margin-left: 0;
        width: 100%;
        margin-top: 10px;
    }

    /* Đảm bảo form không tràn */
    .sidebar-tv-mua-nha form {
        width: 100% !important;
    }

    /* Cuộn ngang thumbnails mượt mà */
    .thumbnail-wrapper {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }
    .gallery-thumbnail {
        scroll-snap-align: start;
    }

    /* Button gọi/Zalo co gọn */
    .sidebar-moi-gioi-footer a {
        display: inline-block;
        padding: 6px 10px;
        font-size: 14px;
        background: #334d95;
        color: white;
        border-radius: 4px;
        text-decoration: none;
    }
    
    .main-image-wrapper img {
        height: 200px !important;
    }
    
    .gallery-thumbnail {
    width: 120px !important;
        height: 70px !important;
    }
}
.content-and-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}
.main-content {
    min-width: 0;
}
.bds-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .content-and-sidebar {
        flex-direction: column;
    }
    .bds-sidebar {
        width: 100%;
    }
}

/* Gallery */
.main-image-wrapper img {
    height: 500px;
    width: 100%;
    object-fit: cover;
    margin-bottom: 15px;
    border-radius: 8px;
}
.thumbnail-carousel-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}
.thumbnail-wrapper {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    width: 100%;
}
.thumbnail-wrapper::-webkit-scrollbar {
    display: none;
}
.post-gallery {
    margin-bottom: 20px;
}
    
.gallery-thumbnail {
    width: 170px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    flex: 0 0 auto;
    transition: 0.3s;
}
.gallery-thumbnail:hover {
    border: 2px solid #0073aa;
}
.carousel-arrow {
    background-color: #334d95;
    color: white;
    border: none;
    font-size: 24px;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    z-index: 10;
}
.left-arrow {
    margin-bottom: 0;
    margin-right: 10px;
}
.right-arrow {
    margin: 0 0 0 10px;
}
a.custom-button-sing {
    color: #334D95;
    border: solid 1px #334D95;
    border-radius: 100px;
    padding: 13px 25px;
    background: #F1F5FB;
}
.bds-danh-cho-ban {
    padding-bottom: 30px !important;
}

.dropdown-toggle.loading {
    position: relative;
    color: #3333331f;
}
.dropdown-toggle.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: calc(50% - 8px);
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  0%   { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}


