/* hall-plan.css — стили интерактивного плана зала */

.hp-root {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #1a1a1a;
}

/* ---------- легенда цен ---------- */
.hp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.hp-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid #e3e3e6;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: opacity .15s, border-color .15s;
}

.hp-legend__item i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.hp-legend__item em {
    font-style: normal;
    color: #8b8b93;
    font-size: 12px;
}

.hp-legend__item.is-off {
    opacity: .4;
    border-style: dashed;
}

/* ---------- схема ---------- */
.hp-stage-wrap {
    border: 1px solid #ececef;
    border-radius: 14px;
    background: #fafafb;
    padding: 8px;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.hp-svg {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
}

.hp-scene {
    fill: #e7e7ec;
}

.hp-scene-label {
    font-size: 12px;
    letter-spacing: 2px;
    fill: #8b8b93;
}

.hp-sector-label {
    font-size: 12px;
    font-weight: 600;
    fill: #6f6f78;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.hp-row-label {
    font-size: 10px;
    fill: #b0b0b8;
}

/* ---------- места ---------- */
.hp-seat {
    cursor: pointer;
    outline: none;
}

.hp-seat__dot {
    transition: transform .12s ease, opacity .15s;
    transform-box: fill-box;
    transform-origin: center;
}

.hp-seat__num {
    font-size: 9px;
    fill: #fff;
    pointer-events: none;
    opacity: .85;
}

.hp-seat:hover .hp-seat__dot,
.hp-seat:focus .hp-seat__dot {
    transform: scale(1.25);
}

.hp-seat.is-selected .hp-seat__dot {
    stroke: #111;
    stroke-width: 3;
    transform: scale(1.2);
}

.hp-seat.is-selected .hp-seat__num {
    opacity: 0;
}

.hp-seat.hp-seat--dim {
    opacity: .18;
    pointer-events: none;
}

/* ---------- тултип ---------- */
.hp-tip {
    position: absolute;
    z-index: 30;
    transform: translate(-50%, -100%);
    background: #111;
    color: #fff;
    font-size: 12px;
    line-height: 1.35;
    padding: 6px 9px;
    border-radius: 8px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.hp-tip b {
    display: block;
    font-weight: 600;
}

.hp-tip span {
    color: #ffd666;
}

/* ---------- позиции без места ---------- */
.hp-extras {
    margin-top: 12px;
}

.hp-extras__title {
    font-size: 12px;
    text-transform: uppercase;
    color: #8b8b93;
    margin-bottom: 6px;
}

.hp-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid #e3e3e6;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}

.hp-extra.is-selected {
    border-color: #111;
    background: #fffbe9;
}

/* ---------- мобильные ---------- */
@media (max-width: 576px) {
    .hp-seat__num { display: none; }
    .hp-legend__item { font-size: 12px; padding: 4px 8px; }
}

/* ---------- проданные / недоступные места ---------- */
.hp-seat--sold {
    cursor: default;
    pointer-events: none;
}

.hp-seat--sold .hp-seat__dot {
    fill: #dcdce2;
}

.hp-seat--sold .hp-seat__num {
    fill: #a9a9b3;
}

/* ================= модалка "Выбрать места на плане зала" ================= */

#hallPlanModal .modal-dialog {
    max-width: 900px;
}

#hallPlanModal .modal-body {
    max-height: 72vh;
    overflow-y: auto;
}

.hp-hint {
    font-size: 12px;
    margin: 10px 0 0;
}

.hp-modal-footer {
    display: block;
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #ececef;
}

.hp-modal-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    padding-bottom: 8px;
}

.hp-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.choose-seats-plan-button {
    margin-bottom: 8px;
    font-weight: 600;
}

/* план внутри модалки не должен быть выше экрана */
#hallPlanModal .hp-stage-wrap .hp-svg {
    max-height: 58vh;
}

/* ============ лента выбранных билетов (как у Яндекс.Афиши) ============
 * Горизонтальная полоса карточек в подвале: «2 ряд, 5 место / Амфитеатр / 6 500 ₽».
 * Появляется только когда выбран хотя бы один билет.
 */

.hp-bar {
    display: none;
    align-items: stretch;
    gap: 0;
    margin-top: 12px;
    border-top: 1px solid #ececef;
    background: #fff;
}

.hp-bar.is-visible {
    display: flex;
}

/* прокручиваемая лента карточек */
.hp-bar__cards {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px 12px;
    gap: 0;
}

.hp-bar__cards::-webkit-scrollbar { height: 4px; }
.hp-bar__cards::-webkit-scrollbar-thumb { background: #d5d5dc; border-radius: 4px; }

/* карточка одного билета */
.hp-card {
    position: relative;
    flex: 0 0 auto;
    min-width: 152px;
    padding: 12px 30px 12px 16px;
    background: #fff;
    border: 1px solid #e8e8ec;
    border-radius: 12px;
    box-shadow: -6px 0 14px rgba(0, 0, 0, .06);
    transition: transform .16s ease, box-shadow .16s ease;
}

/* Наложение: каждая следующая карточка заезжает на предыдущую,
 * как в подвале Яндекс.Афиши. */
.hp-card + .hp-card {
    margin-left: -14px;
}

/* Карточка под курсором выходит вперёд и выдвигается */
.hp-card:hover,
.hp-card.is-front {
    z-index: 50 !important;
    transform: translateY(-3px);
    box-shadow: -8px 4px 20px rgba(0, 0, 0, .13);
}

.hp-card__title {
    font-size: 14px;
    font-weight: 500;
    color: #17171a;
    white-space: nowrap;
}

.hp-card__sector {
    font-size: 12px;
    color: #9a9aa2;
    margin-top: 2px;
    white-space: nowrap;
}

.hp-card__price {
    font-size: 14px;
    font-weight: 600;
    color: #17171a;
    margin-top: 6px;
    white-space: nowrap;
}

.hp-card__remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: #f0f0f4;
    color: #77777f;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity .15s, background .15s;
}

.hp-card:hover .hp-card__remove,
.hp-card__remove:focus { opacity: 1; }

.hp-card__remove:hover { background: #ffdcdc; color: #c33; }

/* итог справа */
.hp-bar__summary {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    white-space: nowrap;
}

.hp-bar__total {
    font-size: 14px;
    color: #55555d;
}

.hp-bar__total b {
    font-size: 16px;
    color: #17171a;
    margin-left: 2px;
}

/* место, подсвеченное наведением на карточку */
.hp-seat.is-hl .hp-seat__dot {
    stroke: #2f6fed;
    stroke-width: 3;
    transform: scale(1.35);
}

/* на мобильных крестик всегда видно — hover нет */
@media (max-width: 768px) {
    .hp-card { min-width: 138px; padding: 10px 26px 10px 12px; }
    .hp-card + .hp-card { margin-left: -10px; }
    .hp-card__remove { opacity: 1; width: 22px; height: 22px; }
    .hp-bar { flex-direction: column; }
    .hp-bar__summary { justify-content: flex-end; padding: 10px 12px; border-top: 1px solid #f2f2f5; }
}

/* ================= зум ================= */

.hp-stage-wrap {
    position: relative;
    touch-action: none;   /* пинч обрабатываем сами */
    cursor: grab;
}

.hp-stage-wrap.is-zoomed { cursor: grab; }
.hp-stage-wrap:active { cursor: grabbing; }

.hp-zoom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid #e3e3e6;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
    z-index: 5;
}

.hp-zoom button {
    width: 32px;
    height: 32px;
    border: 0;
    background: none;
    border-radius: 8px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    color: #33333a;
}

.hp-zoom button:hover { background: #f0f0f4; }

.hp-zoom__level {
    font-size: 11px;
    color: #8b8b93;
    min-width: 38px;
    text-align: center;
    user-select: none;
}

@media (max-width: 576px) {
    .hp-zoom button { width: 38px; height: 38px; font-size: 19px; }
    .hp-selection__list { max-height: 150px; }
}

/* тултип, развёрнутый вниз (когда сверху нет места) */
.hp-tip--below { transform: translate(-50%, 0); }

@media (max-width: 576px) {
    .hp-tip { max-width: 78vw; white-space: normal; text-align: center; }
}

/* ============ заглушка «схема зала недоступна» ============ */

.hp-unavailable {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    border: 1px dashed #dcdce2;
    border-radius: 14px;
    background: #fafafb;
}

.hp-unavailable__icon {
    color: #c2c2cc;
    margin-bottom: 14px;
    line-height: 0;
}

.hp-unavailable__text {
    font-size: 15px;
    font-weight: 600;
    color: #55555d;
    max-width: 340px;
}

.hp-unavailable__hint {
    font-size: 13px;
    color: #9a9aa2;
    margin-top: 8px;
    max-width: 340px;
    line-height: 1.45;
}

.hp-unavailable__button {
    margin-top: 18px;
    padding: 10px 22px;
    border: 0;
    border-radius: 10px;
    background: #2f9e54;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.hp-unavailable__button:hover { background: #2a8c4a; }

@media (max-width: 576px) {
    .hp-unavailable { padding: 30px 16px; }
}
