.bulk-discount-wrapper {
    margin: 1em 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: none;
    box-shadow: none;
    position: relative;
}

/* 顶部摘要样式 */
.bulk-discount-summary {
    background: #f7f7f7;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    margin-top: 15px;
}

.total-summary {
    display: flex;
    align-items: center;
    gap: 5px;
}

.variation-name {
    color: #666;
    font-style: italic;
}

.total-price {
    font-weight: bold;
    color: #333366;
}

/* 变体按钮容器样式 */
.variation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

/* 变体按钮基础样式 */
.variation-button {
    flex: 0 1 auto;  /* 不拉伸，允许收缩，基于内容宽度 */ 
    padding: 8px 20px;
    border-radius: 4px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    border: 1px solid #ddd;
    text-align: center;
    position: relative; /* 添加相对定位 */
}

/* 当容器宽度足够时，让按钮自动适应宽度 */
@media (min-width: 481px) {
    .variation-button {
        flex: 0 1 auto;  /* 不拉伸，允许收缩 */
    }

    /* 当只有两个按钮时 */
    .variation-buttons:has(.variation-button:nth-child(2):last-child) {
        justify-content: flex-start;  /* 左对齐 */
    }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .variation-buttons {
        gap: 8px;
    }

    .variation-button {
        flex: 0 1 calc(50% - 4px);  /* 一行固定两个，考虑间距 */
        min-width: 0;  /* 移除最小宽度限制 */
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 禁用状态 */
.variation-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
    border-color: #ddd;
}

/* 选中状态 - 使用粉红色突出显示 */
.variation-button.selected {
    background-color: #fff0f5; /* 浅粉红色背景 */
    border-color: #ff6b9b; /* 粉红色边框 */
    color: #ff3366; /* 粉红色文字 */
    box-shadow: 0 2px 5px rgba(255, 105, 180, 0.15); /* 轻微阴影效果 */
}


/* 更强大的选择器覆盖Elementor变体宽度限制 */
.elementor .elementor-element .elementor-jet-single-add-to-cart .variations,
.elementor-2068 .elementor-element.elementor-element-648724 .elementor-jet-single-add-to-cart .variations,
.elementor-widget-jet-single-add-to-cart .variations,
.jet-single-add-to-cart .variations,
form.variations_form .variations {
    max-width: none !important;
    width: auto !important;
    min-width: auto !important;
}

/* 直接针对表格单元格 */
.elementor .elementor-element .elementor-jet-single-add-to-cart .variations td,
.elementor .elementor-element .elementor-jet-single-add-to-cart .variations tr,
.elementor-jet-single-add-to-cart .variations td,
.elementor-jet-single-add-to-cart .variations tr,
form.variations_form .variations td,
form.variations_form .variations tr {
    width: auto !important;
    max-width: none !important;
    min-width: auto !important;
}

/* 选中状态的对勾标记 */
.variation-button.selected::after {
    content: "✓";
    margin-left: 5px;
    font-weight: bold;
    color: #ff3366; /* 粉红色对勾 */
}

/* 鼠标悬停效果 */
.variation-button:hover:not(.selected):not(.disabled) {
    border-color: #ffb6c1;
    background-color: #fff5f8;
}

/* 添加价格差异的样式 */
.variation-button .price-diff {
    color: #ee4d2d;
    font-weight: 600;
    font-size: 0.9em;
    display: inline-block;
    margin-left: 3px;
    white-space: nowrap;
}

/* 确保价格符号和数字之间没有空格 */
.variation-button .price-diff .woocommerce-Price-currencySymbol {
    margin-right: 0;
}

/* 选中状态下的价格差异样式 */
.variation-button.selected .price-diff {
    color: #ff3366; /* 粉红色价格差异 */
}

/* 触摸设备上选中状态 */
@media (hover: none) {
    .variation-button.selected {
        border-color: #ff6b9b;
        color: #ff3366;
        background-color: #fff0f5;
    }
}

/* 变体提示样式 */
.variation-notice {
    padding: 10px;
    background: #fff3e0;
    border-radius: 4px;
    margin-bottom: 1em;
    text-align: center;
    color: #f57c00;
    display: none;
}

/* 折扣表格样式 */
.bulk-discount-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #f7f7f7;
    border: none;
    border-radius: 4px;
    overflow: hidden;
}

.bulk-discount-table td {
    padding: 8px 15px;
    text-align: left;
    border: none;
    line-height: 1.2;
    position: relative;
    padding-left: 25px;
}

/* 折扣规则行样式 */
.bulk-rule {
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
    color: #666;
    background: #f7f7f7;
}

.bulk-rule td {
    position: relative;
    padding: 8px 15px 8px 25px !important;
    line-height: 1.2;
}

/* 添加三角形箭头 */
.bulk-rule td:before {
    content: '▶';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 10px;
    transition: color 0.3s ease;
}

/* 折扣规则中的价格和折扣文本样式 */
.bulk-rule td .price-amount,
.bulk-rule td .save-text {
    color: #ee4d2d;
    font-weight: 600;
}

/* 激活状态下的文本颜色 */
.bulk-rule.active td .price-amount,
.bulk-rule.active td .save-text,
.bulk-rule.active td:before {
    color: #fff;
}

/* 移动端特别优化 */
@media (max-width: 768px) {
    .bulk-rule td {
        padding: 10px 12px 10px 25px !important;  /* 调整移动端内边距 */
        display: flex;
        align-items: center;
        min-height: 38px;  /* 减小最小高度 */
    }

    .bulk-rule td:before {
        left: 8px;
        font-size: 10px;
    }
}

/* 激活状态 */
.bulk-rule.active {
    background: #ff7043 !important;
    color: #fff;
}

/* 悬停效果 */
.bulk-rule:hover {
    background-color: #fff3e0;
}

/* 隐藏原生选择器和额外内容 */
.variations select,
.price,
.woocommerce-variation-price {
    display: none !important;
}

/* 禁用状态的表格样式 */
.bulk-discount-table[style*="pointer-events: none"] {
    position: relative;
    opacity: 0.5;
}

.bulk-discount-table[style*="pointer-events: none"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 1;
}

/* 响应式样式 */
@media (max-width: 768px) {
    /* 折扣表格样式 */
    .bulk-discount-table td {
        padding: 10px 12px;
        font-size: 0.9em;
    }
    
    /* 价格显示 */
    .bulk-discount-price-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .bulk-discount-price-display ins {
        font-size: 1.3em;
    }

    /* 购物车样式 */
    .cart-item-price {
        gap: 2px;
    }

    .bulk-discount-info {
        font-size: 0.8em;
    }
}

/* 小屏幕设备 */
@media (max-width: 480px) {
    .bulk-discount-summary {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* 价格显示样式 */
.bulk-discount-price-display {
    margin-bottom: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-discount-price-display ins {
    color: #ee4d2d;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: 700;
    order: -1; /* 确保销售价在前面 */
}

.bulk-discount-price-display del {
    color: #999;
    font-weight: normal;
    font-size: 0.9em;
    text-decoration: line-through;
}

.bulk-discount-price-display .regular-price:not(del) {
    color: #ee4d2d;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: 700;
}

/* 变体产品价格显示 */
.bulk-discount-wrapper[data-is-variable="true"] .bulk-discount-price-display {
    opacity: 0.5;
}

/* 购物车折扣信息样式 */
.bulk-discount-info {
    font-size: 0.85em;
    color: #ee4d2d;
    margin-top: 5px;
}

/* 购物车价格样式 */
.woocommerce-cart-form .product-price,
.woocommerce-cart-form .product-subtotal {
    font-weight: 600;
    color: #ee4d2d;
}

/* 结账页面折扣行样式 */
.bulk-discount-row td {
    color: #ee4d2d;
    font-size: 0.9em;
    padding-top: 0 !important;
}

/* Mini cart 折扣信息样式 */
.bulk-discount-info.mini-cart {
    font-size: 0.8em;
    color: #ee4d2d;
    margin-top: 2px;
}

/* 主购物车折扣信息样式 */
.woocommerce-cart-form .bulk-discount-info {
    font-size: 0.85em;
    color: #ee4d2d;
    margin-top: 5px;
}

.cart-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.bulk-discount-info {
    font-size: 0.85em;
    color: #ee4d2d;
}

/* 触摸设备样式 */
@media (hover: none) {
    .variation-button:hover {
        /* 移除悬停效果 */
        border-color: #ddd;
        color: #666;
    }

    .variation-button.touch-active {
        /* 添加触摸反馈 */
        background: #f5f5f5;
        border-color: #ee4d2d;
        color: #ee4d2d;
    }
} 

/* Cart页面折扣徽章样式 */
.wc-block-cart .bulk-discount-badge {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 5px;
    display: inline-block;
}

.wc-block-cart .bulk-discount-badge .wc-block-formatted-money-amount {
    font-weight: bold;
}

/* 确保价格显示正确 */
.wc-block-cart-item__prices del {
    text-decoration: line-through;
    opacity: 0.7;
    margin-right: 5px;
}

.wc-block-cart-item__prices ins {
    text-decoration: none;
    font-weight: bold;
    color: #e74c3c;
}

/* 调试样式 - 临时使用 */
.bulk-discount-debug {
    border: 2px solid red !important;
    background: yellow !important;
} 

/* 全局固定联系图标 */
.global-contact-icons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999999; /* 确保在最上层 */
    transition: all 0.3s ease;
}

.global-contact-icons .contact-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: #fff;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.global-contact-icons .contact-icon:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.global-contact-icons .contact-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.global-contact-icons .contact-icon.email {
    background: #ea4335;
}

.global-contact-icons .contact-icon.whatsapp {
    background: #25D366;
}

.global-contact-icons .contact-icon.telegram {
    background: #0088cc;
}

/* 当浮动购物车可见时，调整位置 */
body.has-floating-cart .global-contact-icons {
    bottom: 120px; /* 确保不被浮动购物车遮挡 */
}

/* 移动端样式 */
@media (max-width: 768px) {
    .global-contact-icons {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }
    
    .global-contact-icons .contact-icon {
        width: 40px;
        height: 40px;
    }
    
    .global-contact-icons .contact-icon svg {
        width: 20px;
        height: 20px;
    }
    
    body.has-floating-cart .global-contact-icons {
        bottom: 100px;
    }
} 