/* LP bom_table v2 — segment tabs, layout toggle, accordion (Ф2.5.P3.W5) */

.lp-bom-table {
    --lp-bom-border: var(--ds-border, #e2e8f0);
    --lp-bom-muted: var(--ds-text-muted, #64748b);
    font-size: 14px;
    color: var(--ds-text, #0f172a);
}

.lp-bom-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.lp-bom-control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.lp-bom-control-label {
    min-width: 96px;
    color: var(--lp-bom-muted);
    font-size: 12px;
}

.lp-bom-control-row .lp-bom-layout-toggle {
    margin-left: 0;
    flex-wrap: wrap;
}

.lp-bom-segment-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lp-bom-tab {
    border: 1px solid var(--lp-bom-border);
    background: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s;
}

.lp-bom-tab:hover {
    border-color: #94a3b8;
}

.lp-bom-tab.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.lp-bom-layout-toggle {
    display: flex;
    gap: 4px;
    margin-left: auto;
    font-size: 12px;
    color: var(--lp-bom-muted);
}

.lp-bom-layout-btn {
    border: 1px solid var(--lp-bom-border);
    background: #f8fafc;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
}

.lp-bom-layout-btn.is-active {
    background: #e2e8f0;
    font-weight: 600;
}

.lp-bom-status {
    width: 100%;
    font-size: 12px;
    color: var(--lp-bom-muted);
    min-height: 1.2em;
}

.lp-bom-status.is-error {
    color: #b91c1c;
}

.lp-bom-load-error {
    color: #b91c1c;
}

.lp-bom-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.lp-bom-section {
    border: 1px solid var(--lp-bom-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    margin-block: 0;
}

.lp-bom-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    width: 100%;
    border: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
}

.lp-bom-section-header:focus-visible,
.lp-bom-axis-disclosure:focus-visible {
    outline: 2px solid var(--ds-primary, #2563eb);
    outline-offset: -2px;
}

.lp-bom-section-count { margin-left: auto; color: var(--lp-bom-muted); font-size: 12px; }

.lp-bom-section-header .lp-bom-chevron {
    width: 16px;
    text-align: center;
    color: var(--lp-bom-muted);
    flex-shrink: 0;
}

.lp-bom-section-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.lp-bom-section.is-collapsed > .lp-bom-section-body,
.lp-bom-section-body[hidden] {
    display: none;
}

.lp-bom-section-lines { display: flex; flex-direction: column; gap: 12px; }
.lp-bom-section-lines:empty { display: none; }
.lp-bom-show-more { align-self: flex-start; }

.lp-bom-layout-axis-tabs { min-width: 220px; max-width: 100%; }
.lp-bom-axis-level { list-style: none; margin: 6px 0 0; padding: 0; }
.lp-bom-axis-level .lp-bom-axis-level { margin: 4px 0 4px 14px; padding-left: 12px; border-left: 1px solid var(--lp-bom-border); }
.lp-bom-axis-row { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.lp-bom-axis-row .lp-bom-tab { text-align: left; border-radius: 6px; }
.lp-bom-axis-disclosure,
.lp-bom-axis-spacer { flex: 0 0 26px; width: 26px; min-height: 28px; }
.lp-bom-axis-disclosure { border: 0; border-radius: 4px; color: inherit; background: transparent; cursor: pointer; }
.lp-bom-axis-disclosure:hover { background: #e2e8f0; }

.lp-bom-line-price {
    font-size: 12px;
    white-space: nowrap;
    text-align: right;
    margin-left: auto;
}

.lp-bom-nested {
    margin-left: 12px;
    padding-left: 10px;
    border-left: 2px solid #e2e8f0;
}

/* Unified product cards (lp-bom-line-card.js + product-card.css) */

.lp-bom-section-body .lp-bom-line-card {
    margin-bottom: 0;
}

.lp-bom-line-card.lp-bom-line-card--excluded {
    opacity: 0.45;
    border-color: #e2e8f0;
}

.lp-bom-line-card.lp-bom-line-card--excluded.is-in-cart {
    border-color: #e2e8f0;
}

.lp-bom-thumb-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.lp-bom-thumb-col .lw-pm-product-thumb {
    margin: 0;
}

.lp-bom-line-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.lp-bom-line-remove:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.lp-bom-line-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    margin-top: 8px;
}

.lp-bom-qty-tile {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.lp-bom-qty-input {
    width: 5rem;
    min-width: 5rem;
    max-width: 5rem;
    padding-left: 2px;
    padding-right: 0;
    text-align: left;
    box-sizing: border-box;
}

.lp-bom-qty-side {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lp-bom-qty-unit {
    font-size: 12px;
    color: var(--lp-bom-muted);
    line-height: 1.2;
}

.lp-bom-qty-hint {
    font-size: 10px;
    color: #b45309;
    line-height: 1.2;
    white-space: nowrap;
}

.lp-bom-excluded-note {
    width: 100%;
    margin: 6px 0 0;
    padding: 6px 10px;
    font-size: 12px;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
}

.lp-bom-changed-badge {
    color: #b45309;
    font-weight: 600;
}

.lp-bom-alt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
}

.lp-bom-alt-chip {
    border: 1px solid var(--lp-bom-border);
    background: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}

.lp-bom-alt-chip.is-active {
    background: #ecfdf5;
    border-color: #16a34a;
    font-weight: 600;
}

.lp-bom-alt-chip:disabled {
    cursor: default;
    opacity: 0.85;
}

.lp-bom-opt-check {
    font-size: 12px;
}
