/* =========================================================
 * Booking Modal (tv-booking-form) - Premium UI
 * ========================================================= */

.tv-bm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tv-bm-dialog {
    background: #fff;
    width: 100%;
    max-width: 480px; /* Hơi gọn lại một chút */
    border-radius: 12px; /* Bớt bo tròn quá mức */
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    position: relative;
    max-height: calc(100vh - 120px); /* Đảm bảo không vượt quá màn hình sau khi trừ padding-top */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.tv-bm-x-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.tv-bm-x-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.tv-bm-dialog::-webkit-scrollbar {
    width: 6px;
}
.tv-bm-dialog::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.tv-bm-form {
    padding: 30px;
}

@media (max-width: 480px) {
    .tv-bm-overlay {
        padding: 0;
    }
    .tv-bm-dialog {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .tv-bm-form {
        padding: 20px 16px;
        min-height: 100%;
    }
}

.tv-bm-title {
    color: #0b5c37;
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 20px 0;
    padding-right: 44px;
    line-height: 1.2;
    font-family: inherit;
    text-transform: none;
}

.tv-bm-notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.tv-bm-notice--warn {
    background: #fff8ee;
    border: 1px solid #ffe4b5;
    color: #7c4a00;
}

.tv-bm-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.tv-bm-section {
    margin-bottom: 20px;
}

/* ── Thực đơn đã chọn ───────────────────────── */
.tv-bm-menu {
    margin-bottom: 20px;
    padding: 14px;
    background: linear-gradient(145deg, #fffbf5 0%, #fff8ee 100%);
    border: 1px solid #f0dfc4;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tv-bm-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(19, 78, 52, 0.1);
}

.tv-bm-menu__head-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tv-bm-menu__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(19, 78, 52, 0.08);
    color: #134e34;
    flex-shrink: 0;
}

.tv-bm-menu__title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #134e34;
    line-height: 1.2;
}

.tv-bm-menu__badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: #134e34;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.tv-bm-menu__items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.tv-bm-menu__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #f0e8dc;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tv-bm-menu__thumb-wrap {
    flex-shrink: 0;
}

.tv-bm-menu__thumb {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
}

.tv-bm-menu__thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 44px;
    text-align: center;
}

.tv-bm-menu__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tv-bm-menu__name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tv-bm-menu__qty {
    font-size: 12px;
    font-weight: 700;
    color: #888;
}

.tv-bm-menu__price {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 800;
    color: #e69500;
    white-space: nowrap;
    text-align: right;
}

.tv-bm-menu__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e0d5c4;
}

.tv-bm-menu__footer-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.tv-bm-menu__footer-total {
    font-size: 17px;
    font-weight: 900;
    color: #134e34;
    white-space: nowrap;
}

.tv-bm-heading {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: none;
}

.tv-bm-heading span {
    color: #ffa827;
    font-weight: 900;
    font-size: 18px;
    margin-top: -2px;
}

.tv-bm-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tv-bm-input {
    width: 100%;
    height: 42px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0 14px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    box-shadow: none !important;
}

/* Fix chiều cao cho Flatsome */
.tv-bm-dialog input[type="text"],
.tv-bm-dialog input[type="tel"],
.tv-bm-dialog input[type="number"],
.tv-bm-dialog input[type="date"],
.tv-bm-dialog select,
.tv-bm-dialog textarea {
    height: 42px;
    line-height: normal;
    padding: 0 14px;
    margin-bottom: 0;
    box-shadow: none;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    color: #333;
}

.tv-bm-dialog input[type="date"] {
    padding-left: 8px;
    padding-right: 6px; /* cho mũi tên của DatePicker */
    font-size: 13px;
    letter-spacing: -0.3px;
}

.tv-bm-dialog textarea {
    height: auto;
    min-height: 90px;
    padding: 12px 16px;
    resize: vertical;
    line-height: 1.5;
}

.tv-bm-input:focus,
.tv-bm-dialog input:focus,
.tv-bm-dialog select:focus,
.tv-bm-dialog textarea:focus {
    border-color: #0b5c37;
    outline: none;
    box-shadow: 0 0 0 3px rgba(11, 92, 55, 0.1) !important;
}

.tv-bm-input::placeholder {
    color: #999;
}

.tv-bm-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 44px !important;
    margin-bottom: 16px !important;
}

.tv-bm-row-3 {
    display: grid;
    grid-template-columns: 110px 1.3fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .tv-bm-row-3 {
        grid-template-columns: 1fr;
    }
}

.tv-bm-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tv-bm-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Qty Counter */
.tv-bm-qty {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    height: 42px;
    background: #fff;
    transition: border-color 0.3s;
}

.tv-bm-qty:focus-within {
    border-color: #0b5c37;
    box-shadow: 0 0 0 3px rgba(11, 92, 55, 0.1);
}

.tv-bm-qty-btn {
    background: transparent;
    border: none;
    width: 100% !important;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0 !important;
    margin: 0 !important;
}

.tv-bm-qty-btn:hover {
    background: #f5f5f5;
}

.tv-bm-qty-input {
    width: 100% !important;
    text-align: center;
    border: none !important;
    border-left: 1px solid #e0e0e0 !important;
    border-right: 1px solid #e0e0e0 !important;
    font-size: 15px !important;
    font-weight: 600;
    padding: 0 !important;
    appearance: textfield;
    -moz-appearance: textfield;
    height: 100% !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.tv-bm-qty-input::-webkit-outer-spin-button,
.tv-bm-qty-input::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

/* Promo Select */
.tv-bm-promo {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230b5c37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'%3e%3c/polygon%3e%3c/svg%3e"), url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-position: left 16px center, right 16px center !important;
    padding-left: 44px !important;
}

.tv-bm-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.tv-bm-close-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.tv-bm-close-btn:hover {
    color: #111;
    background: #f5f5f5;
}

.tv-bm-submit-btn {
    background: #ffa827;
    color: #111;
    border: none;
    border-radius: 99px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 168, 39, 0.3);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .tv-bm-submit-btn {
        padding: 12px 20px;
        font-size: 13px;
    }
}

.tv-bm-submit-btn:hover {
    background: #f99c16;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 168, 39, 0.4);
}

.tv-bm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tv-bm-feedback {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    padding: 12px 14px;
    border-radius: 8px;
    display: none;
}
.tv-bm-feedback.is-loading {
    display: block;
    background: #f0f7ff;
    color: #1565c0;
    border: 1px solid #bbdefb;
}
.tv-bm-feedback.is-error {
    display: block;
    background: #fff0f0;
    color: #d32f2f;
    border: 1px solid #ffdcdc;
}
.tv-bm-feedback.is-success {
    display: block;
    background: #f0fdf4;
    color: #0b5c37;
    border: 1px solid #dcfce7;
}

/* ── Màn hình thành công ─────────────────────── */
.tv-bm-success {
    padding: 28px 24px 24px;
    text-align: center;
}

.tv-bm-success__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e8f8ef 0%, #d4f0e0 100%);
    color: #0b5c37;
    animation: tvBmSuccessPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tv-bm-success__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    color: #134e34;
    line-height: 1.25;
}

.tv-bm-success__lead {
    margin: 0 0 20px;
    font-size: 14px;
    color: #555;
    line-height: 1.55;
}

.tv-bm-success__code {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
    padding: 10px 20px;
    border-radius: 10px;
    background: #fff8ee;
    border: 1px dashed #e69500;
}

.tv-bm-success__code-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tv-bm-success__code-val {
    font-size: 20px;
    font-weight: 900;
    color: #e69500;
    letter-spacing: 0.08em;
}

.tv-bm-success__list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    text-align: left;
    border: 1px solid #eef0f2;
    border-radius: 10px;
    overflow: hidden;
}

.tv-bm-success__list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.tv-bm-success__list li:last-child {
    border-bottom: none;
}

.tv-bm-success__list li span {
    flex-shrink: 0;
    color: #888;
}

.tv-bm-success__list li strong {
    text-align: right;
    color: #222;
    font-weight: 700;
    line-height: 1.4;
}

.tv-bm-success__btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    background: #134e34;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tv-bm-success__btn:hover {
    background: #0b5c37;
}

@keyframes tvBmSuccessPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Animations */
.tv-bm-overlay {
    animation: tvBmFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tv-bm-dialog {
    animation: tvBmSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tvBmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tvBmSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
