:root {
    --portal-ui-font: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
    --bs-font-sans-serif: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
    --bs-body-font-family: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
}

.kiosk-sales-body {
    min-height: 100vh;
    font-family: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
    /* Đồng bộ nền Portal (portal-app.css + --portal-tint-rgb) */
    background: linear-gradient(
        180deg,
        rgba(var(--portal-tint-rgb, 26, 97, 184), 0.12) 0%,
        #fff 32%,
        #fff 100%
    );
    margin-bottom: 0;
}

[data-bs-theme="dark"] .kiosk-sales-body {
    background: linear-gradient(
        180deg,
        rgba(var(--portal-tint-rgb, 26, 97, 184), 0.22) 0%,
        #0f172a 40%,
        #0f172a 100%
    );
}

.kiosk-sales-body:has(.kiosk-splash-page) {
    overflow-x: hidden;
}

/* Splash: bỏ max-width/padding của .container để ảnh/video không bị “bóp” trong khung giữa */
.kiosk-sales-body:has(.kiosk-splash-page) > main.container {
    max-width: none;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

/* Cao hơn nội dung main (splash, split) để thanh bar + dropdown ngôn ngữ không bị nền ảnh/video đè */
.kiosk-sales-header {
    position: relative;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom-color: rgba(var(--portal-primary-rgb, 26, 97, 184), 0.14) !important;
}

[data-bs-theme="dark"] .kiosk-sales-header {
    background: rgba(15, 23, 42, 0.92);
    border-bottom-color: rgba(var(--portal-primary-rgb, 26, 97, 184), 0.28) !important;
}

.kiosk-sales-card {
    max-width: 28rem;
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgba(var(--portal-primary-rgb, 26, 97, 184), 0.1);
    border: 1px solid rgba(var(--portal-primary-rgb, 26, 97, 184), 0.16);
}

.kiosk-sales-table-wrap {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(var(--portal-primary-rgb, 26, 97, 184), 0.08);
    border: 1px solid rgba(var(--portal-primary-rgb, 26, 97, 184), 0.14);
    font-family: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
}

.kiosk-sales-table-wrap .table,
.kiosk-sales-table-wrap .table thead th,
.kiosk-sales-table-wrap .table tbody td {
    font-family: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
}

.kiosk-sales-empty-rules {
    border-radius: 0.75rem;
}

.kiosk-rule-card {
    cursor: pointer;
    overflow: visible;
    --kiosk-rule-border: rgba(71, 85, 105, 0.22);
    --kiosk-rule-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
}

/* Vé: nền giấy, viền tinh, đường đứt + lỗ xén */
.kiosk-rule-card__ticket {
    position: relative;
    border-radius: 0.65rem;
    overflow: visible;
    border: 1px solid var(--kiosk-rule-border);
    background: linear-gradient(165deg, #fffef9 0%, #f5f2ea 48%, #ebe6dc 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 4px 14px rgba(15, 23, 42, 0.07),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.kiosk-rule-card__inner.kiosk-rule-card__ticket {
    display: flex;
    flex-direction: column;
}

.kiosk-rule-card__ticket-main {
    padding: 0.85rem 1rem 0.35rem;
}

.kiosk-rule-card__perforation {
    display: block;
    position: relative;
    height: 0;
    margin: 0.55rem 0.75rem;
    border-top: 2px dashed rgba(100, 116, 139, 0.42);
}

.kiosk-rule-card__hole {
    position: absolute;
    top: 50%;
    width: 0.7rem;
    height: 0.7rem;
    margin-top: -0.35rem;
    border-radius: 50%;
    background: var(--kiosk-ticket-punch, #e2ebfa);
    box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.2);
    pointer-events: none;
}

.kiosk-rule-card__hole--left {
    left: -0.55rem;
}

.kiosk-rule-card__hole--right {
    right: -0.55rem;
}

.kiosk-rule-card__stub {
    padding: 0.35rem 1rem 0.85rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(245, 242, 234, 0.9) 100%);
    border-radius: 0 0 0.55rem 0.55rem;
}

.kiosk-rule-card:hover .kiosk-rule-card__ticket {
    border-color: rgba(var(--portal-primary-rgb, 37, 99, 235), 0.42);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 8px 22px rgba(var(--portal-primary-rgb, 37, 99, 235), 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.kiosk-rule-card:focus-visible .kiosk-rule-card__ticket {
    outline: 2px solid rgba(var(--portal-primary-rgb, 37, 99, 235), 0.55);
    outline-offset: 3px;
}

.kiosk-rule-card--in-cart .kiosk-rule-card__ticket {
    border-color: rgba(22, 163, 74, 0.45);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 6px 20px rgba(22, 163, 74, 0.16),
        0 0 0 1px rgba(22, 163, 74, 0.12) inset;
}

.kiosk-rule-card--pulse .kiosk-rule-card__ticket {
    animation: kiosk-rule-pulse 0.28s ease-out;
}

@keyframes kiosk-rule-pulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Màn dọc: khung vé (trên) + khung giỏ (dưới), full width */
.kiosk-sales-split {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.75rem;
}

/* Màn ngang: hai cột đều col-6 (50% / 50%) */
@media (orientation: landscape) {
    .kiosk-sales-split {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Hai vùng màu: catalog (xanh nhạt); giỏ (vàng kem) */
.kiosk-sales-split__catalog {
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.5rem 0.625rem;
    border-radius: 0.75rem;
    background: linear-gradient(165deg, #eef4ff 0%, #e2ebfa 45%, #d8e4f8 100%);
    border: 1px solid rgba(var(--portal-primary-rgb, 59, 130, 246), 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    /* Màu “lỗ xén” vé khớp nền khu vé (gradient giữa chừng) */
    --kiosk-ticket-punch: #e2ebfa;
}

@media (orientation: landscape) {
    .kiosk-sales-split__catalog {
        flex: 1 1 0;
        min-width: 0;
        max-width: 50%;
    }
}

.kiosk-sales-split__cart.kiosk-cart-panel {
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    align-self: stretch;
    position: static;
    max-height: none;
    background: linear-gradient(165deg, #fffbeb 0%, #fef3c7 42%, #fde68a 100%);
    border-color: rgba(217, 119, 6, 0.3) !important;
}

@media (orientation: landscape) {
    .kiosk-sales-split__cart.kiosk-cart-panel {
        flex: 1 1 0;
        min-width: 0;
        max-width: 50%;
        align-self: flex-start;
        position: sticky;
        top: 0.5rem;
        max-height: calc(100vh - 4.25rem);
    }
}

/* Màn đứng: thu nhỏ chữ vé một chút; lưới vé có thể 2 cột (full width) */
@media (orientation: portrait) {
    .kiosk-sales-split__catalog .kiosk-rule-card__ticket-main {
        padding: 0.55rem 0.65rem 0.25rem !important;
    }

    .kiosk-sales-split__catalog .kiosk-rule-card__stub {
        padding: 0.25rem 0.65rem 0.65rem !important;
    }

    .kiosk-sales-split__catalog .kiosk-rule-card__price {
        font-size: 1.05rem !important;
    }

    .kiosk-sales-split__catalog .kiosk-rule-card__title {
        font-size: 0.95rem;
        line-height: 1.25;
    }

    .kiosk-sales-split__catalog .kiosk-rule-card__customer {
        font-size: 0.75rem;
    }

    .kiosk-sales-split__catalog .kiosk-rule-card__perforation {
        margin: 0.4rem 0.55rem !important;
    }

    .kiosk-sales-split .kiosk-cart-panel__body {
        max-height: min(48vh, calc(100vh - 13rem));
    }
}

.kiosk-sales-split__cart .kiosk-cart-panel__head {
    background: rgba(255, 255, 255, 0.42);
}

.kiosk-sales-split__cart .kiosk-cart-panel__foot {
    background: rgba(255, 255, 255, 0.35);
}

.kiosk-sales-split__cart .kiosk-cart-qty-value {
    background: rgba(255, 255, 255, 0.75);
}

.kiosk-sales-split__cart .kiosk-cart-qty-value--tap:hover,
.kiosk-sales-split__cart .kiosk-cart-qty-value--tap:focus {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

.kiosk-sales-split .kiosk-cart-panel__body {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (orientation: landscape) {
    .kiosk-sales-split .kiosk-cart-panel__body {
        max-height: calc(100vh - 11rem);
    }
}

/* Mọi loại màn (html[data-kiosk-screen="square|portrait|landscape"] do _LayoutKiosk gán):
   cả trang tối đa đúng 1 màn hình (body không cuộn): header + main lấp phần còn lại (= 100dvh);
   nội dung dài chỉ cuộn bên trong (danh sách vé, giỏ, hoặc main làm dự phòng).
   Nội dung giữ kích thước gốc khi đủ chỗ; màn vuông thêm bản gọn (padding/chữ nhỏ hơn).
   Selector có html[...] nên thắng các rule (orientation: portrait|landscape) ở trên. */
html[data-kiosk-screen] {
    height: 100%;
    overflow: hidden;
}

html[data-kiosk-screen] body.kiosk-sales-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden;
}

html[data-kiosk-screen] .kiosk-sales-header {
    flex: 0 0 auto;
}

html[data-kiosk-screen="square"] .kiosk-sales-header {
    margin-bottom: 0.5rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-header > .container {
    max-width: none;
    padding: 0.3rem 0.75rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-header .kiosk-touch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

html[data-kiosk-screen] .kiosk-sales-body > main.container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 0.75rem !important;
    overflow-x: hidden;
    overflow-y: auto;
}

html[data-kiosk-screen="square"] .kiosk-sales-body > main.container {
    max-width: none;
    padding: 0 0.75rem 0.5rem !important;
}

html[data-kiosk-screen] .kiosk-sales-body > main.container,
html[data-kiosk-screen] .kiosk-sales-split__catalog,
html[data-kiosk-screen] .kiosk-sales-split .kiosk-cart-panel__body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

html[data-kiosk-screen] .kiosk-sales-body > main.container::-webkit-scrollbar,
html[data-kiosk-screen] .kiosk-sales-split__catalog::-webkit-scrollbar,
html[data-kiosk-screen] .kiosk-sales-split .kiosk-cart-panel__body::-webkit-scrollbar {
    width: 6px;
}

html[data-kiosk-screen] .kiosk-sales-body > main.container::-webkit-scrollbar-thumb,
html[data-kiosk-screen] .kiosk-sales-split__catalog::-webkit-scrollbar-thumb,
html[data-kiosk-screen] .kiosk-sales-split .kiosk-cart-panel__body::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: rgba(100, 116, 139, 0.45);
}

html[data-kiosk-screen] .kiosk-sales-body > main.container::-webkit-scrollbar-track,
html[data-kiosk-screen] .kiosk-sales-split__catalog::-webkit-scrollbar-track,
html[data-kiosk-screen] .kiosk-sales-split .kiosk-cart-panel__body::-webkit-scrollbar-track {
    background: transparent;
}

html[data-kiosk-screen] main.container > .alert,
html[data-kiosk-screen] .kiosk-sales-dayline {
    flex: 0 0 auto;
}

html[data-kiosk-screen="square"] main.container > .alert {
    margin-bottom: 0.5rem;
    padding: 0.45rem 0.75rem;
}

html[data-kiosk-screen="square"] .kiosk-sales-dayline {
    margin-bottom: 0.35rem !important;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Trang bán vé: split lấp phần main còn lại; vé cuộn nội bộ, giỏ cuộn thân giỏ, tổng + nút luôn hiện.
   Vuông/ngang: vé trái + giỏ phải full chiều cao. Dọc: vé trên + giỏ dưới (giỏ tối đa ~1/2). */
html[data-kiosk-screen] .kiosk-sales-split {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}

html[data-kiosk-screen="square"] .kiosk-sales-split,
html[data-kiosk-screen="landscape"] .kiosk-sales-split {
    flex-direction: row;
}

html[data-kiosk-screen="square"] .kiosk-sales-split {
    gap: 0.6rem;
}

html[data-kiosk-screen="portrait"] .kiosk-sales-split {
    flex-direction: column;
}

html[data-kiosk-screen] .kiosk-sales-split__catalog {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__catalog {
    max-width: 60%;
    padding: 0.6rem 0.7rem;
}

html[data-kiosk-screen="landscape"] .kiosk-sales-split__catalog {
    max-width: 50%;
}

html[data-kiosk-screen="portrait"] .kiosk-sales-split__catalog {
    max-width: 100%;
}

html[data-kiosk-screen="square"] .kiosk-catalog-row {
    --bs-gutter-x: 0.6rem;
    --bs-gutter-y: 0.6rem;
}

@media (min-width: 992px) {
    html[data-kiosk-screen="square"] .kiosk-catalog-row > * {
        flex: 0 0 auto;
        width: 33.33333333%;
    }
}

html[data-kiosk-screen] .kiosk-sales-split__cart.kiosk-cart-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    position: static;
    max-height: none;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__cart.kiosk-cart-panel {
    flex: 0 0 40%;
    max-width: 40%;
}

html[data-kiosk-screen="landscape"] .kiosk-sales-split__cart.kiosk-cart-panel {
    flex: 1 1 0;
    max-width: 50%;
}

html[data-kiosk-screen="portrait"] .kiosk-sales-split__cart.kiosk-cart-panel {
    flex: 0 1 auto;
    max-width: 100%;
    max-height: 50%;
}

html[data-kiosk-screen] .kiosk-sales-split .kiosk-cart-panel__head,
html[data-kiosk-screen] .kiosk-sales-split .kiosk-cart-panel__foot,
html[data-kiosk-screen] .kiosk-sales-split .kiosk-cart-panel__checkout {
    flex: 0 0 auto;
}

html[data-kiosk-screen="square"] .kiosk-sales-split .kiosk-cart-panel__head {
    padding: 0.4rem 0.75rem !important;
}

html[data-kiosk-screen] .kiosk-sales-split .kiosk-cart-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

html[data-kiosk-screen="square"] .kiosk-sales-split .kiosk-cart-panel__body {
    padding: 0.5rem 0.6rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split .kiosk-cart-panel__foot {
    padding: 0.45rem 0.75rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split .kiosk-cart-panel__checkout {
    padding: 0.5rem 0.6rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split .kiosk-cart-panel__checkout .d-grid {
    gap: 0.4rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split .kiosk-cart-panel__checkout .kiosk-touch-btn {
    min-height: 2.9rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    font-size: 1.1rem;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__cart .kiosk-cart-line {
    padding: 0.45rem 0.55rem !important;
    margin-bottom: 0.45rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__cart .kiosk-cart-line:last-child {
    margin-bottom: 0 !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__cart .kiosk-cart-line > .fw-semibold {
    font-size: 0.9rem;
    line-height: 1.25;
    margin-bottom: 0.1rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__cart .kiosk-cart-line > .small {
    font-size: 0.75rem;
    margin-bottom: 0.25rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__cart .kiosk-cart-qty .btn-lg {
    min-width: 2.5rem;
    min-height: 2.4rem;
    padding: 0.15rem 0.6rem;
    font-size: 1.1rem;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__cart .kiosk-cart-qty-value {
    min-width: 2.75rem;
    line-height: 2.4rem;
    font-size: 1rem;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__catalog .kiosk-rule-card__ticket-main {
    padding: 0.5rem 0.6rem 0.2rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__catalog .kiosk-rule-card__stub {
    padding: 0.2rem 0.6rem 0.5rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__catalog .kiosk-rule-card__price {
    font-size: 1rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__catalog .kiosk-rule-card__title {
    font-size: 0.9rem;
    line-height: 1.2;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__catalog .kiosk-rule-card__customer {
    font-size: 0.72rem;
    margin-top: 0.15rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-split__catalog .kiosk-rule-card__perforation {
    margin: 0.3rem 0.5rem !important;
}

/* Splash: lấp đúng phần main còn lại, không cuộn */
html[data-kiosk-screen] .kiosk-sales-body:has(.kiosk-splash-page) > main.container {
    padding: 0 !important;
    overflow: hidden;
}

html[data-kiosk-screen] .kiosk-splash-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

html[data-kiosk-screen] .kiosk-splash {
    flex: 1 1 auto;
    min-height: 0;
}

/* Thanh toán / lỗi / nhập mã / đăng nhập: căn giữa theo chiều dọc */
html[data-kiosk-screen] main.container > .kiosk-payment,
html[data-kiosk-screen] main.container > .kiosk-square-center,
html[data-kiosk-screen] main.container > .row:only-child {
    margin-top: auto !important;
    margin-bottom: auto !important;
}

html[data-kiosk-screen] main.container > .row:only-child {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* QR: giữ kích thước gốc khi đủ chỗ, chỉ thu khi màn thấp (vuông có rule riêng bên dưới) */
html[data-kiosk-screen] #kioskPayQrHost img,
html[data-kiosk-screen] #kioskPayQrHost canvas {
    max-width: max(8.5rem, 30vh);
    max-width: max(8.5rem, 30dvh);
    height: auto !important;
}

html[data-kiosk-screen="square"] .kiosk-payment > .card-body {
    padding: 1rem 1.25rem !important;
}

html[data-kiosk-screen="square"] .kiosk-payment h1 {
    margin-bottom: 0.4rem !important;
}

html[data-kiosk-screen="square"] .kiosk-payment > .card-body > h1 + p {
    margin-bottom: 0.75rem !important;
}

html[data-kiosk-screen="square"] .kiosk-payment dl {
    margin-bottom: 0.5rem !important;
}

html[data-kiosk-screen="square"] .kiosk-payment dd.mb-2 {
    margin-bottom: 0.25rem !important;
}

html[data-kiosk-screen="square"] .kiosk-payment .d-grid.mt-3 {
    margin-top: 0.6rem !important;
}

html[data-kiosk-screen="square"] #kioskPayQrHost {
    padding: 0.5rem !important;
}

html[data-kiosk-screen="square"] #kioskPayQrHost img,
html[data-kiosk-screen="square"] #kioskPayQrHost canvas {
    width: clamp(8.5rem, 30vh, 220px) !important;
    width: clamp(8.5rem, 30dvh, 220px) !important;
    height: auto !important;
}

html[data-kiosk-screen="square"] .kiosk-sepay-process__header {
    margin-bottom: 0.9rem;
}

html[data-kiosk-screen="square"] .kiosk-sepay-process__icon {
    margin-bottom: 0.3rem;
}

html[data-kiosk-screen="square"] .kiosk-sepay-process__amount {
    margin-bottom: 0.9rem;
    padding: 0.6rem 0.9rem;
}

html[data-kiosk-screen="square"] .kiosk-sepay-steps {
    margin-bottom: 1rem;
}

html[data-kiosk-screen="square"] .kiosk-sepay-step {
    padding-bottom: 0.8rem;
}

html[data-kiosk-screen="square"] .kiosk-sepay-step:last-child {
    padding-bottom: 0;
}

html[data-kiosk-screen="square"] .kiosk-square-center {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

html[data-kiosk-screen="square"] .kiosk-square-center > h1 + p {
    margin-bottom: 0.75rem !important;
}

html[data-kiosk-screen="square"] .kiosk-square-center > .card {
    padding: 1rem !important;
    margin-bottom: 0.6rem !important;
}

html[data-kiosk-screen="square"] .kiosk-sales-card > .card-body {
    padding: 1.25rem 1.5rem !important;
}

/* In vé: bỏ khoảng trắng thừa để fitPreviewZoom còn nhiều chỗ cho bản xem trước */
html[data-kiosk-screen="square"] .kiosk-print-screen {
    padding-top: 0.25rem !important;
    padding-bottom: 0 !important;
}

html[data-kiosk-screen] main.container > .kiosk-reprint-chrome,
html[data-kiosk-screen] main.container > div.kiosk-print-screen:first-of-type {
    margin-top: auto;
}

html[data-kiosk-screen] main.container > .kiosk-print-screen {
    margin-bottom: auto;
}

html[data-kiosk-screen="square"] .kiosk-print-screen .kiosk-print-area,
html[data-kiosk-screen="square"] .kiosk-print-screen .kiosk-stub-pager {
    margin-bottom: 0.5rem !important;
}

html[data-kiosk-screen="square"] .kiosk-print-photo-tip {
    margin-bottom: 0.5rem !important;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

html[data-kiosk-screen="square"] .kiosk-reprint-chrome {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

html[data-kiosk-screen="square"] .kiosk-reprint-chrome > .card {
    margin-bottom: 0.25rem !important;
}

html[data-kiosk-screen="square"] .kiosk-reprint-chrome .card-body {
    padding: 0.5rem 1rem !important;
}

html[data-kiosk-screen="square"] .kiosk-reprint-chrome .card-body p {
    margin-bottom: 0.15rem !important;
}

/* Màn nhỏ: thu nhỏ card, giỏ, nút, bàn phím */
@media (max-width: 767.98px) {
    .kiosk-sales-split {
        gap: 0.375rem;
    }

    .kiosk-sales-split__catalog {
        padding: 0.375rem 0.45rem;
        border-radius: 0.5rem;
    }

    .kiosk-sales-split__catalog .kiosk-rule-card__ticket-main {
        padding: 0.55rem 0.65rem 0.3rem !important;
    }

    .kiosk-sales-split__catalog .kiosk-rule-card__stub {
        padding: 0.3rem 0.65rem 0.6rem !important;
    }

    .kiosk-sales-split__catalog .kiosk-rule-card__price {
        font-size: 1.1rem !important;
    }

    .kiosk-sales-split__cart .kiosk-cart-panel__head {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }

    .kiosk-sales-split__cart .kiosk-cart-panel__head .h6 {
        font-size: 0.8rem;
    }

    .kiosk-sales-split__cart .kiosk-cart-panel__body {
        padding-left: 0.45rem !important;
        padding-right: 0.45rem !important;
        padding-top: 0.45rem !important;
        padding-bottom: 0.45rem !important;
    }

    @media (orientation: landscape) {
        .kiosk-sales-split__cart .kiosk-cart-panel__body {
            max-height: calc(100vh - 9.5rem);
        }
    }

    .kiosk-sales-split__cart .kiosk-cart-line {
        padding: 0.5rem 0.55rem !important;
        margin-bottom: 0.45rem !important;
    }

    .kiosk-sales-split__cart .kiosk-cart-line .fw-semibold {
        font-size: 0.85rem;
    }

    .kiosk-sales-split__cart .kiosk-cart-qty .btn-lg {
        min-width: 2.25rem;
        min-height: 2.25rem;
        padding: 0.2rem 0.45rem;
        font-size: 1rem;
    }

    .kiosk-sales-split__cart .kiosk-cart-qty-value {
        min-width: 2.25rem;
        line-height: 2.25rem;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
        font-size: 0.95rem;
    }

    .kiosk-qty-keypad-modal .kiosk-qty-keypad__btn {
        min-height: 2.35rem;
        font-size: 1rem;
        padding: 0.25rem;
    }

    .kiosk-qty-keypad-modal .kiosk-qty-keypad__grid {
        gap: 0.35rem;
    }
}

@media (min-width: 768px) {
    .kiosk-sales-split {
        gap: 1.25rem;
    }

    .kiosk-sales-split__catalog {
        padding: 1rem 1.125rem;
    }
}

@media (min-width: 768px) and (orientation: landscape) {
    .kiosk-sales-split .kiosk-cart-panel__body {
        max-height: calc(100vh - 13rem);
    }

    .kiosk-sales-split__cart.kiosk-cart-panel {
        top: 0.75rem;
        max-height: calc(100vh - 5rem);
    }
}

.kiosk-cart-panel {
    overflow: hidden;
}

.kiosk-cart-qty .btn-lg {
    min-width: 3rem;
    min-height: 2.75rem;
}

.kiosk-cart-qty-value {
    min-width: 3.5rem;
    text-align: center;
    line-height: 2.75rem;
    font-weight: 600;
    background: #f8fafc;
    border-left: 0;
    border-right: 0;
}

.kiosk-cart-qty-value--tap {
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.kiosk-cart-qty-value--tap:hover,
.kiosk-cart-qty-value--tap:focus {
    background-color: color-mix(in srgb, rgba(var(--portal-primary-rgb, 37, 99, 235), 0.08) 100%, #eff6ff) !important;
    box-shadow: inset 0 0 0 2px rgba(var(--portal-primary-rgb, 37, 99, 235), 0.35);
    outline: none;
}

.kiosk-cart-line--editing {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.45);
}

/* Bàn phím số lượng (popup modal) */
.kiosk-qty-keypad-modal .modal-dialog {
    max-width: min(22rem, 92vw);
}

.kiosk-qty-keypad-modal .modal-content {
    border-radius: 1rem;
}

.kiosk-qty-keypad-modal .modal-header {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.kiosk-qty-keypad__display {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    min-height: 2.85rem;
}

.kiosk-qty-keypad__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.kiosk-qty-keypad__btn {
    min-height: 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.5rem;
}

.kiosk-qty-keypad__btn--zero {
    grid-column: span 2;
}

/* Màn hình chờ (splash): media phủ kín viewport; ảnh/video = cover (không méo, cắt viền nếu cần) */
.kiosk-splash-page {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    min-height: calc(100vh - 5.5rem);
    min-height: calc(100dvh - 5.5rem);
}

.kiosk-splash {
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    min-height: calc(100vh - 5.5rem);
    min-height: calc(100dvh - 5.5rem);
}

.kiosk-splash__media-shell--fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    width: 100%;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100%;
    max-height: none;
    border-radius: 0;
    overflow: hidden;
    background: #0f172a;
}

.kiosk-splash__bg--gradient {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(165deg, #eef4ff 0%, #e2ebfa 45%, #d8e4f8 100%);
}

/* Cover: lấp đầy khung màn hình, giữ tỉ lệ (cắt phần thừa), không ép méo — override mọi max-width:100% trên img */
.kiosk-splash__bg--video,
.kiosk-splash__bg--image {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

.kiosk-splash__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.35) 0%, rgba(226, 235, 250, 0.2) 100%);
    pointer-events: none;
}

/* Chuyển từ splash → mua vé: overlay fade in rồi mới load trang */
.kiosk-splash-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: linear-gradient(165deg, rgba(248, 250, 252, 0.97) 0%, rgba(238, 242, 247, 0.97) 100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.38s ease, visibility 0.38s ease;
}

.kiosk-splash-nav-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Trang đích: cùng tông overlay, fade out để lộ nội dung */
.kiosk-page-enter-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: linear-gradient(165deg, rgba(248, 250, 252, 0.97) 0%, rgba(238, 242, 247, 0.97) 100%);
    opacity: 1;
    transition: opacity 0.38s ease;
    pointer-events: none;
}

.kiosk-page-enter-overlay.kiosk-page-enter-overlay--out {
    opacity: 0;
}

/* Nút Mua vé giữa màn hình (song ngữ); kích thước theo vmin, chỉnh riêng cho portrait / square */
.kiosk-splash__center {
    --kiosk-buy-size: min(24rem, 36vmin);

    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

html[data-kiosk-screen="portrait"] .kiosk-splash__center {
    --kiosk-buy-size: min(26rem, 44vmin);
}

html[data-kiosk-screen="square"] .kiosk-splash__center {
    --kiosk-buy-size: min(22rem, 34vmin);
}

/* In lại + Kiểm tra vé (song ngữ); cách đáy ~5% viewport */
.kiosk-splash__actions {
    --kiosk-side-w: min(11rem, 22vmin);
    --kiosk-side-h: min(7.5rem, 15vmin);

    position: absolute;
    inset-inline: 0;
    bottom: calc(5% + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(1.25rem, 4vmin, 2.75rem);
    pointer-events: none;
    padding-inline-start: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-inline-end: max(0.5rem, env(safe-area-inset-right, 0px));
}

.kiosk-splash__buy-wrap,
.kiosk-splash__reprint-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.kiosk-splash__buy-wrap > .kiosk-splash__buy,
.kiosk-splash__reprint-wrap > .kiosk-splash__reprint {
    pointer-events: auto;
}

.kiosk-splash__reprint-wrap {
    align-items: stretch;
    gap: clamp(0.75rem, 2.5vmin, 1.5rem);
}

.kiosk-splash__reprint-wrap > .kiosk-splash__check-round {
    pointer-events: auto;
}

/* Nút kiểm tra vé cạnh In lại — cùng kích thước với .kiosk-splash__reprint */
.kiosk-splash__check-round {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(var(--kiosk-side-h) * 0.04);
    box-sizing: border-box;
    width: var(--kiosk-side-w);
    min-height: var(--kiosk-side-h);
    margin: 0;
    padding: calc(var(--kiosk-side-h) * 0.08) calc(var(--kiosk-side-w) * 0.07);
    border: none;
    border-radius: calc(var(--kiosk-side-h) * 0.28);
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.1;
    hyphens: auto;
    letter-spacing: 0.02em;
    color: #0f766e;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
    background:
        radial-gradient(ellipse 60% 45% at 30% 22%, rgba(255, 255, 255, 0.9) 0%, transparent 55%),
        linear-gradient(158deg, #ecfdf5 0%, #ccfbf1 40%, #99f6e4 75%, #5eead4 100%);
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.75) inset,
        0 -2px 5px rgba(15, 118, 110, 0.18) inset,
        0 4px 14px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    position: relative;
    z-index: 1;
}

.kiosk-splash__check-round:hover {
    color: #115e59;
    transform: scale(1.05);
    filter: brightness(1.04);
}

.kiosk-splash__check-round:focus-visible {
    outline: 2px solid rgba(20, 184, 166, 0.6);
    outline-offset: 0.12rem;
}

.kiosk-splash__check-round:active {
    transform: scale(0.97);
}

.kiosk-splash__buy-wrap::before,
.kiosk-splash__buy-wrap::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--kiosk-buy-size, min(5rem, 15vmin));
    height: var(--kiosk-buy-size, min(5rem, 15vmin));
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(240, 249, 255, 0.65) 0%,
        rgba(147, 210, 245, 0.32) 38%,
        rgba(56, 189, 248, 0.1) 58%,
        transparent 72%
    );
    box-shadow:
        0 0 20px rgba(147, 210, 245, 0.4),
        0 0 48px rgba(56, 189, 248, 0.15);
    transform: translate(-50%, -50%) scale(1);
    animation: kiosk-splash-water-ripple 2.8s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
    will-change: transform, opacity;
}

.kiosk-splash__buy-wrap::after {
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(186, 230, 253, 0.28) 42%,
        rgba(14, 165, 233, 0.08) 62%,
        transparent 75%
    );
    box-shadow:
        0 0 28px rgba(186, 230, 253, 0.35),
        0 0 56px rgba(56, 189, 248, 0.12);
    animation-delay: 1.4s;
    animation-duration: 2.8s;
}

@keyframes kiosk-splash-water-ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.85;
    }
    55% {
        opacity: 0.35;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.7);
        opacity: 0;
    }
}

/* Nút Mua vé: gradient trắng–xanh nước biển ngọc trai + highlight mờ */
.kiosk-splash__buy {
    --kiosk-pearl-highlight: rgba(255, 255, 255, 0.92);
    --kiosk-pearl-blush: rgba(56, 189, 248, 0.22);
    --kiosk-pearl-depth: rgba(12, 74, 110, 0.35);

    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(var(--kiosk-buy-size) * 0.03);
    width: var(--kiosk-buy-size);
    height: var(--kiosk-buy-size);
    margin: 0;
    padding: calc(var(--kiosk-buy-size) * 0.12);
    border: none;
    border-radius: 50%;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.1;
    hyphens: auto;
    letter-spacing: 0.02em;
    color: #0c3559;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.75),
        0 0 1px rgba(255, 255, 255, 0.4);

    background:
        radial-gradient(ellipse 68% 48% at 30% 26%, var(--kiosk-pearl-highlight) 0%, transparent 54%),
        radial-gradient(ellipse 58% 44% at 78% 72%, var(--kiosk-pearl-blush) 0%, transparent 52%),
        radial-gradient(ellipse 42% 36% at 52% 16%, rgba(255, 255, 255, 0.72) 0%, transparent 58%),
        radial-gradient(ellipse 50% 50% at 65% 38%, rgba(94, 234, 212, 0.08) 0%, transparent 55%),
        linear-gradient(
            158deg,
            #ffffff 0%,
            #f5fbff 14%,
            #e8f4fd 32%,
            #d6ecfa 52%,
            #b3dcf5 74%,
            #8ec8ee 92%,
            #6fb3e3 100%
        );

    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.75) inset,
        0 -2px 6px var(--kiosk-pearl-depth) inset,
        0 2px 5px rgba(12, 40, 72, 0.1),
        0 6px 16px rgba(2, 132, 199, 0.22),
        0 10px 28px rgba(7, 89, 133, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.45) inset;

    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    position: relative;
    z-index: 1;
    animation: kiosk-splash-buy-glow 2.8s ease-in-out infinite;
}

@keyframes kiosk-splash-buy-glow {
    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 5px rgba(147, 210, 245, 0.55)) drop-shadow(0 0 12px rgba(56, 189, 248, 0.2));
    }
    50% {
        filter: brightness(1.04) drop-shadow(0 0 8px rgba(186, 230, 253, 0.75)) drop-shadow(0 0 16px rgba(14, 165, 233, 0.22));
    }
}

.kiosk-splash__buy:hover {
    color: #082a47;
    transform: scale(1.03);
    filter: brightness(1.05);
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.85) inset,
        0 -2px 7px var(--kiosk-pearl-depth) inset,
        0 4px 8px rgba(12, 40, 72, 0.12),
        0 8px 20px rgba(2, 132, 199, 0.28),
        0 14px 32px rgba(7, 89, 133, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.kiosk-splash__buy:focus-visible {
    outline: 2px solid rgba(2, 132, 199, 0.6);
    outline-offset: 0.12rem;
}

.kiosk-splash__buy:active {
    transform: scale(0.98);
    filter: brightness(0.97);
}

.kiosk-splash__buy-primary {
    display: block;
    max-width: 100%;
    font-size: max(1.25rem, calc(var(--kiosk-buy-size) * 0.14));
    font-weight: 800;
    line-height: 1.05;
    overflow-wrap: break-word;
}

.kiosk-splash__buy-secondary {
    display: block;
    max-width: 100%;
    font-size: max(0.8rem, calc(var(--kiosk-buy-size) * 0.068));
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.03em;
    color: #174a78;
    opacity: 0.9;
    overflow-wrap: break-word;
}

/* Nút In lại (splash): tông xanh xám, cùng khung với nút Kiểm tra vé */
.kiosk-splash__reprint {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(var(--kiosk-side-h) * 0.04);
    box-sizing: border-box;
    width: var(--kiosk-side-w);
    min-height: var(--kiosk-side-h);
    margin: 0;
    padding: calc(var(--kiosk-side-h) * 0.08) calc(var(--kiosk-side-w) * 0.07);
    border: none;
    border-radius: calc(var(--kiosk-side-h) * 0.28);
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.1;
    hyphens: auto;
    letter-spacing: 0.02em;
    color: #1e3a4f;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);

    background:
        radial-gradient(ellipse 60% 45% at 30% 22%, rgba(255, 255, 255, 0.85) 0%, transparent 55%),
        linear-gradient(158deg, #f8fafc 0%, #e2e8f0 38%, #cbd5e1 72%, #94a3b8 100%);

    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.75) inset,
        0 -2px 5px rgba(30, 41, 59, 0.18) inset,
        0 4px 14px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;

    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    position: relative;
    z-index: 1;
}

.kiosk-splash__reprint:hover {
    color: #0f172a;
    transform: scale(1.03);
    filter: brightness(1.04);
}

.kiosk-splash__reprint:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    outline-offset: 0.12rem;
}

.kiosk-splash__reprint:active {
    transform: scale(0.98);
    filter: brightness(0.98);
}

.kiosk-splash__side-icon {
    font-size: max(1.1rem, calc(var(--kiosk-side-h) * 0.22));
    line-height: 1;
}

.kiosk-splash__side-primary {
    display: block;
    max-width: 100%;
    font-size: max(0.85rem, calc(var(--kiosk-side-w) * 0.1));
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: break-word;
}

.kiosk-splash__side-secondary {
    display: block;
    max-width: 100%;
    font-size: max(0.7rem, calc(var(--kiosk-side-w) * 0.058));
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.03em;
    opacity: 0.8;
    overflow-wrap: break-word;
}

/* Nút vùng chạm: màn in / nhập mã */
.kiosk-touch-btn {
    min-height: 3.25rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

@media (prefers-reduced-motion: reduce) {
    .kiosk-splash__buy-wrap::before,
    .kiosk-splash__buy-wrap::after {
        animation: none;
        opacity: 0.35;
        transform: translate(-50%, -50%) scale(1.15);
    }

    .kiosk-splash__buy {
        animation: none;
        filter: drop-shadow(0 0 5px rgba(147, 210, 245, 0.45));
    }
}

@media print {
    /* Bỏ khung vừa-1-màn-hình khi in (không cắt trang, không cuộn nội bộ) */
    html[data-kiosk-screen],
    html[data-kiosk-screen] body.kiosk-sales-body,
    html[data-kiosk-screen] .kiosk-sales-body > main.container {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .kiosk-sales-header,
    .no-print {
        display: none !important;
    }

    .modal {
        display: none !important;
    }

    body.kiosk-sales-body {
        background: #fff !important;
    }

    .kiosk-print-screen .kiosk-print-area {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

