/* OtoLider — wspólna warstwa wizualna sekcji „Dane techniczne”. */
.lm-technical-section .lm-input-unit {
    position: relative;
}

.lm-technical-section .lm-input-unit input {
    padding-right: 42px !important;
}

.lm-technical-section .lm-input-unit .lm-unit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #52606f;
    font-weight: 700;
    pointer-events: none;
}

.lm-technical-section .lm-no-spin::-webkit-outer-spin-button,
.lm-technical-section .lm-no-spin::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.lm-technical-section .lm-no-spin {
    -moz-appearance: textfield;
}

.lm-technical-section .lm-electric-fuel-note {
    display: none;
    margin-top: 6px;
    color: #41556d;
    font-size: 12px;
    font-weight: 700;
}

.lm-technical-section .lm-electric-fuel-note.is-visible {
    display: block;
}

.lm-technical-section .lm-electric-smooth {
    overflow: hidden;
    max-height: 260px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height .24s ease, opacity .2s ease, transform .2s ease, margin .2s ease;
}

.lm-technical-section .lm-electric-smooth.is-collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-5px);
    margin-top: -8px;
    margin-bottom: 0;
    pointer-events: none;
}

.lm-technical-section .lm-electric-smooth.is-collapsed input,
.lm-technical-section .lm-electric-smooth.is-collapsed select,
.lm-technical-section .lm-electric-smooth.is-collapsed textarea {
    pointer-events: none;
}

.lm-technical-section .lm-clearable-wrap {
    position: relative;
}

.lm-technical-section .lm-clearable-wrap > input,
.lm-technical-section .lm-clearable-wrap > select {
    padding-right: 30px !important;
}

.lm-technical-section .lm-control-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    z-index: 3;
    display: none;
    width: 22px;
    height: 22px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #52606f;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.lm-technical-section .lm-control-clear:hover {
    color: #d52e2c;
}

.lm-technical-section .lm-control-clear.is-visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lm-technical-section .lm-input-unit.has-clear input {
    padding-right: 70px !important;
}

.lm-technical-section .lm-input-unit.has-clear .lm-control-clear {
    right: 34px;
}

/*
 * Wspólna siatka sekcji „Dane techniczne”.
 * Formularz kategorii ustala wyłącznie kolejność i widoczność pól.
 * Szerokości, odstępy i zachowanie responsywne są wspólne.
 */
.lm-technical-grid {
    --lm-tech-columns: 3;
    display: grid;
    grid-template-columns: repeat(var(--lm-tech-columns), minmax(0, 1fr));
    gap: 18px 24px;
    align-items: start;
    margin-bottom: 16px;
}

.lm-technical-grid[data-lm-tech-columns="2"] {
    --lm-tech-columns: 2;
}

.lm-technical-grid[data-lm-tech-columns="1"] {
    --lm-tech-columns: 1;
}

/* Pomocnicze grupy nie tworzą własnej pozycji w siatce. */
.lm-technical-grid > .lm-technical-grid-flow {
    display: contents;
}

.lm-technical-grid > .lm-technical-grid-flow > .lm-field,
.lm-technical-grid > .lm-field {
    min-width: 0;
}

/*
 * Pole wyłączone konfiguracją kategorii lub ukryte przez logikę formularza
 * nie może pozostawiać pustej komórki w siatce. Klasa layout-hidden jest
 * ustawiana przez wspólny JS po sprawdzeniu faktycznie widocznych kontrolek.
 */
.lm-technical-grid .lm-field.is-hidden,
.lm-technical-grid .lm-field.lm-tech-layout-hidden {
    display: none !important;
}

/* Ukryte pola techniczne nigdy nie mogą zajmować pustej kolumny. */
.lm-technical-grid > input[type="hidden"],
.lm-technical-grid > input[aria-hidden="true"],
.lm-technical-grid > .lm-combo-suggest[style*="display:none"],
.lm-technical-grid > .lm-technical-grid-flow > input[type="hidden"],
.lm-technical-grid > .lm-technical-grid-flow > input[aria-hidden="true"],
.lm-technical-grid > .lm-technical-grid-flow > .lm-combo-suggest[style*="display:none"] {
    display: none !important;
}

/* Grupa warunkowa, np. parametry pojazdu elektrycznego. */
.lm-technical-grid > .lm-technical-grid-group {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(var(--lm-tech-columns), minmax(0, 1fr));
    gap: 18px 24px;
    min-width: 0;
    margin: 0;
}

/* Dowolna kategoria może jawnie zakończyć sekcję równym rzędem dwóch pól. */
.lm-technical-grid > .lm-technical-grid-group[data-lm-tech-group-columns="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Po zwinięciu grupa nie zostawia pustego wiersza ani odstępu. */
.lm-technical-grid > .lm-technical-grid-group.is-collapsed {
    display: none;
}

/* Opcjonalne szerokości, dostępne dla wszystkich kategorii. */
.lm-technical-grid .lm-tech-span-2 {
    grid-column: span 2;
}

.lm-technical-grid .lm-tech-full {
    grid-column: 1 / -1;
}

@media (max-width: 980px) {
    .lm-technical-grid,
    .lm-technical-grid[data-lm-tech-columns="2"],
    .lm-technical-grid[data-lm-tech-columns="3"] {
        --lm-tech-columns: 1;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .lm-technical-grid > .lm-technical-grid-group,
    .lm-technical-grid > .lm-technical-grid-group[data-lm-tech-group-columns="2"] {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .lm-technical-grid .lm-tech-span-2,
    .lm-technical-grid .lm-tech-full {
        grid-column: 1;
    }
}
