/* План главного зала (GLA-343). Схему рисует js/club-plan.js —
   на /plan/ и в брони (/booking/). */

.cp-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border-radius: 16px;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
}

.cp-svg {
    display: block;
    width: 100%;
    height: auto;
    font-family: 'Montserrat', sans-serif;
    animation: cp-fade-in 0.3s ease-out both;
}

/* Скелетон — пока скрипт не нарисовал схему (GLA-343, просьба владельца). Размер ровно
   как у схемы: 1620×810 на компьютере, 860×430 на телефоне, — после замены ничего
   под ним не прыгает. Цвета и ход — как у .img-skeleton сайта. */
.cp-skeleton {
    width: 100%;
    aspect-ratio: 1620 / 810;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: cp-skeleton 1.5s ease-in-out infinite;
}

@keyframes cp-skeleton {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes cp-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cp-table-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* На телефоне схема шире экрана и листается вбок: ужатая до 320 px, она давала
   столы по 10 px и нечитаемые номера */
@media (max-width: 700px) {
    .cp-svg {
        width: 860px;
        max-width: none;
    }
    .cp-skeleton {
        aspect-ratio: auto;
        height: 432px;
    }
}

.cp-room {
    fill: #161616;
    stroke: #2c2c2c;
    stroke-width: 2;
}

.cp-floor {
    fill: #101010;
}

.cp-band {
    fill: none;
    stroke: #2a2a2a;
    stroke-width: 28;
}

.cp-stage {
    fill: none;
    stroke: #8a8a8a;
    stroke-width: 4;
    stroke-linecap: round;
}

.cp-label {
    fill: #8a8a8a;
    font-size: 26px;
    font-weight: 600;
}

.cp-label-floor {
    fill: #5c5c5c;
    font-size: 72px;
    font-weight: 700;
}

.cp-label-stage {
    font-size: 36px;
}

.cp-bar path {
    fill: none;
    stroke: #6f6f6f;
    stroke-width: 4;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.cp-bar text {
    fill: #8a8a8a;
    font-size: 24px;
    font-weight: 600;
}

.cp-table {
    cursor: pointer;
    outline: none;
    animation: cp-table-in 0.35s ease-out both;
}

.cp-table rect {
    fill: #262626;
    stroke: #5a5a5a;
    stroke-width: 3;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.cp-table text {
    fill: #e6e6e6;
    font-size: 26px;
    font-weight: 700;
    pointer-events: none;
}

.cp-table:hover rect,
.cp-table:focus-visible rect {
    stroke: #fff;
}

.cp-table:focus-visible rect {
    stroke-width: 5;
}

.cp-table.is-selected rect {
    fill: #fff;
    stroke: #fff;
}

.cp-table.is-selected text {
    fill: #000;
}

/* Танцпол, который можно нажать (страница события, GLA-349): под курсором и в фокусе
   подсвечивается так же, как стол */
.cp-floor-zone {
    cursor: pointer;
    outline: none;
}

.cp-floor-zone .cp-floor {
    transition: fill 0.15s ease;
}

.cp-floor-zone:hover .cp-floor,
.cp-floor-zone:focus-visible .cp-floor {
    fill: #1c1c1c;
}

.cp-floor-zone:hover .cp-band,
.cp-floor-zone:focus-visible .cp-band {
    stroke: #3a3a3a;
}

.cp-floor-zone:hover .cp-label-floor,
.cp-floor-zone:focus-visible .cp-label-floor {
    fill: #9a9a9a;
}

.cp-hint {
    display: none;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

@media (max-width: 700px) {
    .cp-hint {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cp-floor-zone .cp-floor,
    .cp-table rect {
        transition: none;
    }
    .cp-svg,
    .cp-table,
    .cp-skeleton {
        animation: none;
    }
}

/* ---- Страница /plan/ ---- */
.plan-content {
    max-width: 1100px;
}

.plan-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 2.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 16px;
}

.plan-pick-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Белая, как кнопки брони и «Купить билет» на сайте, а не золотая .info-page-btn */
.plan-pick-btn {
    flex-shrink: 0;
    justify-content: center;
    min-height: 48px;
    background: #fff;
    color: #000;
    border-radius: 999px;
}

.plan-pick-btn:hover {
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

@media (max-width: 480px) {
    .plan-pick {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

/* ---- Стол в брони (/booking/, шаг «Проверьте заявку») ---- */
.booking-table {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-align: left;
}

.booking-table[hidden],
.booking-table-plan[hidden],
.booking-table-note[hidden],
.booking-table-btn[hidden] {
    display: none;
}

.booking-table-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.booking-table-title {
    font-weight: 600;
    color: var(--color-text-primary);
}

.booking-table-opt {
    margin-left: 0.35rem;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.booking-table-value {
    font-weight: 600;
    color: var(--color-text-primary);
}

.booking-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.booking-table-btn {
    min-height: 44px;
    padding: 0.6rem 1.1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.booking-table-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.booking-table-btn:focus-visible {
    outline: 2px solid var(--color-text-primary);
    outline-offset: 2px;
}

.booking-table-clear {
    border-color: transparent;
    color: var(--color-text-secondary);
}

.booking-table-plan {
    margin-top: 0.75rem;
}

.booking-table-hint {
    margin: -0.5rem 0 1rem;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.booking-table-note {
    margin: 0 auto 1rem;
    max-width: 520px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

/* ---- Поп-ап брони на /plan/ (GLA-343): стол выбран на схеме, день и телефон здесь ---- */
.plan-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.plan-modal.active {
    display: block;
}

.plan-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.plan-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 440px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 40px 28px 28px;
    background: #1a1a1a;
    border-radius: 16px;
    text-align: left;
}

.plan-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: #999;
    cursor: pointer;
}

.plan-modal-close:hover {
    color: #fff;
}

.plan-modal-title {
    margin: 0 0 1.25rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.plan-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-form.is-gone,
.plan-modal-title.is-gone,
.plan-success.is-gone,
.plan-form-error.is-gone {
    display: none;
}

.plan-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.plan-input {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    background: #111;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
}

/* Свой вид списка: Safari рисует <select> системным узким полем и не слушает
   min-height, пока у него свой appearance */
.plan-select {
    position: relative;
}

.plan-select select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.75rem;
    cursor: pointer;
}

.plan-select::after {
    content: '';
    position: absolute;
    right: 1.1rem;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid #aaa;
    border-bottom: 2px solid #aaa;
    transform: rotate(45deg);
    pointer-events: none;
}

.plan-input:focus {
    outline: none;
    border-color: #fff;
}

.plan-input[readonly] {
    color: var(--color-text-secondary);
}

.plan-check {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--color-text-secondary);
}

.plan-check input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.plan-check a {
    color: var(--color-text-primary);
}

.plan-submit {
    min-height: 52px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.plan-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.plan-form-error {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ff8a8a;
}

.plan-form-error a {
    color: inherit;
}

.plan-success h3 {
    margin: 0.5rem 0 0.75rem;
    font-size: 1.3rem;
    color: #fff;
}

.plan-success p {
    margin: 0 0 0.9rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--color-text-secondary);
}

.plan-success .plan-submit {
    width: 100%;
    margin-top: 0.5rem;
}
