/* MNG (PALEM) modular spreader builder. Standalone from the generic
   configurator styles; shares the storefront colour tokens. */

.xs-mng {
    --mng-accent: #e8740c;
    --mng-line: #e2e6ea;
    --mng-ink: #1f2733;
    --mng-muted: #6b7682;
    --mng-ok: #1f8a4c;
    --mng-warn: #b54708;
    margin: 1.5rem 0;
    color: var(--mng-ink);
}

.xs-mng-header { margin-bottom: 1.25rem; }
.xs-mng-title { font-size: 1.4rem; margin: 0 0 .35rem; }
.xs-mng-subtitle { color: var(--mng-muted); max-width: 60ch; line-height: 1.5; margin: 0; }

.xs-mng-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.5rem;
    align-items: start;
}

.xs-mng-step {
    border: 1px solid var(--mng-line);
    border-radius: 12px;
    padding: 1rem 1.1rem 1.2rem;
    margin: 0 0 1rem;
}
.xs-mng-step[hidden] { display: none; }
.xs-mng-step legend {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0 .35rem;
}
.xs-mng-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem; height: 1.5rem;
    background: var(--mng-accent);
    color: #fff;
    border-radius: 50%;
    font-size: .85rem;
    font-weight: 700;
}
.xs-mng-step-help { color: var(--mng-muted); font-size: .9rem; margin: .25rem 0 .9rem; line-height: 1.45; }

/* angle cards */
.xs-mng-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.xs-mng-card {
    display: flex; flex-direction: column; gap: .25rem;
    padding: .9rem .75rem;
    border: 1.5px solid var(--mng-line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.xs-mng-card:hover { border-color: var(--mng-accent); }
.xs-mng-card.is-selected {
    border-color: var(--mng-accent);
    background: #fff7f0;
    box-shadow: 0 0 0 2px rgba(232,116,12,.18);
}
.xs-mng-card-big { font-size: 1.5rem; font-weight: 700; }
.xs-mng-card-tag { font-weight: 600; font-size: .85rem; }
.xs-mng-card-hint { color: var(--mng-muted); font-size: .8rem; line-height: 1.35; }

/* load / span chips */
.xs-mng-chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.xs-mng-chip {
    display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
    padding: .55rem .8rem;
    border: 1.5px solid var(--mng-line);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    min-width: 92px;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.xs-mng-chip:hover { border-color: var(--mng-accent); }
.xs-mng-chip.is-selected {
    border-color: var(--mng-accent);
    background: #fff7f0;
    box-shadow: 0 0 0 2px rgba(232,116,12,.18);
}
.xs-mng-chip-big { font-size: 1.1rem; font-weight: 700; }
.xs-mng-chip-sub { color: var(--mng-muted); font-size: .78rem; }
.xs-mng-chip--span { min-width: 120px; }
.xs-mng-empty { color: var(--mng-muted); font-style: italic; margin: 0; }

/* EXT row */
.xs-mng-ext { margin-bottom: .75rem; }
.xs-mng-ext-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem .85rem;
    background: #f6f8fa;
    border: 1px solid var(--mng-line);
    border-radius: 9px;
}
.xs-mng-ext-ref { font-weight: 700; }
.xs-mng-ext-desc { color: var(--mng-muted); font-size: .85rem; flex: 1; }
.xs-mng-ext-price { font-weight: 600; }

/* spacer rows */
.xs-mng-spacers { display: flex; flex-direction: column; gap: .5rem; }
.xs-mng-spacer-row {
    display: grid;
    grid-template-columns: 1fr auto 90px;
    align-items: center;
    gap: .75rem;
    padding: .55rem .85rem;
    border: 1px solid var(--mng-line);
    border-radius: 9px;
}
.xs-mng-spacer-info { display: flex; flex-direction: column; }
.xs-mng-spacer-ref { font-weight: 600; }
.xs-mng-spacer-meta { color: var(--mng-muted); font-size: .8rem; }
.xs-mng-spacer-line { text-align: right; font-variant-numeric: tabular-nums; color: var(--mng-muted); }

.xs-mng-stepper { display: inline-flex; align-items: center; gap: .4rem; }
.xs-mng-step-btn {
    width: 2rem; height: 2rem;
    border: 1.5px solid var(--mng-line);
    border-radius: 7px;
    background: #fff;
    font-size: 1.1rem; line-height: 1;
    cursor: pointer;
}
.xs-mng-step-btn:hover:not(:disabled) { border-color: var(--mng-accent); }
.xs-mng-step-btn:disabled { opacity: .4; cursor: not-allowed; }
.xs-mng-step-count { min-width: 1.5rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.xs-mng-built-note { color: var(--mng-muted); font-size: .85rem; font-style: italic; margin: .2rem 0 0; }
.xs-mng-build-actions { display: flex; gap: 1rem; margin-top: .85rem; }
.xs-mng-link {
    background: none; border: none; padding: 0;
    color: var(--mng-accent); cursor: pointer; font-size: .85rem; text-decoration: underline;
}

/* summary */
.xs-mng-summary { position: sticky; top: 1rem; }
.xs-mng-summary-inner {
    border: 1px solid var(--mng-line);
    border-radius: 12px;
    padding: 1.1rem 1.2rem 1.3rem;
    background: #fff;
}
.xs-mng-summary-title { margin: 0 0 .85rem; font-size: 1.1rem; }
.xs-mng-summary-meta { list-style: none; margin: 0 0 .9rem; padding: 0; }
.xs-mng-summary-meta li {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .35rem 0;
    border-bottom: 1px dashed var(--mng-line);
    font-size: .92rem;
}
.xs-mng-summary-meta li span { color: var(--mng-muted); }
.xs-mng-summary-meta li strong { font-variant-numeric: tabular-nums; }
.xs-mng-summary-meta li strong.is-zero { color: var(--mng-ok); }
.xs-mng-summary-wll strong { color: var(--mng-accent); font-size: 1.05rem; }

.xs-mng-warning {
    background: #fff4ec;
    border: 1px solid #f3c39a;
    color: var(--mng-warn);
    border-radius: 8px;
    padding: .55rem .7rem;
    font-size: .85rem;
    margin-bottom: .8rem;
    line-height: 1.4;
}

.xs-mng-price-row {
    display: flex; justify-content: space-between; align-items: baseline;
    margin: .4rem 0 .9rem;
}
.xs-mng-price-row > span:first-child { color: var(--mng-muted); }
.xs-mng-price { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.xs-mng-breakdown { margin-bottom: 1rem; }
.xs-mng-breakdown summary { cursor: pointer; font-size: .9rem; color: var(--mng-muted); }
.xs-mng-bom-table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .85rem; }
.xs-mng-bom-table td { padding: .3rem .2rem; border-bottom: 1px solid var(--mng-line); }
.xs-mng-bom-ref { }
.xs-mng-bom-qty { text-align: center; color: var(--mng-muted); }
.xs-mng-bom-price { text-align: right; font-variant-numeric: tabular-nums; }

.xs-mng-btn {
    width: 100%;
    padding: .75rem 1rem;
    border-radius: 9px;
    border: none;
    font-size: 1rem; font-weight: 600;
    cursor: pointer;
}
.xs-mng-btn--primary { background: var(--mng-accent); color: #fff; }
.xs-mng-btn--primary:hover:not(:disabled) { background: #cf6709; }
.xs-mng-btn--primary:disabled { background: #d7c3b2; cursor: not-allowed; }

.xs-mng-feedback { min-height: 1.2rem; font-size: .85rem; margin: .5rem 0; color: var(--mng-muted); }
.xs-mng-reset-link {
    display: inline-flex; align-items: center; gap: .35rem;
    background: none; border: none; padding: 0;
    color: var(--mng-muted); cursor: pointer; font-size: .82rem; text-decoration: underline;
}
.xs-mng-note { color: var(--mng-muted); font-size: .78rem; line-height: 1.45; margin: 1rem 0 0; }
.xs-mng-noscript { color: var(--mng-warn); }

@media (max-width: 860px) {
    .xs-mng-layout { grid-template-columns: 1fr; }
    .xs-mng-summary { position: static; }
    .xs-mng-cards { grid-template-columns: 1fr; }
}
