/* ==========================================================================
   BOOKING FORM — единый файл стилей
   Охватывает: секцию бронирования, кастомные селекты, кастомный датапикер,
   модальное окно успеха.
   Переменные подтягиваются из :root проекта (aquamarine, graphite и т.д.),
   но продублированы локально для изоляции.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Локальные переменные (изоляция от остального проекта)
   -------------------------------------------------------------------------- */
.booking-rest,
.booking-form,
.custom-select,
.custom-datepicker,
.korston-success {
    --aquamarine: #81D8D0;
    --aquamarine-light: #C8E9E6;
    --graphite: #2A303E;
    --white: #FFFFFF;
    --grey-neutral: #A0A2AF;
    --grey: #A0A2AF;
    --pastel-blue: #DCF9EF;
    --pastel-peach: #F4E0CE;
    --pastel-pink: #FFDEEB;

    --font-main: 'Open Sans', 'Myriad Pro', Arial, sans-serif;
    --font-body: 'Open Sans', 'Myriad Pro', Arial, sans-serif;
    --font-accent: 'Montserrat', 'Gotham Pro', Arial, sans-serif;
    --font-logo: 'Playfair Display', serif;
}

/* ==========================================================================
   1. СЕКЦИЯ БРОНИРОВАНИЯ
   ========================================================================== */

.booking-rest {
    background: #2A303E !important;
    color: var(--white);
    text-align: center;
    padding: 120px 5%;
}

.booking-rest .title {
    color: var(--white);
    font-family: var(--font-accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.2;
    margin-bottom: 20px;
}

.booking-rest p {
    color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   2. ФОРМА — СЕТКА И БАЗОВЫЕ ИНПУТЫ
   ========================================================================== */

.booking-form {
    max-width: 800px;
    margin: 50px auto 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    text-align: left;
}

/* --- Базовые стили для всех инпутов и textarea --- */
.booking-form input[type="text"],
.booking-form input[type="tel"],
.booking-form input[type="email"],
.booking-form textarea {
    width: 100%;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(160, 162, 175, 0.3);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 300;
    border-radius: 0;
    transition: border-color 0.3s, background 0.3s;
    outline: none;
}

.booking-form input:focus,
.booking-form textarea:focus {
    border-color: var(--aquamarine);
    background: rgba(129, 216, 208, 0.05);
}

.booking-form .full {
    grid-column: 1 / -1;
}

.booking-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* --- Кнопка отправки --- */
.booking-form button[type="submit"] {
    grid-column: 1 / -1;
    padding: 20px;
    background: var(--aquamarine);
    color: var(--graphite);
    border: 1px solid var(--aquamarine);
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    border-radius: 0;
}

.booking-form button[type="submit"]:hover {
    background: var(--white);
    border-color: var(--white);
    color: var(--graphite);
}

/* ==========================================================================
   3. ЧЕКБОКСЫ
   ========================================================================== */

.booking-form .checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--grey-neutral);
    line-height: 1.5;
}

.booking-form .checkbox input {
    width: 18px;
    height: 18px;
    padding: 0;
    accent-color: var(--aquamarine);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Возврат нативного вида чекбоксов (перебивает глобальный сброс) */
.checkbox input {
    -webkit-appearance: auto !important;
}

/* ==========================================================================
   4. РАДИОКНОПКИ — ТИП БРОНИ
   ========================================================================== */

.booking-type {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 4px;
}

.booking-type label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(160, 162, 175, 0.3);
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    font-family: var(--font-accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.booking-type label:hover {
    border-color: rgba(129, 216, 208, 0.5);
    background: rgba(129, 216, 208, 0.05);
}

.booking-type label:has(input:checked) {
    border-color: var(--aquamarine);
    background: rgba(129, 216, 208, 0.1);
    color: var(--aquamarine);
}

.booking-type input {
    display: none;
}

.booking-type .radio-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(160, 162, 175, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.3s;
}

.booking-type input:checked + span .radio-dot {
    border-color: var(--aquamarine);
}

.booking-type input:checked + span .radio-dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aquamarine);
}

/* ==========================================================================
   5. CUSTOM SELECT (Зал, Гости, Время)
   ========================================================================== */

.custom-select {
    position: relative;
    width: 100%;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 300;
    user-select: none;
}

.custom-select__header {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border: 1px solid rgba(160, 162, 175, 0.3);
    border-radius: 0;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 300;
    text-align: left;
    outline: none;
}

.custom-select.is-open .custom-select__header,
.custom-select__header:focus {
    border-color: var(--aquamarine);
    background: rgba(129, 216, 208, 0.05);
}

.custom-select__header svg {
    flex-shrink: 0;
    transition: transform 0.3s;
}

.custom-select.is-open .custom-select__header svg {
    transform: rotate(180deg);
}

.custom-select__list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: var(--graphite);
    border: 1px solid rgba(160, 162, 175, 0.3);
    border-radius: 0;
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
}

.custom-select.is-open .custom-select__list {
    display: block;
}

.custom-select__list li {
    padding: 12px 18px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 300;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.custom-select__list li:hover,
.custom-select__list li.is-focused {
    background: var(--aquamarine);
    color: var(--graphite);
}

.custom-select__list li.is-selected {
    color: var(--aquamarine);
    font-weight: 400;
}

.custom-select__value.is-placeholder {
    color: var(--grey);
}

/* ==========================================================================
   6. CUSTOM DATEPICKER (Календарь)
   ========================================================================== */

.custom-datepicker {
    position: relative;
    width: 100%;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 300;
    user-select: none;
}

.custom-datepicker__header {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border: 1px solid rgba(160, 162, 175, 0.3);
    border-radius: 0;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    outline: none;
}

.custom-datepicker.is-open .custom-datepicker__header,
.custom-datepicker__header:focus {
    border-color: var(--aquamarine);
    background: rgba(129, 216, 208, 0.05);
}

.custom-datepicker__header svg {
    flex-shrink: 0;
    color: var(--grey);
    transition: color 0.3s;
}

.custom-datepicker.is-open .custom-datepicker__header svg {
    color: var(--aquamarine);
}

.custom-datepicker__value.is-placeholder {
    color: var(--grey);
}

.custom-datepicker__calendar {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: var(--graphite);
    border: 1px solid rgba(160, 162, 175, 0.3);
    z-index: 1000;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.custom-datepicker.is-open .custom-datepicker__calendar {
    display: block;
}

.custom-datepicker__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.custom-datepicker__nav-btn {
    background: transparent;
    border: none;
    color: var(--grey);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.custom-datepicker__nav-btn:hover {
    color: var(--aquamarine);
}

.custom-datepicker__title {
    font-family: var(--font-accent);
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.custom-datepicker__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    color: var(--grey);
    margin-bottom: 8px;
    font-weight: 400;
}

.custom-datepicker__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.custom-datepicker__day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    font-size: 14px;
    color: var(--white);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-radius: 2px;
}

.custom-datepicker__day:hover {
    background: rgba(129, 216, 208, 0.2);
    color: var(--aquamarine);
}

.custom-datepicker__day.is-today {
    color: var(--aquamarine);
    font-weight: 600;
}

.custom-datepicker__day.is-selected {
    background: rgba(129, 216, 208, 0.5) !important;
    color: #000000 !important;
    border-bottom: 1px solid #81d8d0 !important;
    font-weight: 600;
    border-radius: 0;
}

.custom-datepicker__day.is-selected:hover {
    background: rgba(129, 216, 208, 0.7) !important;
    color: #000000 !important;
}

.custom-datepicker__day.is-disabled {
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    pointer-events: none;
}

.custom-datepicker__day.is-empty {
    pointer-events: none;
}

/* ==========================================================================
   7. МОДАЛЬНОЕ ОКНО УСПЕХА (.korston-success)
   ========================================================================== */

.korston-success {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity .4s ease, visibility .4s ease;
}

.korston-success.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.korston-success__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 15, 16, .78);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.korston-success__modal {
    position: relative;
    width: 100%;
    max-width: 490px;
    min-height: 510px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: #ffffff;
    color: #262b29;
    border: 1px solid rgba(129, 216, 208, .65);
    box-shadow: 0 30px 100px rgba(0, 0, 0, .3);
    transform: translateY(25px) scale(.97);
    transition: transform .55s cubic-bezier(.2, .8, .2, 1);
}

.korston-success.is-active .korston-success__modal {
    transform: translateY(0) scale(1);
}

.korston-success__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.korston-success__content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 65px 45px 45px;
    text-align: center;
}

.korston-success__close {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 5;

    width: 38px;
    height: 38px;

    border: 1px solid rgba(38, 43, 41, .18);
    background: transparent;

    color: #262b29;
    font-size: 27px;
    font-weight: 300;

    cursor: pointer;
    transition: .3s;
}

.korston-success__close:hover {
    background: #262b29;
    color: #f5f2eb;
}

.korston-success__icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 30px;
    color: var(--aquamarine);
    animation: successAppear .8s .2s both;
}

.korston-success__icon svg {
    width: 100%;
    height: 100%;
}

.success-check {
    stroke-dasharray: 45;
    stroke-dashoffset: 45;
    animation: drawCheck .8s .6s ease forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

@keyframes successAppear {
    from { opacity: 0; transform: scale(.65); }
    to   { opacity: 1; transform: scale(1); }
}

.korston-success__eyebrow {
    font-size: 10px;
    letter-spacing: 4px;
    font-weight: 600;
    color: var(--aquamarine);
    margin-bottom: 22px;
}

.korston-success__content h2 {
    margin: 0;
    font-family: inherit;
    font-size: clamp(34px, 6vw, 45px);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -1.5px;
    color: #262b29;
}

.korston-success__divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 27px 0;
}

.korston-success__divider span {
    width: 35px;
    height: 1px;
    background: var(--aquamarine);
}

.korston-success__divider i {
    width: 6px;
    height: 6px;
    background: var(--aquamarine);
    transform: rotate(45deg);
}

.korston-success__description {
    font-size: 16px;
    line-height: 1.7;
    margin: 0 0 12px;
    color: #343a36;
}

.korston-success__note {
    max-width: 340px;
    margin: 0 auto;
    font-size: 13px;
    line-height: 1.8;
    color: #777b75;
}

.korston-success__button {
    width: 100%;
    max-width: 230px;
    height: 52px;
    margin-top: 32px;
    border: 1px solid var(--aquamarine);
    background: #262b29;
    color: #f5f2eb;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: .35s;
}

.korston-success__button:hover {
    background: var(--aquamarine);
    border-color: var(--aquamarine);
    color: #fff;
}

.korston-success__footer {
    margin-top: 35px;
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--aquamarine);
}

/* ==========================================================================
   8. АДАПТИВ
   ========================================================================== */

/* --- 900px: форма в одну колонку, тип брони в одну колонку --- */
@media (max-width: 900px) {
    .booking-rest {
        padding: 80px 5%;
    }

    .booking-form {
        grid-template-columns: 1fr;
    }

    .booking-type {
        grid-template-columns: 1fr;
    }
}

/* --- 480px: модальное окно --- */
@media (max-width: 480px) {
    .korston-success__modal {
        max-width: 390px;
        min-height: 470px;
    }

    .korston-success__content {
        padding: 60px 25px 35px;
    }

    .korston-success__content h2 {
        font-size: 36px;
    }

    .korston-success__note {
        font-size: 12px;
    }
}


/* Списки селектов закрыты */
.custom-select__list {
    display: none;
}

/* Открытие селекта */
.custom-select.is-open .custom-select__list {
    display: block;
}

/* Календарь закрыт */
.custom-datepicker__calendar {
    display: none;
}

/* Открытие календаря */
.custom-datepicker.is-open .custom-datepicker__calendar {
    display: block;
}