/* WC Bundles & Addons - Frontend */

.wcba-groups-wrap {
    margin: 20px 0;
    direction: rtl;
}

.wcba-group {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}
.wcba-group:last-of-type { border-bottom: none; }

/* ─── Title ─── */
.wcba-group-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #333;
}
.wcba-required-badge { color: #e2401c; font-weight: bold; }
.wcba-selection-hint { font-size: 13px; font-weight: 400; color: #888; }

/* ─── Accordion ─── */
.wcba-accordion-header {
    cursor: pointer;
    padding: 12px 16px;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    user-select: none;
    transition: background 0.2s;
}
.wcba-accordion-header:hover { background: #f0f0f0; }
.wcba-accordion-arrow { font-size: 12px; color: #888; }
.wcba-accordion-body {
    border: 1px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 12px;
}

/* ═══ GRID LAYOUT ═══ */
.wcba-layout-grid {
    display: grid;
    gap: 10px;
}

/* Checkbox in grid */
.wcba-display-checkbox.wcba-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Cards in grid */
.wcba-display-cards.wcba-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* ═══ LIST LAYOUT ═══ */
.wcba-layout-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ─── Checkbox Display ─── */
.wcba-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.wcba-checkbox-label:hover { border-color: #bbb; background: #fafafa; }
.wcba-checkbox-label input[type="checkbox"] { flex-shrink: 0; }

.wcba-checkbox-image {
    width: 45px; height: 45px;
    object-fit: cover; border-radius: 4px; flex-shrink: 0;
}
.wcba-item-name { flex: 1; font-size: 14px; }
.wcba-item-price { font-size: 13px; color: #e2401c; font-weight: 600; white-space: nowrap; }

.wcba-item.wcba-selected .wcba-checkbox-label {
    border-color: #2271b1; background: #f0f7fc;
}

/* ─── Card Display ─── */
.wcba-card {
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 8px; border: 2px solid #e5e5e5; border-radius: 8px;
    cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center; position: relative;
}
.wcba-card:hover { border-color: #bbb; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.wcba-card input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }

.wcba-card-image {
    width: 80px; height: 80px; margin-bottom: 8px;
    border-radius: 6px; overflow: hidden;
}
.wcba-card-image img { width: 100%; height: 100%; object-fit: cover; }
.wcba-card-info { display: flex; flex-direction: column; gap: 4px; }
.wcba-card-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.wcba-card-price { font-size: 12px; color: #e2401c; font-weight: 600; }

.wcba-item.wcba-selected .wcba-card {
    border-color: #2271b1; background: #f0f7fc;
    box-shadow: 0 0 0 1px #2271b1;
}

/* ─── Disabled (max reached) ─── */
.wcba-item.wcba-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ─── Max reached message ─── */
.wcba-max-message {
    font-size: 13px;
    color: #e2401c;
    font-weight: 600;
    margin-top: 8px;
    padding: 6px 12px;
    background: #fef8f8;
    border-radius: 4px;
    border: 1px solid #f5d5d5;
}

/* ─── Quantity ─── */
.wcba-qty-wrap {
    margin-top: 6px; display: flex; align-items: center;
    gap: 6px; padding: 4px 12px;
}
.wcba-qty-label { font-size: 12px; color: #666; }
.wcba-item-qty {
    width: 50px; padding: 4px; border: 1px solid #ddd;
    border-radius: 4px; text-align: center; font-size: 13px;
}

/* ─── Counter ─── */
.wcba-selection-counter { font-size: 13px; color: #666; margin-top: 8px; }
.wcba-counter-current { font-weight: 600; color: #2271b1; }

/* ─── Price Summary ─── */
.wcba-price-summary {
    margin-top: 16px; padding: 12px 16px;
    background: #f8f8f8; border-radius: 6px;
    font-size: 16px; font-weight: 600;
}
.wcba-price-label { color: #333; }
.wcba-total-price { color: #2271b1; }

/* ─── Validation ─── */
.wcba-validation-messages { display: none; margin-top: 12px; }
.wcba-errors {
    list-style: none; padding: 10px 16px; margin: 0;
    background: #fef1f1; border: 1px solid #e2401c; border-radius: 6px;
}
.wcba-errors li { color: #c00; font-size: 13px; padding: 3px 0; }
.wcba-errors li::before { content: '⚠ '; }
.wcba-group-error {
    border: 1px solid #e2401c; border-radius: 6px; padding: 8px;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .wcba-display-checkbox.wcba-layout-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .wcba-display-cards.wcba-layout-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .wcba-card { padding: 8px 6px; }
    .wcba-card-image { width: 60px; height: 60px; }
}
