/* Sierbach Längenpreis: Eingabe der Länge, Infokacheln, Preisvorschau und Staffelpreise auf der Artikelseite */

/* ---- Felder: Länge über die ganze Breite, darunter die Infokacheln nebeneinander ---- */
dl.sierbach-lp-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

dl.sierbach-lp-fields > * {
    grid-column: 1 / -1;
    min-width: 0;
}

.sierbach-lp-length dt {
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.sierbach-lp-length dd {
    margin-bottom: 0;
}

.sierbach-lp-length-row {
    position: relative;
}

.sierbach-lp-length-row > input.form-control {
    width: 100%;
    height: 3rem;
    padding-right: 2.75rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.sierbach-lp-length-row > input.form-control::placeholder {
    font-weight: 400;
}

.sierbach-lp-length-row > input.form-control:focus {
    border-color: #991914;
    box-shadow: 0 0 0 3px rgba(153, 25, 20, 0.15);
}

/* Einheit rechts im Längenfeld */
.sierbach-lp-suffix {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    font-size: 1.125rem;
    color: #5f6368;
    pointer-events: none;
}

/* Grenzen unter dem Feld: links "min.", rechts "max." */
.sierbach-lp-hint {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.3rem;
    font-size: 0.8125rem;
    line-height: 1.3;
    color: #5f6368;
}

.sierbach-lp-error {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #b3261e;
}

.sierbach-lp-error[hidden] {
    display: none !important;
}

/* ---- Infokacheln (Breite, Gesamtfläche): kleine Beschriftung, darunter der Wert ---- */
dl.sierbach-lp-fields > .sierbach-lp-tile {
    grid-column: auto;
    padding: 0.6rem 0.85rem 0.55rem;
    background-color: #fff;
    border: 1px solid #dedede;
    border-radius: 6px;
}

dl.sierbach-lp-fields > .sierbach-lp-tile.sierbach-lp-tile-wide {
    grid-column: 1 / -1;
}

.sierbach-lp-tile dt {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.3;
    color: #5f6368;
}

.sierbach-lp-tile dd {
    margin: 0;
}

/* Die Werte bleiben Formularfelder, sehen aber wie Text aus und lassen sich nicht anklicken */
.sierbach-lp-tile input.sierbach-lp-readonly,
.sierbach-lp-tile input.sierbach-lp-readonly:focus {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    color: #212529;
    cursor: default;
    pointer-events: none;
    user-select: none;
}

/* ---- Preisvorschau ---- */
.sierbach-lp-result {
    margin: 0 0 1.25rem;
    padding: 0.5rem 1rem;
    background-color: #fff;
    border: 1px solid #dedede;
    border-left: 4px solid #991914;
    border-radius: 6px;
}

.sierbach-lp-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.15rem 1rem;
    padding: 0.4rem 0;
    font-size: 0.9375rem;
}

.sierbach-lp-line + .sierbach-lp-line {
    border-top: 1px solid #eeeeee;
}

.sierbach-lp-label {
    color: #5f6368;
}

.sierbach-lp-value {
    margin-left: auto;
    text-align: right;
    color: #212529;
}

.sierbach-lp-line-strong .sierbach-lp-label {
    color: #212529;
    font-weight: 600;
}

.sierbach-lp-line-strong .sierbach-lp-value {
    font-size: 1.0625rem;
    font-weight: 700;
}

/* ---- Fortschritt zum nächsten Staffelpreis: eine Zeile mit Text und schmalem Balken ---- */
.sierbach-lp-box .sierbach-lp-result {
    margin-bottom: 0.6rem;
}

.sierbach-lp-box .sierbach-lp-result:last-child {
    margin-bottom: 1.25rem;
}

.sierbach-lp-progress {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.85rem;
    margin: 0 0 1.25rem;
    padding: 0.5rem 0.85rem;
    background-color: #fff;
    border: 1px solid #dedede;
    border-radius: 6px;
    font-size: 0.9375rem;
    line-height: 1.35;
    color: #212529;
}

.sierbach-lp-progress-status strong {
    font-weight: 700;
    color: #1e6b34;
    white-space: nowrap;
}

.sierbach-lp-progress-track {
    display: block;
    flex: 1 1 5rem;
    min-width: 5rem;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
}

.sierbach-lp-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background-color: #2e8b47;
    border-radius: 999px;
    transition: width 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
    .sierbach-lp-progress-fill {
        transition: none;
    }
}
/* "pro m²" hinter dem Artikelpreis */
.sierbach-lp-unit {
    margin-left: 0.35rem;
    font-size: 0.5em;
    font-weight: 400;
    white-space: nowrap;
}

/* ---- Staffelpreise: Tabelle unter dem Preis ---- */
.sierbach-lp-tiers {
    margin: 1rem 0 1.25rem;
    font-size: 0.9375rem;
}

.sierbach-lp-tiers-title {
    margin: 0 0 0.4rem;
    font-weight: 700;
}

.sierbach-lp-tiers-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #fff;
    border: 1px solid #dedede;
    border-radius: 6px;
    overflow: hidden;
}

.sierbach-lp-tiers-table th,
.sierbach-lp-tiers-table td {
    padding: 0.5rem 0.85rem;
    border-top: 1px solid #eeeeee;
    text-align: left;
    font-weight: 400;
    vertical-align: middle;
}

.sierbach-lp-tiers-table thead th {
    border-top: 0;
    background-color: #f6f6f6;
    font-size: 0.8125rem;
    color: #5f6368;
}

.sierbach-lp-tiers-table td:last-child,
.sierbach-lp-tiers-table thead th:last-child {
    text-align: right;
}

.sierbach-lp-tiers-table tbody td:nth-child(2) {
    font-weight: 600;
}

/* Ersparnis als grüne Marke */
.sierbach-lp-saving {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background-color: #e3f3e7;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e6b34;
    white-space: nowrap;
}

/* Stufe, die mit dem Warenkorb und der aktuellen Auswahl erreicht ist */
.sierbach-lp-tiers-table tr.sierbach-lp-tier-active th,
.sierbach-lp-tiers-table tr.sierbach-lp-tier-active td {
    background-color: #fbefee;
    font-weight: 700;
}

.sierbach-lp-tiers-table tr.sierbach-lp-tier-active th {
    box-shadow: inset 4px 0 0 #991914;
}

.sierbach-lp-tiers-note {
    margin: 0.45rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #5f6368;
}

/* Elemente mit hidden-Attribut auch dann verbergen, wenn ein Theme display überschreibt */
.sierbach-lp-box [hidden] {
    display: none !important;
}

/* Sehr schmale Bildschirme: etwas weniger Innenabstand in der Tabelle */
@media (max-width: 400px) {
    .sierbach-lp-tiers-table th,
    .sierbach-lp-tiers-table td {
        padding: 0.45rem 0.55rem;
    }
}
