/* ============================================================
 *  order-redesign.css — новая вёрстка страницы /order/{id}
 *  Все правила ограничены классом .ord, чтобы не задеть
 *  Bootstrap, модалки и остальные страницы сайта.
 *  v1
 * ============================================================ */

.ord { --ord-green: #2f9e54; --ord-line: #e6e6ea; --ord-ink: #17171a; --ord-mute: #77777f; }

.ord__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    gap: 18px;
    align-items: start;
}
.ord__main, .ord__side { min-width: 0; }
.ord__side { position: sticky; top: 16px; }

/* ---------- карточки ---------- */
.ord-card {
    background: #fff;
    border: 0;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(16, 16, 24, .04),
                0 4px 16px rgba(16, 16, 24, .07);
}
.ord-card__title { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--ord-ink); }

/* ---------- шапка левой колонки ---------- */
.ord-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.ord-head__title { font-size: 16px; margin: 0; font-weight: 700; color: var(--ord-ink); }

/* ---------- переключатель «Схема / Списком» ---------- */
.ord .viewsw { display: inline-flex; background: #f2f2f6; border-radius: 9px; padding: 3px; gap: 2px; }
.ord .viewsw__b {
    display: inline-flex; align-items: center; gap: 6px;
    border: 0; background: none; cursor: pointer; padding: 6px 12px;
    border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ord-mute);
    font-family: inherit; transition: background .15s, color .15s, box-shadow .15s;
}
.ord .viewsw__b .fa { font-size: 12px; }
.ord .viewsw__b:hover { color: var(--ord-ink); }
.ord .viewsw__b.on { background: #fff; color: var(--ord-ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- контейнер плана ---------- */
.ord-plan { min-height: 320px; }

/* ---------- список категорий ---------- */
.ord-list__top, .ord-list__bottom { margin-bottom: 10px; }
.ord-list__bottom { margin: 12px 0 0; }

/* аккордеон «План зала» внутри списка */
.ord .hall-plan-section { margin-bottom: 10px; }

/* ---------- корзина: карточки стопкой ---------- */
.ord-stack-wrap { position: relative; min-width: 0; }
.ord-stack {
    display: flex; overflow-x: auto; min-width: 0;
    padding: 2px 2px 8px; margin: 0 -2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.ord-tk {
    position: relative; flex: 0 0 auto; width: 132px; min-width: 0;
    background: #fff; border: 1px solid #ececf1; border-radius: 12px;
    padding: 9px 10px; margin-right: -14px; scroll-snap-align: start;
    box-shadow: -6px 0 14px rgba(16, 16, 24, .07);
    transition: transform .15s, box-shadow .15s;
}
.ord-tk:last-child { margin-right: 0; }
.ord-tk:hover, .ord-tk.is-hl {
    transform: translateY(-3px); z-index: 50;
    box-shadow: -8px 4px 20px rgba(16, 16, 24, .13); border-color: #dcdce2;
}
.ord-tk__name {
    font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--ord-ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* цена — не жирная и сероватая */
.ord-tk__price {
    font-size: 13px; font-weight: 500; color: #6b6b73;
    margin-top: 5px; white-space: nowrap;
}
.ord-tk__x {
    position: absolute; top: 4px; right: 4px; width: 19px; height: 19px;
    border: 0; border-radius: 50%; background: #f0f0f4; color: var(--ord-mute);
    font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .15s;
}
.ord-tk:hover .ord-tk__x { opacity: 1; }
@media (hover: none) { .ord-tk__x { opacity: 1; } }

.ord-empty {
    text-align: center; color: var(--ord-mute); font-size: 13px;
    padding: 22px 10px; background: #fafafc; border-radius: 10px; line-height: 1.5;
}
.ord-total {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid var(--ord-line); margin-top: 10px; padding-top: 10px;
    font-size: 14px; color: var(--ord-mute);
}
.ord-total b { font-size: 19px; color: var(--ord-ink); }

/* ---------- способ оплаты ---------- */
.ord-pays { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.ord-pay {
    display: flex; align-items: center; gap: 8px; margin: 0;
    border: 1px solid #e9e9ef; border-radius: 12px; background: #fcfcfd;
    padding: 11px 13px; font-size: 14px; cursor: pointer; font-weight: 500;
    transition: border-color .15s, background .15s;
}
.ord-pay.on { border-color: var(--ord-green); background: #f4faf6; }
.ord-pay input[type="radio"] { accent-color: var(--ord-green); margin: 0; position: static; }
.ord-pay.dis { cursor: pointer; color: #a0a0a8; }
.ord-pay.dis input { pointer-events: none; }
.ord-pay .fa-question-circle { color: #66666e; cursor: pointer; }
.ord-pay .fa-question-circle:hover { color: var(--ord-green); }

/* ---------- согласие ---------- */
.ord-agree { margin: 12px 0; }
.ord-agree label { display: flex; gap: 9px; align-items: flex-start; margin: 0; font-weight: 400; }
.ord-agree input[type="checkbox"] {
    accent-color: var(--ord-green); width: 15px; height: 15px;
    flex: 0 0 auto; margin-top: 2px; position: static;
}
.ord-agree small { line-height: 1.45; }
.ord-agree a { color: inherit; text-decoration: underline; text-decoration-color: #c2c2cb; text-underline-offset: 2px; }
.ord-agree a:hover { color: var(--ord-ink); text-decoration-color: #8b8b93; }

/* ---------- кнопка оплаты ---------- */
.ord .ord-paybtn { font-size: 16px; font-weight: 700; padding: 12px; border-radius: 10px; }

.ord-trust {
    display: flex; flex-wrap: wrap; gap: 12px;
    font-size: 12px; color: var(--ord-mute); margin-top: 12px;
}

/* ---------- ссылка «Описание мероприятия» ---------- */
.ord-about {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--ord-mute); margin-top: 10px;
}
.ord-about a { color: var(--ord-mute); text-decoration: underline; text-decoration-color: #c2c2cb; }
.ord-about a:hover { color: var(--ord-ink); }

/* ============ мобильная липкая полоса ============ */
.ord-mobbar { display: none; }

@media (max-width: 991.98px) {
    .ord__grid { grid-template-columns: minmax(0, 1fr); }
    .ord__side { position: static; }

    .ord-mobbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        background: #fff; border-top: 1px solid var(--ord-line); padding: 10px 14px;
        align-items: center; gap: 12px; box-shadow: 0 -4px 20px rgba(16,16,24,.10);
    }
    .ord-mobbar.is-off { display: none; }
    .ord-mobbar__sum { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--ord-mute); }
    .ord-mobbar__sum b { display: block; font-size: 18px; color: var(--ord-ink); }
    .ord-mobbar .btn { white-space: nowrap; }

    /* место под полосу */
    body.ord-has-mobbar { padding-bottom: 86px; }
    body.ord-mobbar-off { padding-bottom: 0; }

    /* контакты показываем после первого билета */
    .ord #ordFormBox.is-hidden { display: none; }
}

/* ============================================================
 *  Шапка события (block header_title).
 *  Хлебные крошки НЕ трогаем — они одинаковые на всём сайте.
 * ============================================================ */

/* --- карточка события --- */
.ord-ev {
    background: #fff;
    border: 0;
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(16, 16, 24, .04),
                0 4px 16px rgba(16, 16, 24, .07);
}
.ord-ev__title {
    font-size: 26px; line-height: 1.22; font-weight: 800;
    margin: 0 0 10px; color: #17171a;
}
.ord-ev__meta {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px 14px; font-size: 14px; color: #66666e;
}
.ord-ev__date b { color: #17171a; }
.ord-ev__badge {
    background: #eaf7ef; color: #1f7a43; font-weight: 700;
    font-size: 12px; padding: 4px 10px; border-radius: 999px;
}

@media (max-width: 575.98px) {
    .ord-ev { padding: 14px 15px; }
    .ord-ev__title { font-size: 20px; }
}

/* ============================================================
 *  Правки после первого выката
 * ============================================================ */

/* --- ошибки формы: отдельным блоком на всю ширину под колонками --- */
.ord-errors { margin-top: 4px; }
.ord-errors .alert-danger {
    display: flex; align-items: flex-start; gap: 10px;
    border-radius: 14px; border: 0; background: #fdf1f2; color: #a32330;
    box-shadow: 0 1px 2px rgba(16,16,24,.04), 0 4px 14px rgba(163,35,48,.07);
    padding: 13px 16px; margin-bottom: 10px; font-size: 14.5px; line-height: 1.45;
}
.ord-errors .alert-danger:last-child { margin-bottom: 0; }
.ord-errors .fa { font-size: 16px; line-height: 1.35; flex: 0 0 auto; }

/* --- «Свободных билетов» над схемой (как в режиме «Списком») --- */
.ord-plan__top { margin-bottom: 10px; }

/* --- подвал под схемой: «Билеты по запросу», как и под списком --- */
.ord-plan__foot {
    margin-top: 10px; padding-top: 12px; border-top: 1px solid #f0f0f4;
}

/* --- кнопка оплаты: тоньше --- */
.ord .ord-paybtn {
    position: relative;
    font-size: 15.5px; font-weight: 700;
    padding: 9px 14px; border-radius: 10px; min-height: 42px;
    display: flex; align-items: center; justify-content: center;
}

/* --- спиннер --- */
.ord-paybtn__label { transition: opacity .15s; }
.ord-paybtn__label.is-off { opacity: 0; }

.ord-paybtn__spin {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; gap: 9px;
}
.ord-paybtn__wait { font-size: 14.5px; font-weight: 600; }

.ord-spinner {
    width: 17px; height: 17px; flex: 0 0 auto;
    border: 2.5px solid rgba(58, 44, 0, .25);
    border-top-color: #3a2c00;
    border-radius: 50%;
    animation: ord-spin .7s linear infinite;
}
@keyframes ord-spin { to { transform: rotate(360deg); } }

/* старый #loadingIcon оставлен в разметке ради handleClick(), но скрыт */
.ord-legacy-spin { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .ord-spinner { animation-duration: 2s; }
}

/* --- подсветка незаполненных полей после нажатия «Оплатить» --- */
.ord .form-control.is-invalid-ord {
    border-color: #e05260;
    background: #fffafa;
    box-shadow: 0 0 0 3px rgba(224, 82, 96, .12);
}
.ord .form-control.is-invalid-ord::placeholder { color: #c2707a; }
.ord .form-control.is-invalid-ord:focus {
    border-color: #d0364a;
    box-shadow: 0 0 0 3px rgba(208, 54, 74, .18);
}

/* ============================================================
 *  Позиции в списке категорий — как в демо.
 *  Разметка внутри .ticket-category-item НЕ менялась (там живые
 *  ng-model / ng-change), поэтому раскладку задаём флексом:
 *  название — цена — чекбокс, всё по центру по вертикали.
 *  Классы pull-left / pull-right остались от Bootstrap 3, в 4-й
 *  версии их нет — из-за этого элементы и разъезжались.
 * ============================================================ */

.ord .ticket-category-item { margin: 0 0 8px; }
.ord .ticket-category-item:last-child { margin-bottom: 0; }
.ord .ticket-category-item .input-group { display: block; width: 100%; }

.ord .ticket-category-item .ord-ti {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    background: #fff;
    text-align: left;
    white-space: normal;
    box-shadow: none;
    transition: border-color .12s, background .12s;
}
.ord .ticket-category-item .ord-ti:hover { background: #fafbfc; border-color: #dcdce2; }
.ord .ticket-category-item .ord-ti.is-on { border-color: #2f9e54; background: #f6fbf7; }
.ord .ticket-category-item .ord-ti:focus,
.ord .ticket-category-item .ord-ti:active { box-shadow: none; }

/* название — тянется, цена — прижата вправо, порядок задаём явно */
.ord .ticket-category-item .input-group-addon {
    float: none !important;
    padding: 0;
    border: 0;
    background: none;
    display: inline-flex;
    align-items: center;
}
.ord .ticket-category-item .input-group-addon:nth-of-type(1) {
    order: 1; flex: 1 1 auto; min-width: 0;
    font-size: 14px; color: #252b31; font-weight: 500; line-height: 1.35;
}
.ord .ticket-category-item .input-group-addon:nth-of-type(2) {
    order: 2; flex: 0 0 auto; gap: 3px;
    font-size: 14px; font-weight: 600; color: #55555d; white-space: nowrap;
}
/* пустой служебный span itemprop="ch" — не занимает место */
.ord .ticket-category-item .input-group-addon:nth-of-type(3) { order: 3; display: none; }

/* чекбокс — справа, по центру строки */
.ord .ticket-category-item input[type="checkbox"] {
    order: 4;
    float: none !important;
    position: static;
    flex: 0 0 auto;
    width: 19px; height: 19px;
    margin: 0;
    accent-color: #2f9e54;
    background: none !important;
    cursor: pointer;
}
