/* =========================================================
   SHOP / CATEGORY ARCHIVE ONLY
   /shop, /product-category/*, /product-tag/*
========================================================= */

/* Wrapper */
body.post-type-archive-product .site-main,
body.tax-product_cat .site-main,
body.tax-product_tag .site-main {
    padding: 40px 0;
}

/* Breadcrumb */
body.post-type-archive-product .woocommerce-breadcrumb,
body.tax-product_cat .woocommerce-breadcrumb,
body.tax-product_tag .woocommerce-breadcrumb {
    margin: 0 0 14px;
    font-size: 14px;
    color: #666;
}

body.post-type-archive-product .woocommerce-breadcrumb a,
body.tax-product_cat .woocommerce-breadcrumb a,
body.tax-product_tag .woocommerce-breadcrumb a {
    color: #0f6b5c;
    font-weight: 700;
}

/* Title */
body.post-type-archive-product .woocommerce-products-header__title,
body.tax-product_cat .woocommerce-products-header__title,
body.tax-product_tag .woocommerce-products-header__title {
    font-size: 34px;
    font-weight: 900;
    color: #0f6b5c;
    margin: 0 0 18px;
}

/* Result count + sorting */
body.post-type-archive-product .woocommerce-result-count,
body.tax-product_cat .woocommerce-result-count,
body.tax-product_tag .woocommerce-result-count {
    margin: 0;
    font-size: 14px;
    color: #555;
}

body.post-type-archive-product .woocommerce-ordering,
body.tax-product_cat .woocommerce-ordering,
body.tax-product_tag .woocommerce-ordering {
    margin: 0;
}

body.post-type-archive-product .woocommerce-ordering select,
body.tax-product_cat .woocommerce-ordering select,
body.tax-product_tag .woocommerce-ordering select {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, .15);
    background: #fff;
    font-size: 14px;
}

/* Grid (QUAN TRỌNG) */
body.post-type-archive-product .woocommerce ul.products,
body.tax-product_cat .woocommerce ul.products,
body.tax-product_tag .woocommerce ul.products {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

/* tắt clearfix */
body.post-type-archive-product .woocommerce ul.products::before,
body.post-type-archive-product .woocommerce ul.products::after,
body.tax-product_cat .woocommerce ul.products::before,
body.tax-product_cat .woocommerce ul.products::after,
body.tax-product_tag .woocommerce ul.products::before,
body.tax-product_tag .woocommerce ul.products::after {
    display: none !important;
    content: none !important;
}

/* Reset LI chống vỡ */
body.post-type-archive-product .woocommerce ul.products li.product,
body.tax-product_cat .woocommerce ul.products li.product,
body.tax-product_tag .woocommerce ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    clear: none !important;

    background: #fff;
    border-radius: 18px;
    padding: 14px;
    position: relative;
    overflow: hidden;

    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}

body.post-type-archive-product .woocommerce ul.products li.product:hover,
body.tax-product_cat .woocommerce ul.products li.product:hover,
body.tax-product_tag .woocommerce ul.products li.product:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .14);
}

/* Image */
body.post-type-archive-product .woocommerce ul.products li.product a img,
body.tax-product_cat .woocommerce ul.products li.product a img,
body.tax-product_tag .woocommerce ul.products li.product a img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 14px;
}

/* Title */
body.post-type-archive-product .woocommerce-loop-product__title,
body.tax-product_cat .woocommerce-loop-product__title,
body.tax-product_tag .woocommerce-loop-product__title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    margin: 12px 0 8px;
    color: #111;
}

/* Price */
body.post-type-archive-product .price,
body.tax-product_cat .price,
body.tax-product_tag .price {
    font-size: 16px;
    font-weight: 900;
    color: #0f6b5c;
}

body.post-type-archive-product .price del,
body.tax-product_cat .price del,
body.tax-product_tag .price del {
    color: #9aa0a6;
    font-weight: 700;
    margin-right: 6px;
}

/* SALE BADGE đỏ % (CHUẨN WOO) */
body.post-type-archive-product .woocommerce span.onsale,
body.tax-product_cat .woocommerce span.onsale,
body.tax-product_tag .woocommerce span.onsale {
    position: absolute !important;
    top: 14px !important;
    left: 14px !important;
    right: auto !important;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    background: #e60023 !important;
    color: #fff !important;

    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1 !important;

    padding: 8px 12px !important;
    border-radius: 8px !important;

    min-width: unset !important;
    min-height: unset !important;

    box-shadow: none !important;
    border: none !important;
    z-index: 999 !important;
}

/* dập pseudo nếu theme phá */
body.post-type-archive-product .woocommerce span.onsale::before,
body.post-type-archive-product .woocommerce span.onsale::after,
body.tax-product_cat .woocommerce span.onsale::before,
body.tax-product_cat .woocommerce span.onsale::after,
body.tax-product_tag .woocommerce span.onsale::before,
body.tax-product_tag .woocommerce span.onsale::after {
    content: none !important;
    display: none !important;
}

/* responsive */
@media (max-width: 1100px) {

    body.post-type-archive-product .woocommerce ul.products,
    body.tax-product_cat .woocommerce ul.products,
    body.tax-product_tag .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {

    body.post-type-archive-product .woocommerce ul.products,
    body.tax-product_cat .woocommerce ul.products,
    body.tax-product_tag .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {

    body.post-type-archive-product .woocommerce ul.products,
    body.tax-product_cat .woocommerce ul.products,
    body.tax-product_tag .woocommerce ul.products {
        grid-template-columns: 1fr;
    }
}

/* ===== PRODUCT RATING ===== */
.star-rating {
    font-size: 14px;
    color: #f5a623;
    /* màu vàng sao */
    margin: 6px 0;
}

.star-rating span::before {
    color: #f5a623;
}