/*
 * Trang tour + trang đặt tour, bản hiện đại 31/10 (tour.jsp, tour-book-now.jsp).
 * Mọi màu thương hiệu lấy từ --primary-color / --secondary-color do layout.jsp in theo từng site, nên brand khác tự đúng màu.
 * Mọi quy tắc nằm dưới .tv để không ảnh hưởng trang khác.
 */
html { scroll-behavior: smooth; }

.tv {
    --tv-brand: var(--primary-color, #243636);
    --tv-accent: var(--secondary-color, #a14c2f);
    --tv-ink: #1e2a2a;
    --tv-muted: #66736f;
    --tv-line: #e9e4dc;
    --tv-surface: #faf7f2;
    --tv-surface: color-mix(in srgb, var(--tv-accent) 5%, #fbfaf7);
    --tv-accent-soft: rgba(161, 76, 47, .1);
    --tv-accent-soft: color-mix(in srgb, var(--tv-accent) 11%, #fff);
    --tv-radius: 16px;
    --tv-shadow: 0 1px 2px rgba(30, 42, 42, .05), 0 12px 32px rgba(30, 42, 42, .08);
    --tv-sticky-top: calc(var(--tv-header-h, 0px) + 12px);
    color: var(--tv-ink);
    font-size: 16px;
    line-height: 1.65;
}

.tv a { text-decoration: none; }
.tv .max-w-screen-xl { max-width: 1232px; }

/* Nút */
.tv .tv-btn,
.tv .tour-details-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 12px 28px;
    border: 0;
    border-radius: 999px;
    background: var(--tv-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    cursor: pointer;
    box-shadow: 0 8px 20px -8px var(--tv-accent);
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.tv .tv-btn:hover,
.tv .tour-details-button:hover { filter: brightness(1.08); transform: translateY(-1px); color: #fff; background: var(--tv-accent); }
.tv .tv-btn:focus-visible,
.tv .tour-details-button:focus-visible { outline: 3px solid var(--tv-accent-soft); outline-offset: 2px; }

.tv .tour-details-button.btn-disabled,
.tv .tour-details-button[disabled] {
    background: #d9d6d0;
    color: #fff;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* ===== Trang tour: ảnh đầu trang ===== */
.tv-hero {
    position: relative;
    background: var(--tv-brand);
    color: #fff;
}

.tv-hero__media,
.tv-hero__media .carousel-inner,
.tv-hero__media .carousel-item { height: clamp(420px, 68vh, 620px); }
.tv-hero__media .carousel-item img { height: 100%; width: 100%; object-fit: cover; }
.tv-hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(180deg, rgba(10, 20, 20, .28) 0%, rgba(10, 20, 20, 0) 22%, rgba(10, 20, 20, 0) 34%, rgba(10, 20, 20, .58) 66%, rgba(10, 20, 20, .84) 100%);
}

.tv-hero__media .carousel-control-prev,
.tv-hero__media .carousel-control-next {
    z-index: 3;
    width: 44px;
    height: 44px;
    top: 26%; /* cao hơn tên tour + breadcrumb, và không nằm dưới cụm nút mạng xã hội cố định ở mép phải */
    margin: 0 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 1;
}
.tv-hero__media .carousel-control-prev-icon,
.tv-hero__media .carousel-control-next-icon { width: 18px; height: 18px; }

.tv-hero__body {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 64px;
}
.tv-hero__body a { pointer-events: auto; }
.tv-hero__body .container { width: 100%; }

.tv-crumbs .breadcrumb {
    flex-wrap: nowrap;
    overflow: hidden;
    margin: 0 0 12px;
    padding: 0;
    background: none;
    font-size: 13px;
}
.tv-crumbs .breadcrumb-item { white-space: nowrap; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.tv-crumbs .breadcrumb-item a { color: rgba(255, 255, 255, .85); pointer-events: auto; }
.tv-crumbs .breadcrumb-item a:hover { color: #fff; }
.tv-crumbs .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .55); }
.tv-crumbs .breadcrumb-item.active { color: #fff; overflow: hidden; text-overflow: ellipsis; }

.tv .tv-title {
    max-width: 820px;
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(28px, 4.4vw, 48px);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -.01em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, .35);
}

.tv-share { display: flex; gap: 8px; }
.tv-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 15px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background .15s ease;
}
.tv-share a:hover { background: rgba(255, 255, 255, .34); color: #fff; }
.tv-share img { filter: brightness(0) invert(1); }

/* Ảnh nhỏ chọn slide (máy tính), chấm (điện thoại) */
.tv-hero__media .tv-hero__thumbs {
    z-index: 3;
    justify-content: flex-start;
    left: auto;
    right: max(24px, calc((100vw - 1232px) / 2 + 12px));
    bottom: 58px;
    max-width: 444px; /* 6 ảnh, còn lại kéo ngang */
    margin: 0;
    padding: 2px;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tv-hero__media .tv-hero__thumbs::-webkit-scrollbar { display: none; }
.tv-hero__media .tv-hero__thumbs [data-bs-target] {
    flex: 0 0 auto;
    width: 66px;
    height: 46px;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, .55);
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    opacity: .85;
    transition: border-color .15s ease, opacity .15s ease, transform .15s ease;
}
.tv-hero__media .tv-hero__thumbs [data-bs-target].active { border-color: #fff; opacity: 1; transform: translateY(-2px); }

/* ===== Thẻ thông tin nhanh ===== */
.tv-facts {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-top: -36px;
    background: #fff;
    border-radius: var(--tv-radius);
    box-shadow: var(--tv-shadow);
}
.tv-fact {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 20px 22px;
    border-left: 1px solid var(--tv-line);
}
.tv-fact:first-child { border-left: 0; }
.tv-fact > i {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--tv-accent-soft);
    color: var(--tv-accent);
    font-size: 18px;
}
.tv-fact__label { font-size: 12.5px; color: var(--tv-muted); line-height: 1.4; }
.tv-fact__value { font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--tv-ink); }
.tv-fact__value a { color: inherit; }
.tv-fact__value a:hover { color: var(--tv-accent); }

/* ===== Thanh mục ===== */
#stickyTabs.tv-tabs,
#stickyTabs.tv-tabs.container {
    position: sticky;
    top: var(--tv-header-h, 0px);
    z-index: 1020;
    width: 100%;
    max-width: none;
    margin-top: 24px;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid var(--tv-line);
}
#stickyTabs.stuck { box-shadow: 0 8px 20px -14px rgba(30, 42, 42, .4); }
.tv-tabs__row {
    display: flex;
    gap: 28px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tv-tabs__row::-webkit-scrollbar { display: none; }
.tv-tabs__row a {
    flex: 0 0 auto;
    padding: 16px 0;
    border-bottom: 3px solid transparent;
    color: var(--tv-muted);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    transition: color .15s ease, border-color .15s ease;
}
.tv-tabs__row a:hover { color: var(--tv-ink); }
.tv-tabs__row a.is-active { color: var(--tv-accent); border-bottom-color: var(--tv-accent); }

/* ===== Bố cục 2 cột ===== */
.tv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 372px;
    gap: 40px;
    align-items: start;
    padding-top: 32px;
}
.tv-section { padding-bottom: 44px; scroll-margin-top: calc(var(--tv-header-h, 0px) + 76px); }
.tv .tv-h2 {
    margin: 0 0 18px;
    color: var(--tv-brand);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
}
.tv .tv-prose { font-size: 16px; line-height: 1.7; color: #33403f; overflow-wrap: break-word; }
.tv .tv-prose p { margin: 0 0 10px; }
.tv .tv-prose p:last-child { margin-bottom: 0; }
.tv .tv-prose img { max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0; }
.tv .tv-prose strong { color: var(--tv-ink); }
.tv .tv-prose table { max-width: 100%; display: block; overflow-x: auto; }

.tv-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tv .tag-group .tag-item {
    margin: 0;
    padding: 5px 14px;
    border: 1px solid var(--tv-line);
    border-radius: 999px;
    background: var(--tv-surface);
    color: var(--tv-muted);
    font-size: 13px;
    font-weight: 400;
}

/* ===== Lịch trình dạng dòng thời gian ===== */
.tv-timeline { position: relative; }
.tv-timeline::before {
    content: "";
    position: absolute;
    top: 24px;
    bottom: 24px;
    left: 21px;
    width: 2px;
    background: var(--tv-line);
}
.tv-day { position: relative; margin: 0 0 12px; }
.tv-day__head {
    display: flex;
    width: 100%;
    gap: 16px;
    align-items: center;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.tv-day__dot {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--tv-accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 0 1px var(--tv-line);
}
.tv-day__text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 0;
}
.tv-day__title { font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--tv-ink); }
.tv-day__time { font-size: 13.5px; color: var(--tv-muted); }
.tv-day__chev { flex: 0 0 auto; color: var(--tv-muted); transition: transform .2s ease; }
.tv-day__head:not(.collapsed) .tv-day__chev { transform: rotate(180deg); }
.tv .tv-day__body { margin: 0 0 8px 60px; padding: 16px 18px; background: var(--tv-surface); border-radius: 12px; }

/* ===== Khối đặt chỗ trên trang tour ===== */
.tv-booking {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--tv-line);
    border-radius: var(--tv-radius);
    box-shadow: var(--tv-shadow);
}
.tv-label { margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--tv-muted); }
.tv-options { display: grid; gap: 10px; margin-bottom: 18px; }
.tv-options:empty { display: none; }
.tv .group-price-item.tv-option {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 14px 16px 14px 44px;
    border: 1.5px solid var(--tv-line);
    border-radius: 12px;
    background: #fff;
    color: var(--tv-ink);
    font-size: 15px;
    font-weight: 400;
    transition: border-color .15s ease, background .15s ease;
}
.tv .group-price-item.tv-option::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2px solid #c9c4bb;
    border-radius: 50%;
    background: #fff;
}
.tv .group-price-item.tv-option:hover { border-color: var(--tv-accent); background: #fff; color: var(--tv-ink); }
.tv .group-price-item.tv-option.selected { border-color: var(--tv-accent); background: var(--tv-accent-soft); color: var(--tv-ink); }
.tv .group-price-item.tv-option.selected::before { border-color: var(--tv-accent); box-shadow: inset 0 0 0 3px #fff; background: var(--tv-accent); }
.tv-option__name { font-weight: 700; line-height: 1.4; }
.tv-option__date { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--tv-muted); }
.tv-option__price { flex: 0 0 auto; font-weight: 700; color: var(--tv-accent); white-space: nowrap; }

.tv .quantity.tv-row,
.tv #tour-prices .quantity.tv-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 14px 0;
    background: none;
    border-top: 1px solid var(--tv-line);
}
.tv .quantity.tv-row.d-none { display: none; }
.tv-row__label { font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--tv-ink); min-width: 0; }
.tv-row__price { display: block; font-size: 13.5px; font-weight: 400; color: var(--tv-muted); }
.tv-date { width: 210px; flex: 0 0 auto; }
.tv-date .input-group-text { background: #fff; border-color: var(--tv-line); color: var(--tv-muted); border-radius: 10px 0 0 10px; }
.tv .tv-date .form-control { height: 46px; border-color: var(--tv-line); border-radius: 0 10px 10px 0; background-color: #fff; cursor: pointer; }

/* Bộ tăng giảm số khách */
.tv .number-input { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; }
.tv .number-input .minus-qty,
.tv .number-input .plus-qty {
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--tv-line);
    border-radius: 50%;
    background: #fff;
    color: var(--tv-ink);
    font-size: 20px;
    -webkit-user-select: none;
    user-select: none;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.tv .number-input .minus-qty:hover,
.tv .number-input .plus-qty:hover { border-color: var(--tv-accent); background: var(--tv-accent); color: #fff; }
.tv .number-input input[type=number] {
    width: 44px;
    border: 0;
    background: none;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    color: var(--tv-ink);
    -moz-appearance: textfield;
    appearance: textfield;
}
.tv .number-input input[type=number]:focus { outline: 0; box-shadow: none; }
.tv input[type=number]::-webkit-outer-spin-button,
.tv input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.tv-total {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    border-top: 1px solid var(--tv-line);
}
.tv-total .tour-total-price { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--tv-brand); }
.tv-total .tour-details-button { min-width: 170px; }
.tv .tv-note { margin-top: 18px; padding: 16px 18px; background: var(--tv-surface); border-radius: 12px; font-size: 15px; }
.tv .tv-note:empty { display: none; }

.tv-noprice {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding: 36px 24px;
    background: var(--tv-surface);
    border-radius: var(--tv-radius);
    text-align: center;
}
.tv-noprice i { font-size: 28px; color: var(--tv-accent); line-height: 1; }
.tv-noprice p { max-width: 460px; margin: 0; }

.tv .tv-terms-box { padding: 22px 24px; background: var(--tv-surface); border-radius: var(--tv-radius); font-size: 15px; }

/* ===== Cột phải ===== */
.tv-side {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tv .tv-side .min-price-popup {
    position: sticky;
    top: calc(var(--tv-header-h, 0px) + 72px);
    z-index: 5;
}
/* Nút trong form gọi lại có z-index riêng: gói lại để thẻ giá dính luôn nằm trên khi cuộn qua */
.tv .tv-side .tv-plan,
.tv .tv-side .tv-phone { position: relative; z-index: 1; }
.tv-card {
    padding: 22px;
    background: #fff;
    border: 1px solid var(--tv-line);
    border-radius: var(--tv-radius);
}
.tv .min-price-popup { box-shadow: var(--tv-shadow); border-color: transparent; }
.tv .min-price-popup .tv-btn { width: 100%; margin-top: 16px; }
.tv-price__lead { display: block; font-size: 13px; color: var(--tv-muted); line-height: 1.4; }
.tv-price__amount { font-size: 28px; font-weight: 700; color: var(--tv-brand); line-height: 1.2; }
.tv-price__per { font-size: 14px; color: var(--tv-muted); }
.tv .tv-card--noprice .tv-btn { margin-top: 0; }
/* Thẻ "Báo giá theo yêu cầu" do script dt-price0 trong footer plugin chèn vào .min-price-popup */
.tv .dt-price0 .dt0-b { min-height: 48px; display: flex; align-items: center; justify-content: center; }
.tv .dt-price0 .dt0-q { background: var(--tv-accent); box-shadow: 0 8px 20px -8px var(--tv-accent); }
.tv .dt-price0 .dt0-b:last-child { margin-bottom: 0; }
.tv-card__title { margin-bottom: 8px; font-size: 16px; font-weight: 700; color: var(--tv-brand); }
.tv-plan__link {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    color: var(--tv-ink);
    font-weight: 700;
    font-size: 15px;
}
.tv-plan__link i { color: var(--tv-accent); font-size: 18px; }
.tv-plan__link:hover { color: var(--tv-accent); }
.tv .tv-plan .tv-plan__link:last-child { padding-bottom: 0; }

/* ===== Tour gợi ý ===== */
.tv-suggested { padding-top: 8px; padding-bottom: 56px; }
.tv-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tv-tcard {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--tv-line);
    border-radius: var(--tv-radius);
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease;
}
.tv-tcard:hover { transform: translateY(-4px); box-shadow: var(--tv-shadow); color: inherit; }
.tv-tcard__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--tv-surface); }
.tv-tcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tv-tcard:hover .tv-tcard__media img { transform: scale(1.05); }
.tv-tcard__badge {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--tv-ink);
    font-size: 13px;
    font-weight: 700;
}
.tv-tcard__badge i { color: var(--tv-accent); }
.tv-tcard__body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.tv-tcard__name { font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--tv-ink); }
.tv-tcard:hover .tv-tcard__name { color: var(--tv-accent); }
.tv-tcard__dest { font-size: 13.5px; color: var(--tv-muted); }
.tv-tcard__dest i { color: var(--tv-accent); }

/* ===== Thanh dính đáy (điện thoại) ===== */
.tv-mbar,
.tv-paybar { display: none; }

/* ===== Trang đặt tour ===== */
.tv-bookpage { background: var(--tv-surface); padding: 24px 0 56px; }
.tv-bookpage .container { max-width: 1160px; }
.tv-bookhead { margin-bottom: 22px; }
.tv-back { display: inline-flex; gap: 8px; align-items: center; color: var(--tv-muted); font-size: 14px; font-weight: 700; }
.tv-back:hover { color: var(--tv-accent); }
.tv .tv-booktitle {
    margin: 8px 0 0;
    color: var(--tv-brand);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.22;
}
.tv-bookgrid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
    align-items: start;
}
.tv-bookform { grid-column: 1; grid-row: 1; min-width: 0; display: grid; gap: 18px; }
.tv-summary {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: var(--tv-sticky-top);
}
.tv-step {
    padding: 24px;
    background: #fff;
    border-radius: var(--tv-radius);
    box-shadow: 0 1px 2px rgba(30, 42, 42, .05);
    border: 1px solid var(--tv-line);
}
.tv-step__head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.tv-step__num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tv-brand);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.tv .tv-step__title { margin: 0; color: var(--tv-ink); font-size: 19px; font-weight: 700; line-height: 1.3; }
.tv-step .quantity.tv-row:last-child { padding-bottom: 0; }

.tv-hint {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: var(--tv-surface);
    border-radius: 12px;
    font-size: 14px;
    color: var(--tv-muted);
    line-height: 1.5;
}
.tv-hint > i { color: var(--tv-accent); font-size: 20px; line-height: 1.2; }
.tv-hint__title { font-weight: 700; color: var(--tv-ink); }

.tv-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tv-field--full { grid-column: 1 / -1; }
.tv .tv-field__label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--tv-ink); }
.tv .tv-field .form-control {
    min-height: 48px;
    padding: 10px 14px;
    border: 1.5px solid var(--tv-line);
    border-radius: 10px;
    background-color: #fff;
    font-size: 16px; /* dưới 16px iOS tự phóng to khi gõ */
    color: var(--tv-ink);
}
.tv .tv-field .form-control:focus { border-color: var(--tv-accent); box-shadow: 0 0 0 3px var(--tv-accent-soft); outline: 0; }

.tv-pay { display: grid; gap: 10px; border-radius: 12px; }
.tv .tv-pay__item {
    display: block;
    margin: 0;
    padding: 0;
    border: 1.5px solid var(--tv-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
    transition: border-color .15s ease, background .15s ease;
}
.tv .tv-pay__item:has(input:checked) { border-color: var(--tv-accent); background: var(--tv-accent-soft); }
.tv-pay__row { display: flex; gap: 12px; align-items: center; padding: 0 16px; }
.tv .tv-pay__row .form-check-input { flex: 0 0 auto; float: none; width: 20px; height: 20px; margin: 0; }
.tv .tv-pay__row .form-check-input:checked { background-color: var(--tv-accent); border-color: var(--tv-accent); }
.tv .tv-pay__row .form-check-label { flex: 1 1 auto; min-height: 52px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.tv .tv-pay__content { max-height: 200px; overflow-y: auto; }
.tv .tv-pay__content .tv-prose { padding: 0 16px 14px 48px; font-size: 14px; }

.tv .tv-terms { display: flex; gap: 10px; margin: 18px 0; padding: 12px; border-radius: 10px; font-size: 14px; line-height: 1.55; }
.tv .tv-terms .form-check-input { flex: 0 0 auto; float: none; width: 20px; height: 20px; margin: 1px 0 0; }
.tv .tv-terms .form-check-input:checked { background-color: var(--tv-accent); border-color: var(--tv-accent); }
.tv .tv-terms a { color: var(--tv-accent); text-decoration: underline; text-underline-offset: 2px; }
.tv #btnBookNowSubmit { width: 100%; }

.tv-flash { animation: tv-flash 1.6s ease; }
@keyframes tv-flash {
    0%, 60% { box-shadow: 0 0 0 3px var(--tv-accent); background: var(--tv-accent-soft); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.tv-summary__card {
    overflow: hidden;
    background: #fff;
    border-radius: var(--tv-radius);
    box-shadow: var(--tv-shadow);
}
.tv-summary__img { display: block; width: 100%; height: 140px; object-fit: cover; }
.tv-summary__body { padding: 20px 22px 22px; }
.tv-summary__name { font-size: 14px; font-weight: 700; line-height: 1.45; color: var(--tv-ink); }
.tv .tv-summary__facts { margin: 12px 0 0; font-size: 14px; }
.tv-summary__facts > div { display: flex; gap: 12px; justify-content: space-between; padding: 6px 0; }
.tv-summary__facts dt { flex: 0 0 auto; margin: 0; font-weight: 400; color: var(--tv-muted); }
.tv-summary__facts dt i { color: var(--tv-accent); margin-right: 4px; }
.tv-summary__facts dd { margin: 0; font-weight: 700; text-align: right; color: var(--tv-ink); }
.tv-lines { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--tv-line); font-size: 14px; }
.tv-line { display: flex; gap: 12px; justify-content: space-between; padding: 3px 0; }
.tv-line__amt { font-weight: 700; white-space: nowrap; }
.tv-summary__total {
    display: flex;
    gap: 12px;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--tv-line);
    font-weight: 700;
}
.tv-summary__total .tour-total-price { font-size: 24px; color: var(--tv-brand); line-height: 1.2; text-align: right; }
.tv .tv-summary__cta { width: 100%; margin-top: 16px; }

/* ===== Máy tính bảng & điện thoại ===== */
@media (max-width: 991.98px) {
    .tv-hero__media,
    .tv-hero__media .carousel-inner,
    .tv-hero__media .carousel-item { height: clamp(340px, 58vh, 480px); }
    .tv-hero__media .carousel-control-prev,
    .tv-hero__media .carousel-control-next { display: none; }
    .tv-hero__body { padding-bottom: 52px; }
    .tv-crumbs .breadcrumb-item.active { display: none; }
    .tv-crumbs .breadcrumb-item:nth-last-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

    /* Ảnh nhỏ thành chấm: phải ở trên tiêu đề để không đè chữ */
    .tv-hero__media .tv-hero__thumbs {
        top: 16px;
        bottom: auto;
        right: 16px;
        max-width: calc(100% - 32px);
        gap: 6px;
    }
    .tv-hero__media .tv-hero__thumbs [data-bs-target] {
        width: 22px;
        height: 4px;
        border: 0;
        border-radius: 4px;
        background-image: none !important;
        background-color: rgba(255, 255, 255, .55);
        transform: none !important;
    }
    .tv-hero__media .tv-hero__thumbs [data-bs-target].active { background-color: #fff; }

    .tv-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -28px; }
    .tv-fact { flex-direction: column; gap: 8px; padding: 14px 16px; border-left: 0; }
    .tv-fact:nth-child(even) { border-left: 1px solid var(--tv-line); }
    .tv-fact:nth-child(n+3) { border-top: 1px solid var(--tv-line); }
    .tv-fact > i { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
    .tv-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }

    .tv-tabs__row { gap: 22px; }

    .tv-layout { display: flex; flex-direction: column; gap: 0; padding-top: 24px; }
    .tv-main { order: 2; width: 100%; }
    .tv-side { display: contents; }
    .tv .tv-card { order: 3; width: 100%; margin-bottom: 16px; }
    .tv .tv-side .min-price-popup { position: static; order: 1; margin-bottom: 24px; }
    .tv .tv-side .min-price-popup.tv-card--priced { display: none; }

    .tv-section { padding-bottom: 36px; }
    .tv .tv-h2 { font-size: 22px; margin-bottom: 14px; }
    .tv-suggested { padding-bottom: 24px; }
    .tv-cards {
        display: flex;
        gap: 14px;
        margin: 0 calc(var(--x-gutter-x, 1.5rem) * -.5);
        padding: 0 calc(var(--x-gutter-x, 1.5rem) * .5) 8px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .tv-cards::-webkit-scrollbar { display: none; }
    .tv-tcard { flex: 0 0 78%; max-width: 320px; scroll-snap-align: start; }

    .tv-mbar,
    .tv-paybar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1025;
        display: flex;
        gap: 14px;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        box-shadow: 0 -6px 24px rgba(30, 42, 42, .14);
        transition: transform .2s ease;
    }
    .tv-mbar.is-hidden,
    .tv-paybar.is-hidden { transform: translateY(110%); }
    .tv-mbar .tv-btn,
    .tv-paybar .tv-btn { flex: 1 1 auto; max-width: 56%; min-height: 48px; padding: 10px 18px; margin-left: auto; }
    .tv-mbar__price { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
    .tv-mbar__lead { font-size: 12px; color: var(--tv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tv-mbar__amount { font-size: 18px; font-weight: 700; color: var(--tv-brand); white-space: nowrap; }

    /* Chừa chỗ cho thanh dính; nút lên đầu trang của footer plugin dời lên trên thanh */
    body:has(.tv-mbar),
    body:has(.tv-paybar) { padding-bottom: 72px; }
    body:has(.tv-mbar) #backToTopBtn.dt-top,
    body:has(.tv-paybar) #backToTopBtn.dt-top { bottom: 84px; }

    /* Trang đặt tour: tóm tắt trước, form sau */
    .tv-bookpage { padding: 16px 0 32px; }
    .tv-bookgrid { display: flex; flex-direction: column; gap: 16px; }
    .tv-summary { position: static; width: 100%; order: 1; }
    .tv-bookform { order: 2; width: 100%; }
    .tv-summary__card { display: block; }
    .tv-summary__img { height: 96px; }
    .tv-summary__body { padding: 14px 18px; }
    .tv .tv-summary__cta,
    .tv-summary__total { display: none; } /* tổng tiền + nút đã có ở thanh dính */
    .tv .tv-summary__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin-top: 8px; font-size: 13.5px; }
    .tv-summary__facts > div { display: block; padding: 0; }
    .tv-summary__facts dd { text-align: left; }
    .tv-step { padding: 18px; }
    .tv-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 575.98px) {
    .tv-hero__body { padding-bottom: 46px; }
    .tv .tv-title { margin-bottom: 12px; }
    .tv-share a { width: 32px; height: 32px; font-size: 13px; }
    .tv-booking { padding: 18px; }
    .tv-total .tour-details-button { width: 100%; }
    .tv .group-price-item.tv-option { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .tv * { transition: none !important; animation: none !important; }
}
