.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    padding: 0;
}

.woocommerce ul.products li.product a img {
    margin: 0;
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.woocommerce ul.products li.product a.woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.woocommerce ul.products li.product .woocommerce-loop-category__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h3 {
    font-size: clamp(12px, 2.5vw, 16px);
    color: #fff;
    padding: 10px 5px;
    margin: 0;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    hyphens: auto;
}

.woocommerce ul.products li.product .button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: -35px 0 0;
}

.woocommerce ul.products li.product .custom-add-to-cart-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 10;
    margin: -30px 0 0;
    opacity: 0;
    visibility: hidden;
}

.woocommerce ul.products li.product .custom-add-to-cart-btn .plus-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(144deg, #FAD38F 17.97%, #D1A75D 97.36%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.woocommerce ul.products li.product .custom-add-to-cart-btn .plus-icon::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" fill="none"><rect width="50" height="50" rx="25" fill="url(%23paint0_linear_1_10883)"/><rect x="15" y="23" width="20" height="3" rx="1.5" fill="%234B180B"/><rect x="27" y="15" width="20" height="3" rx="1.5" transform="rotate(90 27 15)" fill="%234B180B"/><defs><linearGradient id="paint0_linear_1_10883" x1="5.69073e-06" y1="15.4545" x2="32.3825" y2="60.4159" gradientUnits="userSpaceOnUse"><stop stop-color="%23FAD38F"/><stop offset="1" stop-color="%23D1A75D"/></linearGradient></defs></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.woocommerce ul.products li.product:hover a.woocommerce-loop-product__link img {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.woocommerce ul.products li.product:hover .custom-add-to-cart-btn {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1.1);
}

.woocommerce ul.products li.product:hover .custom-add-to-cart-btn .plus-icon {
    box-shadow: 0 4px 15px rgba(250, 211, 143, 0.5);
}

.woocommerce ul.products li.product .custom-add-to-cart-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.woocommerce ul.products li.product .custom-add-to-cart-btn:active .plus-icon {
    box-shadow: 0 2px 8px rgba(250, 211, 143, 0.3);
}

.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) .custom-add-to-cart-btn.added::after {
    display: none !important;
}

.woocommerce ul.products li.product .custom-add-to-cart-btn.added {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    margin: -30px 0 0 !important;
}

.woocommerce ul.products li.product .custom-add-to-cart-btn.added .plus-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(144deg, #FAD38F 17.97%, #D1A75D 97.36%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.woocommerce .blockUI.blockOverlay {
    display: none !important;
}

.woocommerce .loader {
    display: none !important;
}

.woocommerce .loading {
    opacity: 1 !important;
}

.woocommerce .adding-to-cart {
    opacity: 1 !important;
}

.woocommerce a.button.loading::after,
.woocommerce button.button.loading::after,
.woocommerce input.button.loading::after {
    display: none !important;
}

.woocommerce a.button.loading,
.woocommerce button.button.loading,
.woocommerce input.button.loading {
    opacity: 1 !important;
    cursor: pointer !important;
}
/* 模块说明：产品网格样式
   修复目的：不再全局隐藏 WooCommerce 通知（message/info/error），
   以避免登录/注册等短代码区域的提示被误隐藏。
   原有规则在此处设置了 display: none !important，现予以移除。 */

.added_to_cart.wc-forward {
    display: none !important;
}

.woocommerce span.onsale,
.woocommerce .onsale,
.woocommerce ul.products li.product .onsale,
.woocommerce-page span.onsale,
.woocommerce-page .onsale,
.woocommerce-page ul.products li.product .onsale {
    display: none !important;
}

.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .price.custom-price-layout {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin: 8px 0;
    padding: 0 5px;
    flex-wrap: wrap;
}

.woocommerce ul.products li.product .price .woocommerce-Price-amount,
.woocommerce ul.products li.product .price.custom-price-layout .woocommerce-Price-amount {
    font-size: clamp(14px, 3vw, 18px);
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}

.woocommerce ul.products li.product .price .regular-price .woocommerce-Price-amount,
.woocommerce ul.products li.product .price.custom-price-layout .regular-price .woocommerce-Price-amount {
    font-size: clamp(12px, 2.5vw, 14px);
    font-weight: normal;
    color: #999;
    text-decoration: line-through;
}

.woocommerce ul.products li.product .custom-add-to-cart-btn.loading .plus-icon {
    position: relative;
}

.woocommerce ul.products li.product .custom-add-to-cart-btn.loading .plus-icon::before {
    opacity: 0;
    visibility: hidden;
}

.woocommerce ul.products li.product .custom-add-to-cart-btn.loading .plus-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid rgba(75, 24, 11, 0.1);
    border-left: 2px solid #4B180B;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-sizing: border-box;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.woocommerce ul.products li.product .added_to_cart.wc-forward {
    display: none !important;
}