/* Buy Now 按钮样式 */

/* 轮播区域产品卡片特殊样式 */
.product-carousel-wrapper .woocommerce ul.products li.product .buy-now-btn {
    bottom: 10px !important;
    display: block !important;
    z-index: 9 !important; /* 降低z-index值，避免与my-product-slider冲突 */
}

/* PC端产品卡片添加Buy Now按钮 */
ul.products li.product {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 380px; /* 设置最小高度确保卡片大小一致 */
}

/* 产品内容区域占满空间 */
ul.products li.product .astra-shop-summary-wrap {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    padding-bottom: 80px; /* 减少底部空间 */
    margin-top: 20px;
    z-index: 1; /* 确保不会覆盖my-product-slider的内容 */
}

/* 价格和评分区域样式 */
ul.products li.product .price,
ul.products li.product .review-rating {
    margin-bottom: 15px;
    position: relative;
    z-index: 7; /* 降低z-index值，避免与my-product-slider冲突 */
}

/* 确保价格和评分区域在Buy Now按钮上方 */
ul.products li.product .astra-shop-summary-wrap > *:not(.buy-now-btn):not(.new-buy-now-btn) {
    position: relative;
    z-index: 6; /* 降低z-index值，但保持高于Buy Now按钮 */
    margin-bottom: 10px;
}

/* 产品归档页面的Buy Now按钮样式 */
.woocommerce-page ul.products li.product .new-buy-now-btn {
    margin-top: 15px;
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    display: inline-block;
}

/* 创建Buy Now按钮 */
.buy-now-btn, .new-buy-now-btn {
    display: block;
    width: 90%;
    position: absolute;
    bottom: 20px; /* 调整按钮位置 */
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff !important;
    padding: var(--mps-button-padding, 8px 12px);
    border-radius: var(--mps-button-radius, 6px);
    text-decoration: none !important;
    font-size: var(--mps-button-font-size, 13px);
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    line-height: 1.5;
    z-index: 5; /* 降低z-index值，避免与my-product-slider的内容冲突 */
    margin-top: 10px;
}

/* 悬停效果 */
.buy-now-btn:hover, .new-buy-now-btn:hover {
    background: #333;
    color: #fff !important;
}

/* 禁用状态 */
.new-buy-now-btn.disabled {
    background: #999 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* 加载状态 */
.new-buy-now-btn.loading {
    opacity: 0.7 !important;
    cursor: wait !important;
}

/* 产品归档页面变体选择器样式 */
.archive-variations-form {
    margin: 10px 0;
    width: 100%;
}

.archive-variation-select {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
}

/* 库存状态消息 */
.stock-status-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 5px 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    width: 100%;
}

.stock-status-message.out-of-stock {
    font-weight: 500;
}

/* 移动端样式 - 将Add to Cart改为Buy Now */
@media (max-width: 768px) {
    /* 隐藏PC端的Buy Now按钮 */
    .buy-now-btn, .new-buy-now-btn {
        display: none;
    }
    
    /* 修改移动端Add to Cart按钮文本 */
    .add-to-cart-btn .button-text {
        display: inline-block;
    }
    
    /* 确保按钮在移动端始终可见 */
    .product-cart-btn-wrapper {
        opacity: 1;
        visibility: visible;
        margin-top: 10px;
    }
}

/* 确保购物车按钮在移动端始终可见 */
.cart-permanent .product-cart-btn-wrapper {
    opacity: 1;
    visibility: visible;
}

/* 特别处理my-product-slider插件中的产品卡片 */
.my-product-slider-wrapper .product-card .buy-now-btn,
.my-product-slider-wrapper .product-card .new-buy-now-btn {
    display: none; /* 在my-product-slider中隐藏Buy Now按钮，避免冲突 */
}

/* 确保my-product-slider中的产品信息正常显示 */
.my-product-slider-wrapper .product-info {
    z-index: 1 !important;
    position: relative !important;
    overflow: visible !important;
}