/* ======= BỘ LỌC DESKTOP ======= */
.wm-filter-form {
    display: flex;
    flex-direction: row; /* Xếp thành hàng ngang */
    flex-wrap: wrap;
    gap: 8px; /* Khoảng cách nhỏ giữa các phần tử */
    align-items: center; /* Căn giữa theo chiều dọc để thẳng hàng */
    margin: 15px 0 20px 0;
    justify-content: flex-start;
    border-top: 1px solid #000; /* Đường kẻ trên giống ảnh */
    padding-top: 10px;
}
.wm-filter-group {
    display: flex;
    flex-direction: column; /* Nhãn trên, select dưới */
    min-width: 100px;
    justify-content: flex-start; /* Căn trên */
    align-items: flex-start; /* Căn trái */
}
.wm-filter-group label {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
    color: #7c1c2b;
}
.wm-filter-form select {
    height: 36px;
    padding: 5px 8px;
    border-radius: 3px;
    border: 1px solid #ccc;
    min-width: 150px; /* Điều chỉnh chiều rộng hợp lý */
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
    line-height: 1.2;
}
.wm-filter-apply {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px; /* Đồng nhất với select */
    min-width: 120px; /* Kéo dài nút */
    background: #a91d36;
    color: #fff;
    border: none; /* Bỏ viền */
    border-radius: 3px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    padding: 0 20px; /* Tăng padding để kéo dài */
	margin-top: 27px;
    transition: background 0.2s, color 0.2s;
    margin-left: auto; /* Căn phải */
    flex-shrink: 0; /* Ngăn nút bị co lại */
}
.wm-filter-apply:hover {
    background: #7c1c2b;
    color: #fff;
}

/* ======= BẢNG SẢN PHẨM DESKTOP ======= */
.wm-wine-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 15px;
    background: #fff;
}
.wm-wine-table th, .wm-wine-table td {
    border: 1px solid #eee;
    padding: 8px 6px;
    text-align: center;
    vertical-align: middle;
    max-width: 180px;
    word-break: break-word;
}
.wm-wine-table th {
    background: #7c1c2b;
    color: #fff;
    font-weight: bold;
}
.wm-wine-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}
.wm-wine-table a {
    color: #7c1c2b;
    text-decoration: none;
    font-weight: 600;
}
.wm-wine-table img {
    max-width: 50px;
    border-radius: 3px;
}
.wm-wine-table .wm-add-cart {
    text-align: center;
}
.wm-wine-table .wm-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #a91d36;
    border: 2px solid #a91d36;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}
.wm-wine-table .wm-buy-btn i {
    font-size: 12px;
    margin: 0;
}
.wm-wine-table .wm-buy-btn:hover {
    background: #a91d36;
    color: #fff;
}
.wm-wine-table .wm-buy-btn:hover i {
    color: #fff;
}
.wm-wine-table .add_to_cart_button {
    display: none !important;
}

/* ======= PHÂN TRANG ======= */
.wm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
    gap: 4px;
}
.wm-pagination a, .wm-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    margin: 0 2px;
    background: #a91d36;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, transform 0.1s;
}
.wm-pagination a:hover {
    background: #7c1c2b;
    transform: scale(1.05);
}
.wm-pagination .current {
    background: #7c1c2b;
    font-weight: bold;
    cursor: default;
}
.wm-pagination .dots {
    background: none;
    color: #7c1c2b;
    padding: 6px;
    font-weight: bold;
}
.wm-pagination a.prev, .wm-pagination a.next {
    font-size: 12px;
}

/* ======= NÚT BỘ LỌC MOBILE ======= */
.wm-mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 15px;
    right: 15px;
    background: #a91d36;
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(124,28,43,0.20);
    border: none;
    cursor: pointer;
    align-items: center;
    gap: 8px;
}
.wm-mobile-filter-btn i {
    font-size: 16px;
    margin-right: 4px;
}

/* ======= POPUP BỘ LỌC MOBILE ======= */
.wm-mobile-filter-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
}
.wm-mobile-filter-content {
    background: #fff;
    border-radius: 15px 15px 0 0;
    padding: 15px 18px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 -2px 12px rgba(124,28,43,0.12);
    position: relative;
    animation: slideUp 0.2s;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.wm-mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
}
.wm-mobile-filter-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #a91d36;
    cursor: pointer;
}
.wm-mobile-filter-form .wm-filter-group {
    margin-bottom: 12px;
}
.wm-mobile-filter-form .wm-filter-apply {
    width: 100%;
    margin-top: 8px;
    font-size: 16px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #a91d36;
    border-radius: 3px;
    border: none;
    color: #fff;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}
.wm-mobile-filter-form .wm-filter-apply:hover {
    background: #7c1c2b;
    color: #fff;
}

/* ======= DANH SÁCH/CARD MOBILE ======= */
.wm-mobile-list {
    display: none;
    margin: 15px 0;
}
.wm-mobile-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(124,28,43,0.06);
    margin-bottom: 12px;
    padding: 8px;
    gap: 10px;
}
.wm-mobile-card img {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}
.wm-mobile-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.wm-mobile-card-title {
    font-weight: bold;
    font-size: 14px;
    color: #7c1c2b;
    margin-bottom: 2px;
    line-height: 1.2;
}
.wm-mobile-card-attrs {
    font-size: 12px;
    color: #444;
    margin-bottom: 2px;
    line-height: 1.2;
}
.wm-mobile-card-attrs a,
.wm-mobile-attr-link {
    color: #a91d36;
    text-decoration: underline;
    margin-right: 6px;
    font-size: 12px;
}
.wm-mobile-card-price {
    font-weight: bold;
    color: #a91d36;
    font-size: 13px;
    margin-bottom: 2px;
}
.wm-mobile-card-buy {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 2px;
}
.wm-mobile-card-buy .wm-buy-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
    border-radius: 50%;
    background: #fff;
    color: #a91d36;
    border: 2px solid #a91d36;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}
.wm-mobile-card-buy .wm-buy-btn:hover {
    background: #a91d36;
    color: #fff;
}
.wm-mobile-card-buy .add_to_cart_button {
    display: none !important;
}

/* ======= RESPONSIVE ======= */
@media (max-width: 800px) {
    .wm-wine-table { display: none !important; }
    .wm-mobile-list { display: block !important; }
    .wm-filter-form { display: none !important; }
    .wm-mobile-filter-btn { display: flex !important; }
    .wm-filter-group {
        min-width: 90px;
    }
    .wm-filter-form select {
        min-width: 90px;
        height: 32px;
        padding: 4px 6px;
        font-size: 12px;
    }
    .wm-filter-apply {
        height: 32px;
        min-width: 80px;
        font-size: 12px;
        padding: 0 15px;
    }
    .wm-pagination {
        gap: 3px;
    }
    .wm-pagination a, .wm-pagination span {
        padding: 4px 8px;
        font-size: 10px;
        margin: 0 1px;
    }
    .wm-pagination a.prev {
        content: "Trước";
    }
    .wm-pagination a.next {
        content: "Sau";
    }
}
@media (min-width: 801px) {
    .wm-mobile-list { display: none !important; }
}

/* Show popup when active */
body.wm-mobile-filter-active .wm-mobile-filter-popup {
    display: flex !important;
}