body {
    background-color: #fdf6eb;
    margin: 0;
}

.page-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .sidebar {
        width: 200px;
        padding: 16px;
        background: #f5f5f5;
        height: 100vh;
        box-sizing: border-box;
    }

    .left-sidebar {
        border-right: 1px solid #ddd;
    }

    .right-sidebar {
        border-left: 1px solid #ddd;
    }

    #main-content {
        flex: 1;
        padding: 16px;
    }
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: scale(1.02);
}

.card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.card-body {
    padding: 0.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.card-text {
    font-size: 0.9rem;
    color: #444;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #eee;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    border-top: 1px solid #ccc;
}

.footer a {
    text-decoration: none;
    color: #555;
    text-align: center;
    font-size: 0.9rem;
}

h2 {
    text-align: center;
    color: #5a2da0;
}

.post {
    background: white;
    padding: 30px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.post h3 {
    margin-top: 0;
}

.post img {
    height: 80px;
    margin-right: 5px;
    margin-top: 10px;
    border-radius: 4px;
}

.images {
    margin-top: 100px;
}

.product {
    background: white;
    border-radius: 5px;
    padding: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
}

.product-title {
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
}

.product-price {
    font-size: 16px;
    color: red;
}

.product-adress {
    font-size: 14px;
    margin-bottom: 1px;
    margin-top: 1px;
}

.product-meta {
    font-size: 12px;
    color: gray;
}

.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 7px;
    margin-bottom: 1px;
}

#post-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 5px;
}

#loader {
    text-align: center;
    padding: 15px;
    font-size: 14px;
    color: #888;
}

.container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 5px;
}

.post-card {
    background: #fff;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;  /* cho phép đặt absolute bên trong */
    min-height: 300px;   /* đảm bảo đủ chỗ cho nội dung + footer */
}

.post-card img {
    display: block;
    border-radius: 8px;
    padding: 7px;
    width: 100%;
    height: 210px;
    object-fit: calc();
}

.post-card h3 {
    margin: 3px 7px 60px;
    font-size: 1rem;
    color: #333;
    flex-grow: 1;

    /* Giới hạn tối đa 2 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 2;      /* 👉 tối đa 2 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;        /* đảm bảo xuống dòng đúng */
    line-height: 1.4em;         /* chiều cao mỗi dòng */
    max-height: calc(1.5em * 2); /* khóa đúng 2 dòng */
}

.post-card .bottom-info {
    position: absolute;
    bottom: 7px;
    left: 7px;
    right: 7px;
}

.post-card .dichvu {
    margin: 2px 0 0;
    font-size: 0.9rem;
    color: #777;
}

.post-card .gia {
    margin: 0;
    margin-bottom: 3px;
    font-weight: nomal;
    color: black;

    /* Giới hạn tối đa 2 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 1;      /* 👉 tối đa 2 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;        /* đảm bảo xuống dòng đúng */
    line-height: 1.3em;         /* chiều cao mỗi dòng */
    max-height: calc(1.3em * 1); /* khóa đúng 1 dòng */
}

.post-card .location {
    margin: 2px 0 0;
    font-size: 0.9rem;
    color: #777;
}

.notice-bar {
    background-color: #fff3cd;
    color: #b94a48;
    padding: 1px;
    font-weight: bold;
    font-size: 16px;
    border-top: 4px solid #fff3cd;
    border-bottom: 1px solid #fce5b9;
    text-align: center;
}

#scrollTopBtn {
    position: fixed;
    bottom: 135px; /* cao hơn scrollTopBtn */
    right: 16px;
    z-index: 600;
    background: rgba(128, 64, 255, 0.8);
    color: rgb(247, 177, 85);
    border: none;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 100%;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: opacity 0.3s;
}

#filter-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 6px;
    background: #fdf6eb;
    flex-wrap: wrap;
}

#filter-bar select,
#filter-bar button {
    padding: 5px 8px;
    border: none;
    border-radius: 5px;
    background: #f0f0f0;
    color: #000;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    outline: none;
    appearance: none;
    text-align: center;
}

#filter-bar button {
    cursor: pointer;
    font-weight: bold;
}

.pi-price-container {
    margin: 0;
    margin-bottom: 5px;
    padding: 0;
    font-family: Arial, sans-serif;
}

.pi-price-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
    text-align: center;
}

.pi-price-table th,
.pi-price-table td {
    border: 1px solid gray;
    padding: 4px;
    font-size: 14px;
    width: 50%;
}

#popup-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 92%;
    background: #000000aa;
    z-index: 999;
}

#popup-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#popup-box {
    width: 95%;
    height: 95%;
    margin: auto;
    background: white;
    position: relative;
    top: 2%;
    border-radius: 10px;
    overflow: hidden;
}

#popup-box button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #900;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}