/* 拼团相关样式 */

/* 活动横幅样式（大部分样式是动态生成的，这里可以添加通用样式） */
.muniu-piota-group-buy-countdown {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.muniu-piota-group-buy-countdown-text {
    white-space: nowrap;
}

/* 拼团时间轴节点样式 */
.muniu-piota-group-buy-timeline-node {
    text-align: center;
    min-width: 50px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 拼团工具提示样式 */
.muniu-piota-group-buy-tooltip {
    position: fixed;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    min-width: 200px;
    max-width: 280px;
    white-space: normal;
}

/* 标题前缀图标样式 */
.muniu-piota-group-buy-title-prefix-icon {
    height: 18px;
    margin-right: 3px;
    vertical-align: middle;
}

/* 扩展的渐变颜色CSS变量定义（使用与主题相同的模式） */
/* 确保新颜色类名也能使用主题的通用规则 */
.jb-orange,
.jb-indigo,
.jb-teal,
.jb-emerald,
.jb-rose,
.jb-amber,
.jb-lime,
.jb-sky,
.jb-violet,
.jb-fuchsia,
.jb-coral,
.jb-mint,
.jb-lavender,
.jb-peach,
.jb-ocean {
    color: var(--this-color, #fff);
    background: var(--this-bg);
    --this-color: #fff;
}

/* 各个颜色的CSS变量定义 */
.jb-orange {
    --this-bg: linear-gradient(135deg, #ff9a56 10%, #ff6a00 100%);
}

.jb-indigo {
    --this-bg: linear-gradient(135deg, #a8c0ff 10%, #3f5bfb 100%);
}

.jb-teal {
    --this-bg: linear-gradient(135deg, #4facfe 10%, #00f2fe 100%);
}

.jb-emerald {
    --this-bg: linear-gradient(135deg, #84fab0 10%, #8fd3f4 100%);
}

.jb-rose {
    --this-bg: linear-gradient(135deg, #fbc2eb 10%, #a6c1ee 100%);
}

.jb-amber {
    --this-bg: linear-gradient(135deg, #fad961 10%, #f76b1c 100%);
}

.jb-lime {
    --this-bg: linear-gradient(135deg, #a8edea 10%, #fed6e3 100%);
}

.jb-sky {
    --this-bg: linear-gradient(135deg, #89f7fe 10%, #66a6ff 100%);
}

.jb-violet {
    --this-bg: linear-gradient(135deg, #a8caba 10%, #5d4e75 100%);
}

.jb-fuchsia {
    --this-bg: linear-gradient(135deg, #ff6e7f 10%, #bfe9ff 100%);
}

.jb-coral {
    --this-bg: linear-gradient(135deg, #ff9a9e 10%, #fecfef 100%);
}

.jb-mint {
    --this-bg: linear-gradient(135deg, #a8ff78 10%, #78ffd6 100%);
}

.jb-lavender {
    --this-bg: linear-gradient(135deg, #e0c3fc 10%, #8ec5fc 100%);
}

.jb-peach {
    --this-bg: linear-gradient(135deg, #ffecd2 10%, #fcb69f 100%);
}

.jb-ocean {
    --this-bg: linear-gradient(135deg, #667eea 10%, #764ba2 100%);
}

/* 拼团团队列表样式 */
.muniu-piota-group-buy-post-teams-list-box {
    margin-top: 20px;
}

.muniu-piota-group-buy-teams-header {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--muted-border-color, #E5E7EB);
}

.muniu-piota-group-buy-teams-scroll-wrapper {
    position: relative;
    overflow: hidden;
    height: auto;
    min-height: 140px;
}

.muniu-piota-group-buy-teams-list-items {
    position: relative;
    transition: transform 0.8s ease-in-out;
}

/* 团队项样式 */
.muniu-piota-group-buy-team-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--muted-border-color, #E5E7EB);
}

.muniu-piota-group-buy-team-item:hover {
    background: var(--focus-color-opacity1, #F5F5F5) !important;
    border-color: var(--main-color, #22c55e);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.12);
}

.muniu-piota-group-buy-team-item-inner {
    width: 100%;
}

.muniu-piota-group-buy-team-item-left {
    flex: 1;
    min-width: 0;
}

/* 头像容器 */
.muniu-piota-group-buy-team-avatars {
    position: relative;
    width: 44px;
    height: 44px;
    margin-right: 12px;
    flex-shrink: 0;
}

.muniu-piota-group-buy-team-avatar {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s ease, z-index 0s;
    will-change: opacity, transform, left;
    backface-visibility: hidden;
    transform-origin: center center;
}

.muniu-piota-group-buy-team-avatar.avatar-rotating {
    pointer-events: none;
}

.muniu-piota-group-buy-team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
    display: block;
}

.muniu-piota-group-buy-team-avatar-more {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 30;
    color: #ef4444;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 团队信息 */
.muniu-piota-group-buy-team-info {
    flex: 1;
    min-width: 0;
}

.muniu-piota-group-buy-team-info .em13 {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 团队操作区域 */
.muniu-piota-group-buy-team-actions {
    flex-shrink: 0;
    margin-left: 16px;
    gap: 12px;
}

/* 倒计时样式 */
.muniu-piota-group-buy-countdown {
    white-space: nowrap;
    font-weight: 500;
}

/* 参团按钮样式（使用子比主题的jb-颜色类） */
.muniu-piota-group-buy-join-btn {
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 确保使用jb-颜色类时文字为白色 */
.muniu-piota-group-buy-join-btn.jb-red,
.muniu-piota-group-buy-join-btn.jb-green,
.muniu-piota-group-buy-join-btn.jb-blue,
.muniu-piota-group-buy-join-btn.jb-yellow,
.muniu-piota-group-buy-join-btn.jb-yellow-2,
.muniu-piota-group-buy-join-btn.jb-pink,
.muniu-piota-group-buy-join-btn.jb-cyan,
.muniu-piota-group-buy-join-btn.jb-purple {
    color: #fff !important;
}

.muniu-piota-group-buy-join-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Meta Box 样式优化 */
.muniu-piota-group-buy-post-meta .hidden {
    display: none !important;
}

.muniu-piota-group-buy-post-meta .widefat {
    width: 100%;
}

.muniu-piota-group-buy-post-meta .inline-block {
    display: inline-block;
}

.muniu-piota-group-buy-post-meta .block {
    display: block;
}

.muniu-piota-group-buy-post-meta .mr15 {
    margin-right: 15px;
}

.muniu-piota-group-buy-post-meta .mb5 {
    margin-bottom: 5px;
}

.muniu-piota-group-buy-post-meta .mb10 {
    margin-bottom: 10px;
}

.muniu-piota-group-buy-post-meta .mt10 {
    margin-top: 10px;
}

.muniu-piota-group-buy-post-meta .mt15 {
    margin-top: 15px;
}

.muniu-piota-group-buy-post-meta .mb15 {
    margin-bottom: 15px;
}

.muniu-piota-group-buy-post-meta .ml15 {
    margin-left: 15px;
}

.muniu-piota-group-buy-post-meta .muniu-piota-icon-input {
    width: calc(100% - 100px);
}

.muniu-piota-group-buy-post-meta .muniu-piota-icon-preview {
    max-width: 100px;
    max-height: 100px;
    margin-top: 5px;
}

/* 阶梯配置项样式 */
.pito-tier-item {
    border: 1px solid var(--muted-border-color, #ddd);
    padding: 15px;
    margin-bottom: 15px;
    background: var(--muted-bg, #f9f9f9);
    border-radius: 4px;
}

.pito-link-item,
.pito-reward-item {
    border: 1px solid var(--muted-border-color, #ddd);
    padding: 10px;
    margin-bottom: 10px;
    background: var(--main-bg-color, #fff);
    border-radius: 4px;
}

/* 前端显示组件样式优化 */
.muniu-piota-team-info-box {
    border-left: 3px solid;
    border-radius: 4px;
}

.muniu-piota-team-info-green {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.muniu-piota-team-info-blue {
    border-left-color: #3b82f6;
    background: #f0f9ff;
}

.muniu-piota-free-pay-info-box {
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
}

.hidden {
    display: none !important;
}

/* 拼团购买按钮响应式样式 - 与立即购买按钮(cashier-link)保持一致 */
/* 小屏幕（<= 640px）：宽度100%，与主题规则一致 */
@media (max-width: 640px) {
    .cashier-link,
    .initiate-pay,
    a.muniu-piota-group-buy-post-link {
        width: 100%;
    }

    /* 团队列表手机端优化 */
    .muniu-piota-group-buy-teams-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    .muniu-piota-group-buy-team-item-inner {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .muniu-piota-group-buy-team-item-left {
        width: 100%;
    }

    .muniu-piota-group-buy-team-avatars {
        margin-right: 10px;
    }

    .muniu-piota-group-buy-team-info {
        width: 100%;
    }

    .muniu-piota-group-buy-team-actions {
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
    }

    .muniu-piota-group-buy-countdown {
        width: 100%;
        text-align: center;
        font-size: 12px;
    }

    .muniu-piota-group-buy-join-btn {
        width: 100%;
        padding: 12px 24px;
        font-size: 15px;
    }

    /* 头像在手机端稍微缩小 */
    .muniu-piota-group-buy-team-avatars {
        width: 40px;
        height: 40px;
    }

    /* 手机端头像偏移调整（使用JavaScript动态设置） */
    .muniu-piota-group-buy-team-avatar[data-avatar-index="0"] {
        left: 0 !important;
    }

    .muniu-piota-group-buy-team-avatar[data-avatar-index="1"] {
        left: 6px !important;
    }

    .muniu-piota-group-buy-team-avatar[data-avatar-index="2"] {
        left: 12px !important;
    }

}

/* 用户中心样式优化 */
.muniu-piota-time-info-wrapper {
    flex-wrap: wrap;
    gap: 8px;
}

.muniu-piota-time-info-left {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.muniu-piota-time-info-right {
    flex: 0 0 auto;
    white-space: nowrap;
}

.muniu-piota-progress-bar {
    background: #f0f0f0;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}

.muniu-piota-progress-bar-fill {
    background: linear-gradient(90deg, #2193f7, #22c55e);
    height: 100%;
    transition: width 0.3s;
}

.muniu-piota-progress-bar-small {
    background: #e5e7eb;
    border-radius: 2px;
    height: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.muniu-piota-progress-bar-fill-small {
    height: 100%;
    transition: width 0.3s;
}

.muniu-piota-progress-bar-medium {
    background: #e5e7eb;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.muniu-piota-progress-bar-fill-medium {
    height: 100%;
    transition: width 0.3s;
}

.muniu-piota-promotion-stats-box {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.muniu-piota-promotion-stats-items {
    flex-wrap: wrap;
    gap: 8px;
}

.muniu-piota-promotion-stat-item {
    flex: 1;
    min-width: 100px;
}

.muniu-piota-expired-tips-box {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    border-radius: 4px;
}

.muniu-piota-tier-item {
    border-left: 3px solid;
    padding-left: 10px;
}

.muniu-piota-tier-completed {
    border-left-color: #22c55e;
}

.muniu-piota-tier-progress {
    border-left-color: #3b82f6;
}

.muniu-piota-share-url-box {
    background: #f5f5f5;
    border-radius: 4px;
    padding: 8px 10px;
}

.muniu-piota-share-url-input {
    width: 100%;
    padding: 6px 8px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 12px;
}

/* 颜色辅助类 */
.c-red-dark {
    color: #991b1b;
}

.c-blue-dark {
    color: #1e40af;
}

.line-height-18 {
    line-height: 1.8;
}

.ml4 {
    margin-left: 4px;
}

