/* ── Bundle Picker — Storefront ─────────────────────────────────────── */

.bundle-picker { margin-bottom: 24px; }

/* ── Group Card ────────────────────────────────────────────────────── */
.bundle-group {
    border: 1.5px solid var(--line, #e9e9e9);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 16px;
}
.bundle-group-header {
    padding: 14px 16px;
    background: var(--bg-2, #fafafa);
    border-bottom: 1px solid var(--line, #e9e9e9);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.bundle-group-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text, #333);
}
.bundle-group-required {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(220, 53, 69, .1);
    color: #dc3545;
}
.bundle-group-progress {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2, #666);
}
.bundle-group-progress .bp-bar {
    width: 80px;
    height: 6px;
    border-radius: 3px;
    background: var(--line, #e5e5e5);
    overflow: hidden;
}
.bundle-group-progress .bp-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--main, #3b82f6);
    transition: width .25s ease;
}
.bundle-group-progress.bp-complete .bp-bar-fill {
    background: #22c55e;
}
.bundle-group-progress.bp-over .bp-bar-fill {
    background: #ef4444;
}

/* ── Items List ─────────────────────────────────────────────────────── */
.bundle-group-items {
    padding: 8px 0;
}
.bundle-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0,0,0,.04);
    transition: background .2s, border-color .2s;
    border-inline-start: 3px solid transparent;
}
.bundle-item:last-child { border-bottom: none; }
.bundle-item:hover { background: rgba(0,0,0,.015); }

/* ── Selected Item Highlight ───────────────────────────────────────── */
.bundle-item.is-selected {
    background: rgba(34, 197, 94, .06);
    border-inline-start-color: #22c55e;
}
.bundle-item.is-selected .bundle-item-name {
    color: var(--primary, #111);
}
.bundle-item.is-selected .bundle-qty-stepper {
    border-color: #22c55e;
}
.bundle-item.is-selected .bundle-qty-value {
    color: #22c55e;
    font-weight: 800;
}

.bundle-item-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line, #e5e5e5);
    flex-shrink: 0;
}
.bundle-item-img-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px dashed var(--line, #ddd);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2, #f5f5f5);
    flex-shrink: 0;
}
.bundle-item-img-placeholder svg {
    width: 20px; height: 20px;
    color: var(--text-2, #999);
}

.bundle-item-info {
    flex: 1;
    min-width: 0;
}
.bundle-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s;
}
.bundle-item-price {
    font-size: 12px;
    color: var(--text-2, #888);
    font-weight: 500;
    margin-top: 2px;
}
.bundle-item.is-selected .bundle-item-price {
    color: #22c55e;
    font-weight: 600;
}

/* ── Quantity Stepper ──────────────────────────────────────────────── */
.bundle-qty-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--line, #e0e0e0);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
    transition: border-color .2s;
}
.bundle-qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text, #333);
    font-size: 16px;
    font-weight: 700;
    transition: background .15s, color .15s;
    user-select: none;
    -webkit-user-select: none;
}
.bundle-qty-btn:hover { background: var(--bg-2, #f5f5f5); }
.bundle-qty-btn:active { background: var(--line, #e5e5e5); }
.bundle-qty-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}
.bundle-qty-value {
    width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--text, #333);
    border-inline: 1px solid var(--line, #e0e0e0);
    padding: 6px 0;
    transition: color .2s;
}
.bundle-qty-value.has-value {
    color: var(--main, #3b82f6);
}

/* ── Validation ────────────────────────────────────────────────────── */
.bundle-group.has-error {
    border-color: #dc3545;
    animation: bundleShake .4s ease-in-out;
}
.bundle-group-error {
    padding: 8px 16px;
    color: #dc3545;
    font-size: 12px;
    font-weight: 600;
    display: none;
}
.bundle-group.has-error .bundle-group-error { display: block; }

@keyframes bundleShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .bundle-item { gap: 8px; padding: 8px 12px; }
    .bundle-item-img, .bundle-item-img-placeholder { width: 40px; height: 40px; }
    .bundle-item-name { font-size: 13px; }
    .bundle-qty-btn { width: 32px; height: 32px; }
    .bundle-qty-value { width: 30px; font-size: 13px; }
    .bundle-group-progress .bp-bar { width: 60px; }
}
