/* ============================================================
 * EXTTRA — Гараж — базовый слой окна
 * ============================================================ */

.exttra-garage-modal{
    position: fixed; inset: 0; z-index: 9000;
    background: #161616;
    display: flex; flex-direction: column;
    color: #ffffff;
    font-family: inherit;
    overflow: hidden;
}
.exttra-garage-modal[hidden]{ display: none !important; }

/* ---------- Шапка ---------- */
.exttra-garage-modal__header{
    flex: 0 0 auto;
    padding: 24px 32px 0;
    background: #161616;
    position: sticky; top: 0; z-index: 3;
}
.exttra-garage-modal__title{
    font-size: 28px; line-height: 1.2; font-weight: 700;
    min-height: 36px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.exttra-garage-modal__title .egm-slash{ color: #ffffff; }
.exttra-garage-modal__title .egm-val{ color: #ff9900; }
.exttra-garage-modal__divider{
    margin-top: 16px; height: 2px; background: #dc1010; width: 100%;
}

/* ---------- Столбцы (контейнер) ---------- */
.exttra-garage-modal__cols{
    flex: 1 1 auto;
    display: flex; gap: 16px;
    padding: 24px 32px 0 32px;
    overflow: hidden;
    min-height: 0;
}
.egm-col{
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column;
    transition: opacity .15s ease;
    min-height: 0;
}
.egm-col.is-hidden{ display: none; }

/* ---------- Группа столбцов (Frame + Ready Frame — вертикально, по контенту) ---------- */
.egm-col-group{
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
}
.egm-col-group .egm-col{
    flex: 0 0 auto;
    min-height: 0;
}

.egm-col.is-disabled .egm-btn{ opacity: .6; }

.egm-soon{
    flex: 4 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #717171;
    font-size: 20px;
    font-weight: 600;
    min-height: 200px;
}
.egm-soon[hidden]{ display: none; }

/* ---------- Заголовок столбца ---------- */
.egm-col__title{
    font-size: 12px;
    font-weight: 600;
    color: #717171 !important;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    text-transform: none;
    letter-spacing: 0;
    padding-left: 12px;
    padding-right: 8px;
    flex: 0 0 auto;
    transition: color .15s ease;
}
.egm-col__title .fas{
    margin-left: auto;
    margin-right: 20px;
    font-size: 10px;
    color: #717171 !important;
    transition: color .15s ease;
}
.egm-col:hover .egm-col__title{ color: #ffffff !important; }
.egm-col:hover .egm-col__title .fas{ color: #ffffff !important; }

/* Обёртка текста + иконки подсказки в заголовке — слева, вплотную */
.egm-col__title .egm-col__title-text{
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

/* ---------- Иконка подсказки в заголовке столбца ---------- */
.egm-col__title .egm-btn__hint{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0px;
    font-size: 12px;
    line-height: 1;
    color: #717171;              /* без наведения на столбец = цвет текста */
    cursor: pointer;
    transition: color .15s ease;
    vertical-align: middle;
    /* Сброс стилей из col-*.css (они для кнопок — не нужны в заголовке) */
    padding: 0;
    margin-right: 0;
    position: static;
    top: auto;
    left: auto;
}

/* При наведении на столбец — иконка светлее */
.egm-col:hover .egm-col__title .egm-btn__hint{
    color: #bdbdbd;
}

/* При наведении на иконку — синяя (приоритет выше hover столбца) */
.egm-col__title .egm-btn__hint:hover{
    color: #2590d0 !important;
}

/* ---------- Список кнопок в столбце ---------- */
.egm-col__list{
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(87, 87, 87, 0.2) transparent;
    --egm-sb-thumb: rgba(87, 87, 87, 0.2);
}
.egm-col__list::-webkit-scrollbar{ width: 6px; }
.egm-col__list::-webkit-scrollbar-track{ background: transparent; }
.egm-col__list::-webkit-scrollbar-thumb{
    background: var(--egm-sb-thumb);
    border-radius: 3px;
}
.egm-col:hover .egm-col__list{
    --egm-sb-thumb: rgba(87, 87, 87, 0.8);
    scrollbar-color: rgba(87, 87, 87, 0.8) transparent;
}

/* ---------- Кнопки значений ---------- */
.egm-btn{
    appearance: none; cursor: pointer;
    padding: 10px 14px;
    border-radius: 15px;
    border: 2px solid transparent;
    font-size: 14px; line-height: 1.2;
    text-align: center;
    transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
    background: var(--btn-bg, transparent);
    color: inherit;
}
.egm-btn[disabled]{ cursor: default; }
.egm-btn:hover:not([disabled]){
    background-color: var(--btn-bg-hover, rgba(255,255,255,0.04));
}

/* ---------- Иконка подсказки ---------- */
.egm-btn__label{ flex: 1 1 auto; text-align: center; }
.egm-btn__hint{
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #bdbdbd;
    font-size: 14px;
    line-height: 1;
    padding: 2px;
    margin: -2px -2px -2px 0;
    cursor: pointer;
    transition: color .15s ease;
    --hint-shift-y: 0px;
    --hint-shift-x: 0px;
    position: relative;
    top: var(--hint-shift-y);
    left: var(--hint-shift-x);
}
.egm-btn__hint:hover{ color: #2590d0 !important; }

/* ---------- Футер ---------- */
.exttra-garage-modal__footer{
    flex: 0 0 auto;
    background: #000000;
    border-top: 2px solid #2d2d2d;
    padding: 16px 32px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    position: sticky; bottom: 0; z-index: 3;
}
.egm-btn-footer{
    appearance: none; cursor: pointer;
    height: 40px; padding: 0 22px;
    border-radius: 15px; border: none;
    font-size: 15px; font-weight: 600;
    transition: background .15s ease, color .15s ease;
}
.egm-btn-footer--close{ background: #313131; color: #ffffff; }
.egm-btn-footer--close:hover{ background: #3d3d3d; }
.egm-btn-footer--back{ background: #e77613; color: #ffffff; }
.egm-btn-footer--back:hover{ background: #cc7709; }
.egm-btn-footer--next,
.egm-btn-footer--create{ background: #e77613; color: #ffffff; }
.egm-btn-footer--next:hover,
.egm-btn-footer--create:hover{ background: #cc7709; }
.egm-btn-footer.is-disabled,
.egm-btn-footer:disabled{ background: #2f383e !important; color: #c7c7c7 !important; cursor: default; }

.exttra-garage-modal__footer .egm-btn-footer--close{ grid-column: 5; }
.exttra-garage-modal__footer .egm-btn-footer--create{ grid-column: 6; }
.exttra-garage-modal__footer .egm-btn-footer--next{ display: none; }
.exttra-garage-modal__footer .egm-btn-footer--back{ display: none; }

/* ============================================================
 * МОБ — ТОЛЬКО ТЕЛЕФОН (body.exttra-is-phone).
 * Планшет (body.exttra-is-tablet) — ПК-стили.
 * ============================================================ */

body.exttra-is-phone .exttra-garage-modal__header{
    padding: 16px 16px 0;
    position: static;
}
body.exttra-is-phone .exttra-garage-modal__title{
    font-size: 16px;
    min-height: auto;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
    word-break: break-word;
}
body.exttra-is-phone .exttra-garage-modal__cols{
    padding: 16px;
    display: block;
    overflow-y: auto;
}
body.exttra-is-phone .egm-col{ display: none; }
body.exttra-is-phone .egm-col.is-step{ display: flex; }
body.exttra-is-phone .egm-soon{ display: none; }

body.exttra-is-phone .egm-col.is-step{ margin-bottom: 24px; }
body.exttra-is-phone .egm-col.is-step:last-child{ margin-bottom: 0; }

/* МОБ: Frame ↔ Ready Frame — меньше отступ (ПК не трогаем) */
body.exttra-is-phone .egm-col-group{
    gap: 0px;
}

/* МОБ: Ready Frame ↔ Model — больше отступ */
body.exttra-is-phone .egm-col--ready-frame{
    margin-bottom: 24px !important;
}

body.exttra-is-phone .egm-btn{
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.exttra-is-phone .egm-btn .egm-btn__label{
    display: block;
    text-align: center;
}

body.exttra-is-phone .exttra-garage-modal__footer{
    padding: 12px 16px;
    gap: 8px;
    position: static;
    display: flex;
    justify-content: space-between;
}
body.exttra-is-phone .egm-btn-footer{
    flex: 1 1 0; min-width: 0;
    height: 44px; padding: 0 12px;
}
body.exttra-is-phone .exttra-garage-modal__footer .egm-btn-footer--close,
body.exttra-is-phone .exttra-garage-modal__footer .egm-btn-footer--create,
body.exttra-is-phone .exttra-garage-modal__footer .egm-btn-footer--next,
body.exttra-is-phone .exttra-garage-modal__footer .egm-btn-footer--back{
    grid-column: auto;
    display: inline-block;
}
body.exttra-is-phone .exttra-garage-modal__footer .egm-btn-footer--next{ display: inline-block; }
body.exttra-is-phone .exttra-garage-modal__footer .egm-btn-footer--back{ display: inline-block; }
body.exttra-is-phone .exttra-garage-modal__footer .egm-btn-footer--back[hidden]{ display: none; }

body.exttra-is-phone .exttra-garage-modal__footer.is-last .egm-btn-footer--next{ display: none; }
body.exttra-is-phone .exttra-garage-modal__footer:not(.is-last) .egm-btn-footer--create{ display: none; }

/* МОБ: убрать sticky-hover после тапа */
@media (hover: none) {
    .egm-btn:hover:not([disabled]){ background-color: var(--btn-bg, transparent); }
}

/* Контейнер 4 столбцов (Category / Type / Scale / Drive) —
   display: contents, чтобы они стали прямыми grid-item'ами модалки (места 3–6). */
#egm-cols-dynamic {
    display: contents;
}

#exttra-garage-modal.is-loading .egm-col--category,
#exttra-garage-modal.is-loading .egm-col--type,
#exttra-garage-modal.is-loading .egm-col--weight,
#exttra-garage-modal.is-loading .egm-col--scale,
#exttra-garage-modal.is-loading .egm-col--drive,
#exttra-garage-modal.is-loading .egm-col--motor-count {
    opacity: 0.3;
    pointer-events: none;
}

/* ============================================================
 * ДТС: цвет /// + / по Model (значения — белые при выборе Model)
 * ============================================================ */

/* Авто / Мото / Робот — красный */
.exttra-garage-modal__title.egm-slash--red .egm-slash{ color: #dc1010; }
.exttra-garage-modal__title.egm-slash--red .egm-val{ color: #ffffff; }

/* Лодка — пурпурный */
.exttra-garage-modal__title.egm-slash--purple .egm-slash{ color: #b324b3; }
.exttra-garage-modal__title.egm-slash--purple .egm-val{ color: #ffffff; }

/* Самолёт / Вертолёт / Дрон — оранжевый */
.exttra-garage-modal__title.egm-slash--orange .egm-slash{ color: #ff9900; }
.exttra-garage-modal__title.egm-slash--orange .egm-val{ color: #ffffff; }