/* Timber & sheet material configurator demo */

.mc-demo-nav {
    background: #422006;
    color: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.88rem;
}

.mc-demo-nav .logo { font-weight: 800; color: #fde68a; font-size: 1.05rem; }
.mc-demo-nav .spacer { flex: 1; }
.mc-demo-nav a { color: rgba(255,255,255,0.82); text-decoration: none; }

.mc-demo-hero {
    background: linear-gradient(135deg, #422006, #92400e);
    color: #fff;
    padding: 1.75rem 1.5rem;
}

.mc-demo-hero h1 { margin: 0 0 0.35rem; font-size: 1.55rem; }
.mc-demo-hero p { margin: 0; opacity: 0.92; font-size: 0.92rem; max-width: 820px; line-height: 1.55; }

/* Demo view tabs — customer vs merchant admin */
.mc-demo-view-bar {
    max-width: 1180px;
    margin: 0 auto 0.75rem;
    padding: 0.75rem 1.5rem;
    background: #1e293b;
    color: #fff;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.mc-demo-view-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.mc-demo-view-hint {
    flex: 1 1 220px;
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin: 0;
}

.mc-view-toggle--prominent .demo-view-toggle button,
.mc-view-toggle--prominent button {
    min-height: 38px;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.mc-view-toggle--prominent button.active {
    background: #92400e;
    border-color: #fde68a;
    color: #fff;
}

.mc-view-toggle--prominent button:hover:not(.active) {
    background: rgba(255,255,255,0.15);
}

.mc-body {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 2rem;
}

.mc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.mc-toolbar-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mc-toolbar-spacer { flex: 1; min-width: 0.5rem; }

.mc-toolbar-link {
    min-height: 36px;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    border: 2px solid #92400e;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    color: #92400e;
    cursor: pointer;
}

.mc-toolbar-link:hover { background: #fffbeb; }

.mc-trade-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.85rem;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    font-size: 0.84rem;
    color: #065f46;
}

.mc-trade-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #059669;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mc-trade-inline { font-size: 0.78rem; font-weight: 600; color: #059669; }

.mc-link-btn {
    background: none;
    border: none;
    color: #92400e;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: auto;
}

.mc-unit-toggle { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.mc-unit-btn {
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 2px solid #cbd5e1;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.mc-unit-btn.active {
    background: #92400e;
    border-color: #92400e;
    color: #fff;
}

.mc-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.25rem;
    align-items: start;
}

.mc-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
}

.mc-panel h2 {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    color: #1e293b;
}

.mc-step { margin-bottom: 1rem; }
.mc-step label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.45rem;
    line-height: 1.4;
}

.mc-material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mc-material-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.mc-material-card:hover { border-color: #d97706; }
.mc-material-card.active {
    border-color: #92400e;
    box-shadow: 0 0 0 2px rgba(146, 64, 14, 0.2);
}

.mc-material-card__img {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f1f5f9;
}

.mc-material-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mc-material-card__body {
    padding: 0.45rem 0.5rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mc-material-card__body strong {
    font-size: 0.72rem;
    line-height: 1.3;
    color: #1e293b;
}

.mc-material-card.active .mc-material-card__body strong { color: #92400e; }

.mc-material-card__meta {
    font-size: 0.65rem;
    color: #64748b;
    line-height: 1.25;
}

.mc-material-detail {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.65rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
}

.mc-detail-img {
    width: 100px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.mc-detail-tags {
    margin: 0 0 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mc-detail-hint {
    margin: 0;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.45;
}

.mc-select-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.mc-timber-section[hidden],
.mc-select-row[hidden],
.mc-dim-hidden {
    display: none !important;
}

.mc-timber-section select,
.mc-select-row select,
.mc-length-select,
.mc-qty-input {
    width: 100%;
    min-height: 42px;
    padding: 0.45rem 0.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88rem;
    background: #fff;
}

.mc-timber-section { margin-bottom: 0.65rem; }

.mc-qty-wrap { max-width: 120px; }

.mc-calc-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin: 1rem 0 0.35rem;
    font-size: 0.85rem;
}

.mc-calc-intro {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    color: #78350f;
    line-height: 1.45;
}

.mc-calc-divider {
    border-top: 1px dashed #fcd34d;
    margin: 0.5rem 0;
}

.mc-calc-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
    color: #475569;
}

.mc-calc-row strong { color: #1e293b; text-align: right; }
.mc-calc-row.mc-rate-highlight {
    background: rgba(146, 64, 14, 0.08);
    margin: 0 -0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.mc-calc-row.mc-rate-highlight strong { color: #92400e; font-size: 1rem; }

.mc-calc-row.total {
    font-size: 1rem;
    font-weight: 800;
    color: #92400e;
    border-top: 1px solid #fde68a;
    margin-top: 0.35rem;
    padding-top: 0.5rem;
}

.mc-formula-note {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
}

.mc-validation {
    font-size: 0.82rem;
    margin: 0.35rem 0 0;
    min-height: 1.2em;
}

.mc-validation.error { color: #b91c1c; }
.mc-validation.ok { color: #166534; }

.mc-btn-add {
    width: 100%;
    min-height: 44px;
    background: #92400e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
}

.mc-btn-add:hover { background: #78350f; }
.mc-btn-add:disabled { background: #cbd5e1; cursor: not-allowed; }

.mc-basket-sticky { position: sticky; top: 0.75rem; }

.mc-basket-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 0.88rem;
    padding: 1.5rem 0.5rem;
}

.mc-basket-lines { max-height: 380px; overflow-y: auto; }

.mc-line {
    border-bottom: 1px solid #f1f5f9;
    padding: 0.65rem 0;
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.mc-line:hover { background: #f8fafc; }

.mc-line--active {
    background: #fffbeb;
    border-left: 3px solid #d97706;
    padding-left: 0.45rem;
    margin-left: -0.45rem;
}

.mc-line-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.mc-line-edit-hint {
    font-size: 0.72rem;
    color: #94a3b8;
}

.mc-line--active .mc-line-edit-hint {
    color: #b45309;
    font-weight: 600;
}

.mc-line-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.mc-line-meta { color: #64748b; font-size: 0.78rem; line-height: 1.45; }
.mc-line-prices { margin-top: 0.35rem; color: #475569; }

.mc-line-remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0 0;
    text-decoration: underline;
}

.mc-line-remove:hover { color: #b91c1c; }

.mc-basket-totals {
    border-top: 2px solid #e2e8f0;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.mc-basket-totals .mc-calc-row.total { border-top: none; margin-top: 0; padding-top: 0; }

.mc-vat-note {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0.5rem 0 0;
    line-height: 1.45;
}

.mc-delivery-box {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0;
    border-top: 1px solid #f1f5f9;
}

.mc-delivery-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.mc-delivery-select {
    width: 100%;
    min-height: 40px;
    padding: 0.4rem 0.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #fff;
}

.mc-delivery-notes {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.4;
}

.mc-delivery-notes ul { margin: 0; padding-left: 1.1rem; }

.mc-basket-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.mc-btn-quote {
    flex: 1;
    min-height: 42px;
    background: #166534;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
}

.mc-btn-quote:hover { background: #14532d; }

.mc-btn-secondary {
    min-height: 42px;
    padding: 0 0.85rem;
    background: #fff;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
}

.mc-btn-secondary:hover { border-color: #94a3b8; color: #475569; }

/* Modals */
.mc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}

.mc-modal-backdrop[hidden] { display: none; }

.mc-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.35rem 1.35rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.mc-modal-wide { max-width: 520px; }

.mc-modal h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: #1e293b;
}

.mc-modal-intro {
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.45;
}

.mc-modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}

.mc-modal-close:hover { color: #475569; }

.mc-modal-form label {
    display: block;
    margin-bottom: 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.mc-modal-form input,
.mc-modal-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    min-height: 40px;
    padding: 0.45rem 0.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
}

.mc-modal-form textarea { min-height: 72px; resize: vertical; }

.mc-demo-hints {
    margin-top: 0.85rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.5;
}

.mc-demo-hints p { margin: 0.2rem 0; }

.mc-delivery-list {
    margin: 0 0 0.75rem;
    padding-left: 1.15rem;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
}

.mc-quote-summary {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
}

.mc-quote-success {
    font-size: 0.92rem;
    color: #166534;
    line-height: 1.5;
    margin: 0 0 1rem;
}

.mc-quote-done-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mc-share-input {
    width: 100%;
    min-height: 40px;
    padding: 0.45rem 0.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.78rem;
    margin-bottom: 0.65rem;
    font-family: ui-monospace, monospace;
}

.mc-toolbar-link--ghost {
    border-color: #cbd5e1;
    color: #475569;
    background: #f8fafc;
}

/* Scenario bar */
.mc-scenario-bar {
    max-width: 1180px;
    margin: 0 auto 0.75rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.mc-scenario-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.45rem;
}

.mc-scenario-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.mc-scenario-chip {
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 2px solid #fde68a;
    background: #fffbeb;
    font-size: 0.82rem;
    font-weight: 600;
    color: #92400e;
    cursor: pointer;
}

.mc-scenario-chip:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}

.mc-scenario-hint {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
}

/* Stock badges */
.mc-stock-row { margin-bottom: 0.5rem; }

.mc-stock-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.mc-stock-ok { background: #dcfce7; color: #166534; }
.mc-stock-low { background: #fef3c7; color: #92400e; }
.mc-stock-order { background: #fee2e2; color: #991b1b; }

/* Dual grid — configurator layout */
.mc-dual-grid.demo-dual-grid {
    max-width: none;
    margin: 0 auto;
    padding: 0 1.5rem 1.5rem;
}

.mc-dual-grid .demo-client-column .mc-body {
    padding-left: 0;
    padding-right: 0;
}

.mc-dual-grid[data-view-mode="client"] .demo-admin-column { display: none; }
.mc-dual-grid[data-view-mode="admin"] .demo-client-column { display: none; }

#mcAdminRoot .demo-admin-card h4 {
    margin: 0 0 0.5rem;
    font-size: 0.92rem;
}

.mc-admin-intro {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
}

.mc-admin-count {
    font-weight: 600;
    color: #64748b;
    font-size: 0.82rem;
}

.mc-admin-list,
.mc-admin-log {
    margin: 0;
    padding-left: 0;
    list-style: none;
    font-size: 0.82rem;
    color: #475569;
}

.mc-admin-list li,
.mc-admin-log li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.45;
}

.mc-admin-quote span {
    font-size: 0.75rem;
    color: #64748b;
}

.mc-admin-empty {
    color: #94a3b8 !important;
    font-style: italic;
}

.mc-log-time {
    color: #94a3b8;
    font-size: 0.72rem;
    margin-right: 0.25rem;
}

.mc-erp-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #166534;
    margin-bottom: 0.35rem;
}

.mc-erp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: mc-pulse 2s infinite;
}

@keyframes mc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.mc-stock-alerts .mc-stock-badge { margin-right: 0.35rem; }

.mc-toast {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    background: #166534;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.25s;
    z-index: 50;
}

.mc-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
    .mc-grid { grid-template-columns: 1fr; }
    .mc-select-row { grid-template-columns: 1fr; }
    .mc-basket-sticky { position: static; }
    .mc-material-detail { grid-template-columns: 1fr; }
    .mc-detail-img { width: 100%; height: 120px; }
}

@media (max-width: 480px) {
    .mc-material-grid { grid-template-columns: repeat(2, 1fr); }
}
