/* ============================================================
   Booking page styles
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.booking-body {
    background: #0F0F0F;
    color: #F5F3EE;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
}

.booking-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px 64px;
    gap: 40px;
    min-height: 100vh;
}


/* ── Close button ───────────────────────────────────────── */

.booking-close-row {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.booking-section-label {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.04em;
    color: #F5F3EE;
}

.booking-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 22px;
    line-height: 1;
    font-weight:900;
    font-family: 'Inter', sans-serif;
    color: rgba(245, 243, 238, 0.3);;
    text-decoration: none;
    border: 1px solid rgba(245, 243, 238, 0.3);
    border-radius: 10px;
    background: transparent;
    transition: background 0.2s;
    flex-shrink: 0;
}

.booking-close-btn:hover {
    background: rgba(245, 243, 238, 0.08);
}


/* ── Table map ──────────────────────────────────────────── */

.table-map-section {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.sold-out-overlay {
    position: absolute;
    inset: -12px;
    background: rgba(15, 15, 15, 0.55);
    border-radius: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(1px);
}

.sold-out-overlay.active {
    display: flex;
}

.sold-out-label {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: #F5F3EE;
}


/* Tables grid */

.tables-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 16px 12px;
    justify-items: center;
}

.table-item-5 {
    grid-column: 4;
    grid-row: 2;
    margin-top: 24px;
}


/* ── Table item ─────────────────────────────────────────── */

.table-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
    outline: none;
}

.table-item.busy {
    opacity: 0.45;
    pointer-events: none;
}

.table-item.selected .table-surface,
.table-item.selected .table-surface-round {
    border-color: #00FF66 !important;
    box-shadow: 0 0 0 1px #00FF66;
}


/* Rectangular table icon */

.table-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.chairs-h {
    display: flex;
    gap: 8px;
}

.chair {
    background: #252525;
    border: 1px solid #333;
    border-radius: 3px;
    width: 20px;
    height: 11px;
}

.table-mid-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chairs-v-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chair-v {
    width: 11px;
    height: 32px;
}

.table-surface {
    background: #1C1C1C;
    border: 1px solid #2C2C2C;
    border-radius: 10px;
    width: 70px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.table-num {
    font-size: 36px;
    font-weight: 800;
    color: #444;
    line-height: 1;
    letter-spacing: -0.04em;
}


/* Round table (T4) */

.table-icon-round .round-wrap {
    position: relative;
    width: 120px;
    height: 120px;
}

.table-surface-round {
    position: absolute;
    inset: 50%;
    transform: translate(-50%, -50%);
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: #1C1C1C;
    border: 1px solid #2C2C2C;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.round-chair {
    position: absolute;
    width: 18px;
    height: 10px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 3px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(calc(var(--deg) * 1deg)) translateY(-48px);
}


/* Status badge */

.status-badge {
    font-family: 'Inter', sans-serif;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    min-width: 72px;
    text-align: center;
}

.table-item[data-status="free"] .status-badge {
    background: #00FF66;
    color: #000;
}

.table-item[data-status="busy"] .status-badge {
    background: #FF3333;
    color: #fff;
}

.table-item[data-status="free"] .status-badge::after {
    content: 'Свободно';
}

.table-item[data-status="busy"] .status-badge::after {
    content: 'Занят';
}

/* Sold-out: все свободные столы визуально показываются как занятые */
.tables-grid.sold-out .table-item[data-status="free"] .status-badge {
    background: #FF3333;
    color: #fff;
}

.tables-grid.sold-out .table-item[data-status="free"] .status-badge::after {
    content: 'Занят';
}


/* ── Booking form ───────────────────────────────────────── */

.booking-form-section {
    width: 100%;
    max-width: 560px;
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: fadeUp 0.3s ease both;
}

.booking-form-section.visible {
    display: flex;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-title {
    margin-bottom:10px;
    font-size: clamp(22px, 5vw, 28px);
    font-weight: 800;
    letter-spacing: -0.04em;
    text-align: center;
}

#booking-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

input[type="text"],
input[type="tel"],
select,
textarea {
    width: 100%;
    background: #1C1C1C;
    border: 1px solid #2C2C2C;
    border-radius: 12px;
    color: #F5F3EE;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    padding: 14px 16px;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: #555;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #444;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

select:disabled {
    opacity: 0.45;
    cursor: default;
}

select option {
    background: #1C1C1C;
}

textarea {
    resize: none;
}

.consent-label {
    margin-bottom:18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

.consent-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: #1C1C1C;
    border: 1px solid #333;
    border-radius: 5px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    margin-top: 1px;
    transition: background 0.2s, border-color 0.2s;
}

.consent-label input:checked {
    background: #00FF66;
    border-color: #00FF66;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l4 4L11 1' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.btn-submit {
    width: 100%;
    background: #F5F3EE;
    color: #0F0F0F;
    border: none;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    padding: 17px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-submit:hover {
    opacity: 0.9;
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.form-error {
    color: #FF4444;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}


/* ── Success screen ─────────────────────────────────────── */

.booking-success-section {
    display: none;
    width: 100%;
    max-width: 480px;
    animation: fadeUp 0.35s ease both;
}

.booking-success-section.visible {
    display: flex;
}

.success-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 0 8px;
}

.success-title {
    font-size: clamp(22px, 5vw, 26px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.2;
}

.success-text {
    font-size: 15px;
    color: #888;
    line-height: 1.5;
}

.success-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-home,
.btn-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    padding: 14px 28px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-home {
    background: transparent;
    border: 1px solid rgba(245, 243, 238, 0.3);
    color: #F5F3EE;
}

.btn-call {
    background: #00FF66;
    border: none;
    color: #000;
}

.btn-home:hover,
.btn-call:hover {
    opacity: 0.85;
}


/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 520px) {
    .status-badge {
        font-size: 5px;
        min-width: 5px;
    }
    .booking-page {
        padding: 16px 16px 48px;
        gap: 28px;
    }
    .tables-grid {
        gap: 6px 3px;
    }
    .table-surface {
        width: 40px;
        height: 56px;
    }
    .table-num {
        font-size: 20px;
    }
    .chairs-h .chair {
        width: 12px;
        height: 7px;
    }
    .chair-v {
        width: 7px;
        height: 18px;
    }
    .chairs-v-col {
        gap: 4px;
    }
    .table-mid-row {
        gap: 3px;
    }
    .table-icon-round .round-wrap {
        width: 70px;
        height: 70px;
    }
    .table-surface-round {
        width: 44px;
        height: 44px;
    }
    .round-chair {
        width: 12px;
        height: 7px;
        transform: translate(-50%, -50%) rotate(calc(var(--deg)*1deg)) translateY(-28px);
    }
    .form-row-2 {
        grid-template-columns: 1fr;
    }
    .booking-close-btn {
        font-size: 15px;
        padding: 8px 20px;
    }
    .success-buttons {
        flex-direction: column;
    }
    .btn-home,
    .btn-call {
        width: 100%;
    }
}