/* ==========================================================================
   Chế độ xem sản phẩm dạng danh sách (list) cho trang danh mục / quà tặng.
   Toggle nằm ở .woodmart-products-shop-view (_ShopLoopHead.cshtml), JS xử lý
   trong js/product-view-toggle.js -> chỉ thêm/bớt class .products-view-list
   trên #list-product-category, nên sản phẩm tải thêm bằng AJAX cũng tự khớp.

   QUAN TRỌNG: toàn bộ layout list chỉ áp dụng từ 768px trở lên. Trên mobile
   giữ nguyên lưới như hiện tại (yêu cầu của khách hàng).
   ========================================================================== */

/* Nút "Xem chi tiết" chỉ dùng cho list view, mặc định ẩn ở dạng lưới */
.list-view-actions {
    display: none;
}

@media (min-width: 768px) {

    /* Bỏ float của bootstrap grid, mỗi sản phẩm là một hàng đầy đủ */
    #list-product-category.products-view-list > .product-grid-item {
        width: 100%;
        max-width: 100%;
        float: none;
        clear: both;
        margin-bottom: 30px;
    }

    #list-product-category.products-view-list > .product-grid-item:last-child {
        margin-bottom: 0;
    }

    #list-product-category.products-view-list .product-components {
        display: flex;
        align-items: flex-start;
        /* wp-custom.css khoá cứng height: 365px cho card dạng lưới */
        height: auto;
        min-height: 0;
        overflow: hidden;
        transition: box-shadow .25s ease;
    }

    #list-product-category.products-view-list .product-components:hover {
        box-shadow: 0 4px 18px rgba(0, 0, 0, .08);
    }

    /* --- Cột ảnh --- */
    #list-product-category.products-view-list .product-element-top {
        flex: 0 0 34%;
        max-width: 34%;
        position: relative;
    }

    #list-product-category.products-view-list .product-element-top .product-image-link {
        display: block;
    }

    /* Ảnh lưới bị ép height: 250px !important trong wp-custom.css */
    #list-product-category.products-view-list .product-element-top img {
        width: 100%;
        height: 240px !important;
        object-fit: cover;
        border-radius: 0;
        display: block;
    }

    /* Ảnh hover + nút overlay của dạng lưới không hợp với list -> tắt */
    #list-product-category.products-view-list .hover-img,
    #list-product-category.products-view-list .wrapp-battons,
    #list-product-category.products-view-list .quick-shop-wrapper {
        display: none !important;
    }

    #list-product-category.products-view-list .conditions-box {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 2;
    }

    /* --- Cột thông tin --- */
    #list-product-category.products-view-list .item-description {
        flex: 1 1 auto;
        min-width: 0;
        text-align: left;
        padding: 25px 30px;
        align-self: center;
    }

    #list-product-category.products-view-list .product-title {
        font-size: 18px;
        line-height: 1.4;
        margin-bottom: 15px;
        text-align: left;
    }

    #list-product-category.products-view-list .group-star-sale {
        justify-content: flex-start;
        margin-bottom: 12px;
    }

    /* Ở dạng lưới "Đã Bán" được ghim absolute sang mép phải card,
       trong list thì cho nằm ngay cạnh phần sao đánh giá. */
    #list-product-category.products-view-list .group-star-sale .sale,
    #list-product-category.products-view-list .group-price-sale span.sale {
        position: static;
        right: auto;
        bottom: auto;
        margin: 0 0 0 20px;
        padding-top: 0;
    }

    #list-product-category.products-view-list .group-price-sale {
        justify-content: flex-start;
    }

    #list-product-category.products-view-list .price {
        font-size: 20px;
        position: relative;
        display: inline-block;
    }

    /* Ở dạng lưới, giá gạch được đẩy sang phải bằng position:absolute;
       trong list thì cho nằm ngay cạnh giá bán. */
    #list-product-category.products-view-list .price del {
        position: static !important;
        right: auto !important;
        margin-left: 15px;
        font-size: 15px;
    }

    #list-product-category.products-view-list .list-view-actions {
        display: block;
        margin-top: 20px;
    }

    #list-product-category.products-view-list .list-view-btn {
        display: inline-block;
        padding: 9px 26px;
        border: 1px solid #fcc627;
        border-radius: 30px;
        color: #2d2a2a;
        font-size: 13px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .5px;
        transition: background-color .2s ease, color .2s ease;
    }

    #list-product-category.products-view-list .list-view-btn:hover,
    #list-product-category.products-view-list .list-view-btn:focus {
        background-color: #fcc627;
        color: #fff;
        text-decoration: none;
    }
}

/* Màn hình vừa: thu nhỏ cột ảnh lại một chút cho phần chữ đủ chỗ */
@media (min-width: 768px) and (max-width: 991px) {
    #list-product-category.products-view-list .product-element-top {
        flex-basis: 40%;
        max-width: 40%;
    }

    #list-product-category.products-view-list .item-description {
        padding: 18px 20px;
    }

    #list-product-category.products-view-list .product-title {
        font-size: 16px;
    }
}
