/* ========================================================
   GIAO DIỆN SẢN PHẨM WOOCOMMERCE – BOBOON
   Theme Vantage • Desktop • Tablet • Mobile
======================================================== */

:root {
    --bp-green: #28613d;
    --bp-green-dark: #153c27;
    --bp-green-light: #e8f2e8;
    --bp-gold: #c48a3a;
    --bp-red: #d94b45;
    --bp-cream: #faf7ef;
    --bp-text: #26372d;
    --bp-muted: #778179;
    --bp-border: #e7ece8;
    --bp-white: #ffffff;
}

/* ========================================================
   TIÊU ĐỀ KHU VỰC SẢN PHẨM
======================================================== */

.woocommerce .products > h2,
.woocommerce .related.products > h2,
.woocommerce .upsells.products > h2,
.woocommerce .cross-sells > h2 {
    position: relative;

    margin: 0 0 35px;
    padding-bottom: 17px;

    color: var(--bp-green-dark);

    font-family:
        "Be Vietnam Pro",
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: clamp(27px, 3vw, 38px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.8px;
    text-align: center;
}

.woocommerce .related.products > h2::after,
.woocommerce .upsells.products > h2::after,
.woocommerce .cross-sells > h2::after {
    content: "";

    position: absolute;
    bottom: 0;
    left: 50%;

    width: 55px;
    height: 3px;

    border-radius: 10px;
    background: var(--bp-gold);

    transform: translateX(-50%);
}

/* ========================================================
   LƯỚI SẢN PHẨM
======================================================== */

.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;

    margin: 0 !important;
    padding: 0 !important;

    list-style: none;
}

/* Hủy float mặc định WooCommerce */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    position: relative;

    display: flex;
    flex-direction: column;

    float: none !important;
    width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 0 18px !important;

    overflow: hidden;

    border: 1px solid var(--bp-border);
    border-radius: 17px;

    background: var(--bp-white);

    box-shadow:
        0 5px 17px rgba(25, 64, 39, 0.055);

    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease;
}

.woocommerce ul.products li.product:hover {
    border-color: rgba(40, 97, 61, 0.25);

    transform: translateY(-7px);

    box-shadow:
        0 18px 42px rgba(25, 64, 39, 0.14);
}

/* ========================================================
   KHUNG HÌNH SẢN PHẨM
======================================================== */

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    position: relative;

    display: flex;
    flex: 1;
    flex-direction: column;

    color: var(--bp-text);
    text-decoration: none !important;
}

.woocommerce ul.products li.product a img {
    display: block;

    width: 100% !important;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 0 17px !important;

    border-radius: 0;

    background:
        linear-gradient(
            145deg,
            #fbfcf9 0%,
            #f0f5ed 100%
        );

    object-fit: cover;
    object-position: center;

    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.3s ease;
}

.woocommerce ul.products li.product:hover a img {
    transform: scale(1.045);
    filter: saturate(1.04);
}

/* Tránh ảnh phóng ra ngoài card */
.woocommerce ul.products li.product
a.woocommerce-LoopProduct-link {
    overflow: hidden;
}

.woocommerce ul.products li.product
.woocommerce-loop-product__title,
.woocommerce ul.products li.product
.star-rating,
.woocommerce ul.products li.product
.price {
    position: relative;
    z-index: 2;
}

/* ========================================================
   NHÃN GIẢM GIÁ
======================================================== */

.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale {
    position: absolute;
    top: 13px !important;
    right: auto !important;
    left: 13px !important;
    z-index: 10;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    min-width: 52px;
    min-height: 27px;
    margin: 0 !important;
    padding: 5px 10px !important;

    border: 0;
    border-radius: 7px;

    background: var(--bp-red);
    color: var(--bp-white);

    box-shadow:
        0 7px 17px rgba(217, 75, 69, 0.25);

    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.35px;
    text-transform: uppercase;
}

/* ========================================================
   TÊN SẢN PHẨM
======================================================== */

.woocommerce ul.products li.product
.woocommerce-loop-product__title {
    display: -webkit-box;

    min-height: 48px;
    margin: 0 !important;
    padding: 0 17px 6px !important;

    overflow: hidden;

    color: var(--bp-green-dark);

    font-family:
        "Be Vietnam Pro",
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.55 !important;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    transition: color 0.25s ease;
}

.woocommerce ul.products li.product:hover
.woocommerce-loop-product__title {
    color: var(--bp-green);
}

/* ========================================================
   ĐÁNH GIÁ SAO
======================================================== */

.woocommerce ul.products li.product .star-rating {
    width: 5.55em;
    height: 1em;
    margin: 5px 17px 10px !important;

    color: #eda827;

    font-size: 12px;
    line-height: 1;
}

.woocommerce ul.products li.product .star-rating::before {
    color: #d8ddd9;
}

/* ========================================================
   GIÁ SẢN PHẨM
======================================================== */

.woocommerce ul.products li.product .price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;

    min-height: 30px;
    margin: auto 0 13px !important;
    padding: 6px 17px 0;

    color: var(--bp-red) !important;

    font-size: 17px !important;
    font-weight: 800 !important;
    line-height: 1.4;
}

.woocommerce ul.products li.product .price ins {
    background: transparent;
    color: var(--bp-red);

    font-weight: 800;
    text-decoration: none;
}

.woocommerce ul.products li.product .price del {
    order: 2;

    color: #9ba39d;
    opacity: 1;

    font-size: 12px;
    font-weight: 500;
}

/* ========================================================
   NÚT THÊM VÀO GIỎ HÀNG
======================================================== */

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product
.add_to_cart_button,
.woocommerce ul.products li.product
.product_type_simple,
.woocommerce ul.products li.product
.product_type_variable,
.woocommerce ul.products li.product
.product_type_external {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: auto;
    min-height: 43px;
    margin: 0 17px !important;
    padding: 11px 15px !important;

    border: 1px solid var(--bp-green) !important;
    border-radius: 9px !important;

    background: var(--bp-green) !important;
    color: var(--bp-white) !important;

    box-shadow:
        0 8px 18px rgba(40, 97, 61, 0.17);

    font-family:
        "Be Vietnam Pro",
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.2px;
    text-align: center;
    text-transform: uppercase;

    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product
.add_to_cart_button:hover {
    border-color: var(--bp-green-dark) !important;
    background: var(--bp-green-dark) !important;
    color: var(--bp-white) !important;

    transform: translateY(-2px);

    box-shadow:
        0 11px 23px rgba(40, 97, 61, 0.25);
}

/* Biểu tượng giỏ hàng */
.woocommerce ul.products li.product
.add_to_cart_button::before {
    content: "";

    display: inline-block;

    width: 17px;
    height: 17px;

    background-color: currentColor;

    -webkit-mask-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M3 4h2l2.2 10.2a2 2 0 0 0 2 1.6h7.9a2 2 0 0 0 2-1.6L21 7H6M10 20a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm9 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z'/%3E%3C/svg%3E");

    mask-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M3 4h2l2.2 10.2a2 2 0 0 0 2 1.6h7.9a2 2 0 0 0 2-1.6L21 7H6M10 20a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm9 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z'/%3E%3C/svg%3E");

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Nút xem lựa chọn không cần biểu tượng giỏ */
.woocommerce ul.products li.product
.product_type_variable::before,
.woocommerce ul.products li.product
.product_type_external::before {
    display: none;
}

/* ========================================================
   NÚT ĐÃ THÊM VÀO GIỎ
======================================================== */

.woocommerce ul.products li.product
.added_to_cart {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    margin: 9px 17px 0;
    padding: 9px 13px;

    border: 1px solid rgba(40, 97, 61, 0.22);
    border-radius: 8px;

    background: var(--bp-green-light);
    color: var(--bp-green) !important;

    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
    text-decoration: none;
    text-transform: uppercase;
}

/* Biểu tượng loading */
.woocommerce ul.products li.product
.add_to_cart_button.loading {
    padding-right: 38px !important;
    opacity: 0.8;
}

.woocommerce ul.products li.product
.add_to_cart_button.added::after {
    color: #ffffff;
}

/* ========================================================
   NHÃN TÙY CHỈNH: BÁN CHẠY
   Có thể thêm class "ban-chay" vào sản phẩm
======================================================== */

.woocommerce ul.products li.product.product_cat-ban-chay::before,
.woocommerce ul.products li.product.tag-ban-chay::before {
    content: "Bán chạy";

    position: absolute;
    top: 13px;
    right: 13px;
    z-index: 10;

    padding: 6px 10px;

    border-radius: 7px;

    background: var(--bp-gold);
    color: #ffffff;

    box-shadow:
        0 7px 17px rgba(196, 138, 58, 0.22);

    font-size: 9px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.35px;
    text-transform: uppercase;
}

/* ========================================================
   PHÂN TRANG
======================================================== */

.woocommerce nav.woocommerce-pagination {
    margin-top: 45px;
    text-align: center;
}

.woocommerce nav.woocommerce-pagination ul {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 7px;

    margin: 0;
    padding: 0;

    border: 0;
}

.woocommerce nav.woocommerce-pagination ul li {
    overflow: visible;
    margin: 0;

    border: 0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 41px;
    height: 41px;
    padding: 0;

    border: 1px solid var(--bp-border);
    border-radius: 9px;

    background: #ffffff;
    color: var(--bp-green-dark);

    font-size: 12px;
    font-weight: 700;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.woocommerce nav.woocommerce-pagination ul li
span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover {
    border-color: var(--bp-green);
    background: var(--bp-green);
    color: #ffffff;
}

/* ========================================================
   SẮP XẾP VÀ SỐ LƯỢNG KẾT QUẢ
======================================================== */

.woocommerce .woocommerce-result-count {
    color: var(--bp-muted);
    font-size: 12px;
    line-height: 42px;
}

.woocommerce .woocommerce-ordering {
    margin-bottom: 25px;
}

.woocommerce .woocommerce-ordering select {
    min-height: 43px;
    padding: 8px 38px 8px 14px;

    border: 1px solid var(--bp-border);
    border-radius: 9px;

    background-color: #ffffff;
    color: var(--bp-text);

    font-size: 12px;

    outline: none;
}

.woocommerce .woocommerce-ordering select:focus {
    border-color: var(--bp-green);
    box-shadow:
        0 0 0 3px rgba(40, 97, 61, 0.10);
}

/* ========================================================
   SẢN PHẨM LIÊN QUAN
======================================================== */

.woocommerce .related.products,
.woocommerce .upsells.products {
    clear: both;
    margin-top: 65px;
    padding-top: 55px;

    border-top: 1px solid var(--bp-border);
}

/* ========================================================
   TABLET – 3 SẢN PHẨM MỖI HÀNG
======================================================== */

@media (max-width: 1050px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 19px;
    }

    .woocommerce ul.products li.product
    .woocommerce-loop-product__title {
        font-size: 13px !important;
    }
}

/* ========================================================
   ĐIỆN THOẠI – 2 SẢN PHẨM MỖI HÀNG
======================================================== */

@media (max-width: 767px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .woocommerce ul.products li.product,
    .woocommerce-page ul.products li.product {
        padding-bottom: 12px !important;

        border-radius: 12px;

        box-shadow:
            0 4px 13px rgba(25, 64, 39, 0.06);
    }

    .woocommerce ul.products li.product:hover {
        transform: translateY(-3px);
    }

    .woocommerce ul.products li.product a img {
        margin-bottom: 12px !important;
    }

    .woocommerce ul.products li.product
    .woocommerce-loop-product__title {
        min-height: 43px;
        padding: 0 10px 5px !important;

        font-size: 11px !important;
        line-height: 1.55 !important;
    }

    .woocommerce ul.products li.product .star-rating {
        margin: 3px 10px 7px !important;
        font-size: 10px;
    }

    .woocommerce ul.products li.product .price {
        min-height: 27px;
        margin-bottom: 9px !important;
        padding: 4px 10px 0;

        font-size: 14px !important;
    }

    .woocommerce ul.products li.product .price del {
        font-size: 9px;
    }

    .woocommerce ul.products li.product .button,
    .woocommerce ul.products li.product
    .add_to_cart_button,
    .woocommerce ul.products li.product
    .product_type_simple,
    .woocommerce ul.products li.product
    .product_type_variable,
    .woocommerce ul.products li.product
    .product_type_external {
        min-height: 39px;
        margin: 0 10px !important;
        padding: 9px 7px !important;

        border-radius: 7px !important;

        font-size: 9px !important;
        letter-spacing: 0;
    }

    .woocommerce ul.products li.product
    .add_to_cart_button::before {
        width: 14px;
        height: 14px;
    }

    .woocommerce ul.products li.product
    .added_to_cart {
        min-height: 36px;
        margin: 7px 10px 0;
        font-size: 8px;
    }

    .woocommerce span.onsale,
    .woocommerce ul.products li.product .onsale {
        top: 8px !important;
        left: 8px !important;

        min-width: 42px;
        min-height: 22px;
        padding: 4px 7px !important;

        border-radius: 5px;

        font-size: 8px;
    }

    .woocommerce ul.products li.product.product_cat-ban-chay::before,
    .woocommerce ul.products li.product.tag-ban-chay::before {
        top: 8px;
        right: 8px;

        padding: 4px 7px;

        border-radius: 5px;

        font-size: 7px;
    }

    .woocommerce .woocommerce-result-count,
    .woocommerce .woocommerce-ordering {
        float: none;
        width: 100%;
        margin-bottom: 13px;
    }

    .woocommerce .woocommerce-result-count {
        line-height: 1.5;
        text-align: center;
    }

    .woocommerce .woocommerce-ordering select {
        width: 100%;
    }

    .woocommerce .related.products,
    .woocommerce .upsells.products {
        margin-top: 43px;
        padding-top: 38px;
    }
}

/* ========================================================
   ĐIỆN THOẠI RẤT NHỎ
======================================================== */

@media (max-width: 370px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        gap: 8px;
    }

    .woocommerce ul.products li.product
    .woocommerce-loop-product__title {
        padding-right: 8px !important;
        padding-left: 8px !important;
        font-size: 10px !important;
    }

    .woocommerce ul.products li.product .price {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 12px !important;
    }

    .woocommerce ul.products li.product .button,
    .woocommerce ul.products li.product
    .add_to_cart_button,
    .woocommerce ul.products li.product
    .product_type_simple,
    .woocommerce ul.products li.product
    .product_type_variable {
        margin-right: 8px !important;
        margin-left: 8px !important;
        font-size: 8px !important;
    }
}

/* ========================================================
   KHẢ NĂNG TRUY CẬP VÀ GIẢM CHUYỂN ĐỘNG
======================================================== */

.woocommerce ul.products li.product a:focus-visible,
.woocommerce ul.products li.product .button:focus-visible {
    outline: 3px solid rgba(196, 138, 58, 0.70);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .woocommerce ul.products li.product,
    .woocommerce ul.products li.product a img,
    .woocommerce ul.products li.product .button {
        transition: none;
    }
}
/* Ẩn toàn bộ khu vực bình luận trong bài viết */
.single-post #comments,
.single-post .comments-area,
.single-post .comment-respond,
.single-post #respond,
.single-post .comment-form,
.single-post .comments-title,
.single-post .comment-list,
.single-post .comment-navigation,
.single-post .no-comments,
.single-post .comments-link {
    display: none !important;
}