/* 确保产品容器可以承载绝对定位的标签 */
ul.products li.product, 
.product-type-variable, 
.woocommerce-loop-product-link {
    position: relative !important;
    display: block !important;
}

/* 针对你的类名进行强制重写 */
.woocommerce ul.products li.product .onsale.custom-discount-badge,
.woocommerce-page ul.products li.product .onsale.custom-discount-badge {
    /* 1. 强制定位到右上角 */
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important; /* 覆盖有些主题默认的 left: 0 */
    
    /* 2. 覆盖 WooCommerce 默认的圆圈样式 */
    margin: 0 !important;
    padding: 4px 8px !important;
    min-height: 0 !important;
    min-width: 0 !important;
    line-height: 1.2 !important;
    border-radius: 4px !important;
    
    /* 3. 颜色与字体 */
    background-color: #ff0000 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-align: center !important;
    
    /* 4. 确保在图片之上 */
    z-index: 99 !important;
    display: block !important;
}

/* 解决图片遮挡：有些主题的图片层级很高 */
.woocommerce ul.products li.product a img {
    z-index: 1 !important;
    position: relative !important;
}


/* ==================== 优惠券弹窗 ==================== */
/* 弹窗遮罩 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center; /* 居中显示 */
    align-items: center;     /* 居中显示 */
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 弹窗主体 */
.popup-container {
    background: white;
    border-radius: 15px;
    padding: 30px 30px 0 30px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transform: translateY(100%);
    position: relative;
   
}

.popup-overlay.show .popup-container {
    transform: translateY(0);
}

/* 收缩状态：左侧小条 */
.popup-overlay.collapsed {
    background: transparent;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
}

.popup-overlay.collapsed .popup-container {
    position: fixed;
    top: 50%;
    left: -40px;
    transform: translateY(-50%) rotate(90deg);
    max-width: 120px;
    padding: 15px;
    border-radius: 15px 15px 0 0;
    cursor: pointer;
    pointer-events: auto;
    background: white;
    box-shadow: -5px -5px 20px rgba(0, 0, 0, 0.2);
}
/* 收缩时隐藏内容 */
.popup-overlay.collapsed .popup-content,
.popup-overlay.collapsed .close-btn {
    display: none;
}

/* 收缩图标显示 */
.collapse-icon {
    display: none;
    text-align: center;
    font-size: 14px;
    color: #333;
}

.popup-overlay.collapsed .collapse-icon {
    display: block;
}

/* 弹窗内容样式 */
.popup-content {
    display: block;
}

.popup-header {
    text-align: center;
    margin-bottom: 20px;
}

.popup-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.popup-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 25px;
}

/* 按钮 */
.popup-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.popup-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #f3cf46, #286E3E) !important;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 0;
    right: -21px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    width: 24px;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* 响应式 */
@media (max-width: 480px) {
    .popup-container {
        max-width: 100%;
        border-radius: 15px;
        margin: 0;
    }
    
    .popup-overlay.collapsed .popup-container {
        max-width: 120px;
        border-radius: 15px 15px 0 0;
    }
    
    .popup-buttons {
        flex-direction: column;
    }
    
    .popup-title {
        font-size: 1.5rem;
    }
}





/* ==================== 产品分类背景 ==================== */
.tax-product_tag #main,
.tax-product_cat #wrapper,
.post-type-archive-product #wrapper,
.post-type-archive-product #main,
.post-type-archive-product .shop-page-title,
.tax-product_cat #main,
.tax-product_cat .shop-page-title{
    background: #eee;
}

/* ==================== 产品分类-布局 ==================== */



/* ==========================================================================
产品边栏
   ========================================================================== */
 /*边栏最近购买字体缩小*/
 .product_list_widget li .woocs_price_code{
     font-size: 12px;
 }
 .product_list_widget li .product-title{
     font-size: 13px;
    display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 最多显示2行 */
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5em;      /* 每行高度 */
  min-height: 3em;         /* 至少2行的高度 */
  
 }
 
 
 

/*删除神秘分割线*/
.archive  #main hr{
    display: none;
}

.widget .toggle:not(.accordion .toggle) {
    margin: 0 0 0 5px;
    min-height: 2em;
    width: 2em;
    border-radius: 50%;
    background: #eee;
}


.widget>ul>li>a{
    display: inline-block;
    flex: 1;
    padding: 15px 0;
}

/*侧边栏*/
.sidebar-inner {
    background: #fff;
    padding: 35px 25px;
    border-radius: 5px;
}




/* ==================== 产品卡片 ==================== */


/*分类-产品卡片*/
.box-category .box-text,
.product-small .box-text{
    padding: 15px;
}


.product-category .box,
.product-small .box{
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
}


/*产品卡片-标题*/
.product-small .woocommerce-loop-product__title{
    font-size: 14px;
}


/*产品卡片添加动画出现*/
.products .product-small {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 0.5s forwards;
}


/* 每个子元素依次延迟 */
.products .product-small:nth-child(1) {
    animation-delay: 0.1s;
}
.products .product-small:nth-child(2) {
    animation-delay: 0.2s;
}
.products .product-small:nth-child(3) {
    animation-delay: 0.3s;
}
.products .product-small:nth-child(4) {
    animation-delay: 0.4s;
}
/* 如果有更多商品，可以继续增加延迟或者用 JS 自动生成 */

/* 动画关键帧 */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}






/*订单查询红框添加css*/

.vi-woocommerce-orders-tracking-form-search .vi-woocommerce-orders-tracking-form-error {
    border: 1px solid #000;
}

 /* ==========================================================================
购物车文字大小
   ========================================================================== */
 .widget_shopping_cart ul.product_list_widget li {
    padding-right: 30px;
    font-size: 12px;
}




/* ==================== 产品页面/布局 ==================== */



/*购物车底部固定栏去掉添加的模块*/
.sticky-add-to-cart .goods-right-qty-label{
    display: none;
}

.sticky-add-to-cart .goods-right{
    display: none;
}
/*隐藏标题*/
.sticky-add-to-cart__product .product-title-small {
    display: none;
}



 
/*手机加购卖放一行*/

@media (max-width: 549px) {
.woocommerce-variation-add-to-cart, form.cart {
    display: block;

}
}



/*产品标题*/
h1.product_title{
    font-weight: bold;
}

/* Add to Cart 独占一行，线条按钮 */
.goods-info .ux-buy-now-button,
.goods-info .single_add_to_cart_button.button {
    display: block;              
    width: 100%;                 
    background: transparent;     
    color: #333;                
    border: 1px solid #333;      
    border-radius: 54px;          
    padding: 3px 15px;            
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.goods-info .ux-buy-now-button{
    background: #333;
    color: #fff;
}

/* 鼠标悬停效果 */
.goods-info .single_add_to_cart_button.button:hover {
    border-color: #000;
    background: #fff8f2 !important;
}
.goods-info .ux-buy-now-button:hover{
    background: #000;
    color: #fff;
}

#reviews{
  margin: 40px auto 0 auto !important
}



.woocommerce-tabs #comments{
  padding: 30px;
}
.woocommerce-tabs .nav-tabs+.tab-panels{
  padding: 0 !important;
}
.woocommerce-Tabs-panel section .row{
  margin-left: auto !important;
  margin-right: auto !important;
}


@media (max-width: 549px) {
  .woocommerce-Tabs-panel section {
    padding:30px 15px !important
  }

}

.woocommerce-tabs .tab>a{
    font-size: 18px !important;
    padding: 10px 20px !important
}

