/* BTQM popup đặt bàn — đồng bộ BTQM_PopupDatBan_CRM_v1.0 / tokens.css */
@font-face {
    font-family: "BTQM Display";
    src: url("/booking/btqm/fonts/DFVN-Stampa-V2.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Be Vietnam";
    src: url("/booking/btqm/fonts/BeVietnam-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Be Vietnam";
    src: url("/booking/btqm/fonts/BeVietnam-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Be Vietnam";
    src: url("/booking/btqm/fonts/BeVietnam-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --red: #A53B32;
    --red-dark: #8C3029;
    --kem: #F3E1C4;
    --paper: #FAF5EA;
    --paper-2: #F4EADA;
    --white: #FFFDF8;
    --go: #3A2418;
    --ink: #2C1B12;
    --ink-2: #5C4636;
    --mute: #8A725E;
    --line: #E2D2B8;
    --dat: #A9663E;
    --err-bg: #FBEDEA;
    --f-display: "BTQM Display", "Lora", Georgia, serif;
    --f-body: "Be Vietnam", "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --r-sm: 4px;
    --r-md: 10px;
    --r-lg: 18px;
    --r-xl: 26px;
    --shadow: 0 24px 60px -24px rgba(58, 36, 24, .45);
}

:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

html,
body.btqm-booking {
    margin: 0;
    min-height: 100%;
}

body.btqm-booking {
    font-family: var(--f-body);
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--kem);
    background-image: url("/booking/btqm/giay-kem.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

@keyframes bk-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bk {
        animation: none;
    }
}

/* Trang đặt bàn full (như mẫu ?full=1) — không lớp phủ tối */
.bk-overlay {
    position: static;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 16px;
    box-sizing: border-box;
    background: transparent;
}

.bk {
    width: min(640px, 100%);
    max-height: none;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: bk-in .28s ease;
}

.bk__head {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72px;
    padding: 14px 64px;
    background-color: var(--kem);
    background-image: url("/booking/btqm/giay-kem.jpg");
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.bk__logo {
    height: 44px;
    width: auto;
    display: block;
}

.bk__close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s, color .2s;
    text-decoration: none;
}

.bk__close:hover {
    background: var(--go);
    color: var(--kem);
    border-color: var(--go);
}

.bk__close svg {
    width: 18px;
    height: 18px;
}

.bk__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px 32px 28px;
}

.bk__intro {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
    margin-bottom: 20px;
}

.bk__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--dat);
}

.bk__eyebrow::before,
.bk__eyebrow::after {
    content: "";
    width: 18px;
    height: 1.5px;
    background: currentColor;
}

.bk__title {
    margin: 0;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(26px, 5vw, 32px);
    line-height: 1.12;
    letter-spacing: -.006em;
    text-wrap: balance;
    text-transform: uppercase;
}

.bk__note {
    margin: 0;
    font-size: 13px;
    color: var(--mute);
}

.bk__form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.bk__field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.bk__field--full {
    grid-column: 1 / -1;
}

.bk__label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
}

.bk__label em {
    font-style: normal;
    color: var(--red);
}

.bk__input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--white);
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    transition: border-color .2s, background .2s;
    box-sizing: border-box;
}

.bk__input::placeholder {
    color: #B09A83;
}

textarea.bk__input {
    height: auto;
    min-height: 88px;
    padding: 12px 14px;
    resize: vertical;
}

.bk__input:hover {
    border-color: #D2BD9E;
}

select.bk__input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
        linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
    background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

.bk__input:focus {
    outline: none;
    border-color: var(--dat);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(169, 102, 62, .15);
}

select.bk__input:focus {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
        linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
    background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

.bk__input:disabled {
    background: var(--paper-2);
    color: var(--mute);
    cursor: not-allowed;
}

.bk__input[aria-invalid="true"] {
    border-color: var(--red);
    background: var(--err-bg);
}

.bk__hint {
    font-size: 12.5px;
    color: var(--mute);
}

.bk__err {
    font-size: 12.5px;
    color: var(--red);
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.bk__err:empty {
    display: none;
}

.bk__err::before {
    content: "!";
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
    margin-top: 1px;
}

.bk__time {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.bk__check {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--ink-2);
    cursor: pointer;
}

.bk__check input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--red);
}

.bk__check a {
    color: var(--red);
}

.bk__check .bk__err {
    grid-column: 1 / -1;
}

.bk__summary {
    grid-column: 1 / -1;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--err-bg);
    color: var(--red-dark);
    font-size: 14px;
    margin: 0;
}

.bk__summary[hidden] {
    display: none !important;
}

.bk__btn {
    grid-column: 1 / -1;
    height: 52px;
    border: 0;
    border-radius: var(--r-md);
    background: var(--red);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background .2s, transform .1s;
}

.bk__btn:hover {
    background: var(--red-dark);
}

.bk__btn:active {
    transform: translateY(1px);
}

.bk__btn[disabled] {
    background: #C98F88;
    cursor: progress;
}

.bk__spin {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bk-spin .8s linear infinite;
}

.bk__spin[hidden] {
    display: none;
}

@keyframes bk-spin {
    to {
        transform: rotate(360deg);
    }
}

.bk__done {
    display: grid;
    gap: 14px;
    justify-items: center;
    text-align: center;
    padding: 8px 0 4px;
}

.bk__done[hidden] {
    display: none !important;
}

.bk__seal {
    width: 84px;
    height: 84px;
}

.bk__done h2 {
    margin: 0;
    font-family: var(--f-display);
    font-size: 30px;
    line-height: 1.12;
    text-transform: uppercase;
}

.bk__done p {
    margin: 0;
    max-width: 44ch;
    color: var(--ink-2);
    font-size: 14px;
}

.bk__recap {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 18px;
    padding: 16px 18px;
    border-radius: var(--r-md);
    background: var(--white);
    box-shadow: 0 0 0 1px var(--line);
    text-align: left;
    font-size: 14.5px;
    margin: 6px 0 4px;
}

.bk__recap dt {
    color: var(--mute);
}

.bk__recap dd {
    margin: 0;
    font-weight: 600;
}

.bk__btn--ghost {
    background: transparent;
    color: var(--red);
    border: 1.5px solid var(--red);
    width: 100%;
}

.bk__btn--ghost:hover {
    background: var(--red);
    color: #fff;
}

.bk__foot {
    flex-shrink: 0;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--go);
    color: rgba(243, 225, 196, .85);
    font-size: 13.5px;
    text-align: center;
}

.bk__foot a {
    color: var(--kem);
    font-weight: 700;
    text-underline-offset: 3px;
}

.bk-form-view[hidden] {
    display: none !important;
}

@media (max-width: 560px) {
    .bk-overlay {
        padding: 0;
    }

    .bk {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none;
        border-radius: 0;
    }

    .bk__head {
        min-height: 64px;
    }

    .bk__logo {
        height: 38px;
    }

    .bk__body {
        padding: 20px 16px 24px;
    }

    .bk__form {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bk__spin {
        animation: none;
    }
}
