.vn-train-price-search {
    --vn-primary: #0f766e;
    --vn-primary-dark: #115e59;
    --vn-border: #dbe7ec;
    --vn-table-head-bg: linear-gradient(180deg, #eaf7f5, #dff0ee);
    --vn-table-head-border: #c8dedc;
    --vn-table-head-text: #173f46;
    --vn-text: #1f3842;
    box-sizing: border-box;
    color: var(--vn-text);
    display: block;
    font-size: 15px;
    line-height: 1.55;
    margin: 24px 0;
}

body.home .contenthome1 {
    max-width: 1162px !important;
    width: 72.6% !important;
}

.contenthome1 .vn-train-price-search {
    margin: 24px auto;
    max-width: 1162px;
    width: 100%;
}

/* Expand the booking form on desktop only; keep the existing mobile layout. */
@media (min-width: 901px) {
    body.home .contenthome1 {
        max-width: 1400px !important;
        width: 100% !important;
    }
}

@media (max-width: 900px) {
    body.home .site.grid-container.container,
    body.home .site-content,
    body.home .section-home1,
    body.home .noidung-home1,
    body.home .contenthome1 {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    body.home .contenthome1 {
        padding-left: 12px;
        padding-right: 12px;
    }
}

.vn-train-price-search * {
    box-sizing: border-box;
}

.vn-train-price-search h2 {
    color: #16343d;
    font-size: clamp(22px, 3vw, 30px);
    letter-spacing: -0.02em;
}

.vn-train-price-search-form,
.vn-train-price-search .vn-train-price {
    background: linear-gradient(180deg, #fff 0%, #fbfdfe 100%);
    border: 1px solid var(--vn-border);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(25, 68, 82, 0.08);
}

.vn-train-price-search-form {
    padding: 24px;
}

.vn-train-price-search-form h2 {
    margin: 0 0 14px;
}

.vn-train-price-search--sidebar {
    font-size: 14px;
    margin: 16px 0;
}

.vn-train-price-search--sidebar .vn-train-price-search-form {
    border-radius: 16px;
    padding: 16px;
}

.vn-train-price-search--sidebar .vn-train-price-search-form h2 {
    font-size: 20px;
    line-height: 1.25;
}

.vn-train-price-search-row {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.vn-train-price-search-row:first-of-type {
    margin-top: 0;
}

.vn-train-price-search--sidebar .vn-train-price-search-row {
    grid-template-columns: 1fr;
}

.vn-train-price-search-row > div {
    min-width: 0;
}

.vn-train-price-search-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.vn-train-price-search-row input,
.vn-train-price-search-row select {
    appearance: auto;
    background: #fff;
    border: 1px solid #d7e3ea;
    border-radius: 10px;
    color: #1f3842;
    display: block;
    font-size: 14px;
    min-height: 48px;
    padding: 10px 12px;
    width: 100%;
}

.vn-train-price-search-row input:focus,
.vn-train-price-search-row select:focus {
    border-color: var(--vn-primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
    outline: 0;
}

.vn-train-price-search-row .vn-station-search-input {
    min-height: 40px;
}

.vn-station-search-input::placeholder {
    color: #78909a;
    font-size: 13px;
}

.vn-station-search-field {
    position: relative;
}

.vn-station-search-list {
    background: #fff;
    border: 1px solid #d7e3ea;
    border-radius: 12px;
    box-shadow: 0 16px 34px rgba(25, 68, 82, 0.14);
    left: 0;
    max-height: 260px;
    overflow: auto;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
}

.vn-station-search-option {
    background: #fff;
    border: 0;
    border-radius: 8px;
    color: #1f3842;
    cursor: pointer;
    display: block;
    font-size: 14px;
    font-weight: 400;
    min-height: 36px;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.vn-station-search-option:hover,
.vn-station-search-option:focus {
    background: #eaf7f5;
    color: #0f766e;
    outline: 0;
}

.vn-train-price-search-submit button,
.vn-price-continue,
.vn-train-price-search .vrb-tr-button {
    background: var(--vn-primary);
    border: 0;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    min-height: 48px;
    padding: 12px 14px;
}

.vn-train-price-search-submit button {
    width: 100%;
}

.vn-train-price-search-submit button:hover,
.vn-price-continue:hover,
.vn-train-price-search .vrb-tr-button:hover {
    background: var(--vn-primary-dark);
    color: #fff;
}

.vn-train-price-search-submit button:disabled {
    background: #91a6ad;
    cursor: not-allowed;
    opacity: 0.75;
}

.vn-train-price-search .vrb-tr-button-muted {
    background: #eef5f7;
    color: #33515b;
}

.vn-train-price-search .vn-train-price {
    margin-top: 20px;
    padding: 20px;
}

.vn-train-price-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.vn-train-price-head h2,
.vn-train-price-head p {
    margin-top: 0;
}

.vn-train-price-heading-row {
    align-items: flex-start;
}

.vn-train-price-heading-row h3 {
    flex: 1 1 auto;
    line-height: 1.25;
    text-align: left;
    letter-spacing: normal;
    word-spacing: normal;
}

.vn-train-price-heading-row .vn-train-other-date-form {
    flex: 0 0 auto;
}

.vn-train-price h2:focus {
    outline: 0;
}

.vn-train-price-matrix-wrapper {
    border: 1px solid var(--vn-border);
    border-radius: 16px;
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.vn-train-price-table {
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    width: 100%;
}

.vn-train-price-table th,
.vn-train-price-table td {
    border-bottom: 1px solid #d9e8ee;
    border-right: 1px solid #d9e8ee;
    padding: 10px;
    text-align: center;
}

.vn-train-price-table th:last-child,
.vn-train-price-table td:last-child {
    border-right: 0;
}

.vn-train-price-table tbody tr:last-child th,
.vn-train-price-table tbody tr:last-child td {
    border-bottom: 0;
}

.vn-train-price-table thead th {
    background: var(--vn-table-head-bg);
    border-color: var(--vn-table-head-border);
    color: var(--vn-table-head-text);
    font-weight: 800;
    padding: 13px 12px;
}

.vn-train-price-table thead th:first-child,
.vn-train-price-table tbody th {
    background: var(--vn-table-head-bg);
    border-color: var(--vn-table-head-border);
    color: var(--vn-table-head-text);
    font-weight: 800;
    text-align: left;
}

.vn-train-price-search .vn-train-price-table tbody th:first-child {
    background: var(--vn-table-head-bg);
    border-color: var(--vn-table-head-border);
    color: var(--vn-table-head-text);
}

.vn-train-price-search .vn-train-price-table thead th:first-child,
.vn-train-price-search .vn-train-price-table tbody th:first-child,
.vn-train-price-search .vn-train-price-table tbody th:first-child span,
.vn-train-price-search .vn-train-price-table tbody th:first-child small {
    color: var(--vn-table-head-text);
}

.vn-train-price-search .vn-train-price-table thead th:first-child,
.vn-train-price-search .vn-train-price-table tbody th:first-child {
    background: var(--vn-table-head-bg);
    font-weight: 800;
}

.entry-content .vn-train-price-search .vn-train-price-table thead th:first-child,
.entry-content .vn-train-price-search .vn-train-price-table tbody th:first-child {
    background: var(--vn-table-head-bg);
    border-color: var(--vn-table-head-border);
    color: var(--vn-table-head-text);
    font-weight: 800;
}

.vn-train-price-table tbody th .vn-train-seat-name,
.vn-train-price-table tbody th .vn-train-price-tier-note {
    color: var(--vn-table-head-text);
}

.vn-train-price-table td {
    background: #fff;
}

.vn-train-code,
.vn-train-price-cell span {
    display: block;
}

.vn-train-code {
    font-weight: 800;
}

.vn-train-time {
    color: #5f7480;
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 3px;
    white-space: nowrap;
}

.vn-train-seat-name {
    display: block;
}

.vn-train-price-tier-note {
    color: #6b7f87;
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 4px;
}

.vn-train-price-options {
    display: grid;
    gap: 6px;
    min-width: 116px;
}

.vn-train-price-cell {
    background: #fff;
    border: 1px solid #d8e7ec;
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(25, 68, 82, 0.03);
    cursor: pointer;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    line-height: 1.25;
    margin: 0;
    padding: 7px 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.vn-train-price-cell:hover {
    background: #f8fcfc;
    border-color: #9fcfca;
    box-shadow: 0 6px 18px rgba(15, 118, 110, 0.08);
}

.vn-train-price-cell:has(.vn-train-price-choice:checked) {
    background: #eefaf8;
    border-color: #58bdb3;
    box-shadow: 0 0 0 2px rgba(88, 189, 179, 0.18);
}

.vn-train-price-amount {
    color: #1f4550;
    font-weight: 400;
    letter-spacing: 0;
    white-space: nowrap;
}

.vn-train-price-choice-label {
    align-items: center;
    background: #e7f6f4;
    border: 1px solid #9dd7d0;
    border-radius: 999px;
    color: var(--vn-primary);
    display: inline-flex;
    font-size: 12px;
    font-weight: 500;
    gap: 5px;
    justify-content: center;
    margin: 0;
    padding: 4px 8px;
    white-space: nowrap;
}

.vn-train-price-choice-label input {
    accent-color: var(--vn-primary);
    margin: 0;
}

.vn-price-continue-wrap {
    margin: 16px 0 22px;
    text-align: right;
}

.vn-price-continue {
    align-items: center;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.2);
    display: inline-flex;
    justify-content: center;
    padding: 12px 22px;
    text-decoration: none;
}

#vn-price-continue,
.entry-content #vn-price-continue,
.vn-train-price-search #vn-price-continue {
    background: var(--vn-primary) !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.2) !important;
    color: #fff !important;
    cursor: pointer;
    display: inline-flex !important;
    font-weight: 700 !important;
    justify-content: center;
    line-height: 1.3;
    min-height: 48px;
    padding: 12px 22px !important;
    text-align: center;
    text-decoration: none !important;
}

#vn-price-continue:hover,
.entry-content #vn-price-continue:hover,
.vn-train-price-search #vn-price-continue:hover {
    background: var(--vn-primary-dark) !important;
    color: #fff !important;
    text-decoration: none !important;
}

.vn-price-continue.is-disabled {
    background: #91a6ad;
    box-shadow: none;
    cursor: pointer;
    opacity: 0.95;
}

#vn-price-continue.is-disabled,
#vn-price-continue[aria-disabled="true"] {
    background: #91a6ad !important;
    box-shadow: none !important;
    opacity: 0.95;
}

.vn-form-is-submitting button[type="submit"],
.vn-form-is-submitting input[type="submit"],
.vn-link-is-submitting {
    cursor: wait !important;
    opacity: 0.75;
}

.vn-train-price-scroll-tools {
    align-items: center;
    color: #42636c;
    display: flex;
    gap: 8px;
    margin: 0 0 8px;
}

.vn-train-price-scroll-tools[hidden] {
    display: none !important;
}

.vn-train-price-scroll-tools span {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.vn-train-table-full-toggle {
    align-items: center;
    background: #f3f8fa;
    border: 1px solid #cfe1e8;
    border-radius: 9px;
    color: #38606b;
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    margin-top: 2px;
    padding: 0;
    width: 32px;
}

.vn-train-table-full-toggle:hover {
    background: #e7f2f5;
    color: var(--vn-primary);
}

.vn-train-table-capture {
    align-items: center;
    background: #0f766e;
    border: 1px solid #0f766e;
    border-radius: 9px;
    color: #fff;
    cursor: pointer;
    display: none;
    font-size: 13px;
    font-weight: 700;
    min-height: 32px;
    padding: 6px 10px;
}

.vn-train-price-matrix-wrapper.vn-train-table-scroll--full .vn-train-table-capture {
    display: inline-flex;
}

.vn-train-table-capture:hover {
    background: #115e59;
    color: #fff;
}

.vn-train-table-capture:disabled {
    cursor: wait;
    opacity: 0.78;
}

.vn-train-seat-availability-note {
    background: #f6fbfc;
    border: 1px solid #d9e8ee;
    border-radius: 12px;
    color: #36545d;
    margin: 14px 0 0;
    padding: 10px 12px;
}

.vn-train-table-full-toggle svg {
    height: 17px;
    width: 17px;
}

.vn-train-price-matrix-wrapper.vn-train-table-scroll--full {
    background: #fff;
    bottom: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    left: 20px;
    overflow: auto;
    padding: 18px;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 100000;
}

body.vn-train-table-full-open {
    overflow: hidden;
    touch-action: none;
}

body.vn-train-table-full-open .vn-train-price-matrix-wrapper.vn-train-table-scroll--full {
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 40px);
}

.vn-train-price-matrix-wrapper.vn-train-table-scroll--full .vn-train-price-scroll-tools {
    align-items: center;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    border: 1px solid #d7e3ea;
    border-radius: 12px;
    display: flex !important;
    left: 18px;
    margin: 0;
    padding: 8px;
    position: fixed;
    top: 18px;
    z-index: 100002;
}

.vn-train-price-matrix-wrapper.vn-train-table-scroll--full .vn-train-price-scroll-tools[hidden] {
    display: flex !important;
}

.vn-train-price-matrix-wrapper.vn-train-table-scroll--full table {
    min-width: 100%;
    margin-top: 54px;
}

@media (max-width: 900px) {
    .vn-train-price-search-row {
        grid-template-columns: 1fr;
    }

    .vn-price-continue-wrap {
        text-align: left;
    }

    .vn-train-time {
        white-space: normal;
    }

    .vn-train-price-cell {
        align-items: center;
    }
}

@media (max-width: 767px) {
    .vn-train-price-matrix-wrapper {
        overflow-x: auto;
    }

    .vn-train-price-scroll-tools {
        background: #fff;
        left: 0;
        max-width: calc(100vw - 44px);
        padding: 2px 8px 6px 0;
        position: sticky;
        top: 0;
        width: max-content;
        z-index: 3;
    }

    .vn-train-price-table {
        min-width: 0;
        width: auto;
    }

    .vn-train-price-table th,
    .vn-train-price-table td {
        padding: 7px 6px;
    }

    .vn-train-price-table thead th:not(:first-child),
    .vn-train-price-table tbody td {
        max-width: 112px;
        min-width: 92px;
        width: auto;
    }

    .vn-train-price-table thead th:first-child,
    .vn-train-price-table tbody th {
        max-width: 86px;
        min-width: 72px;
        width: 72px;
    }

    .vn-train-price-options {
        gap: 5px;
        min-width: 0;
    }

    .vn-train-price-cell {
        display: grid;
        gap: 4px;
        justify-items: start;
        min-width: 0;
        padding: 6px;
    }

    .vn-train-price-amount {
        font-size: 13px;
        line-height: 1.2;
        white-space: normal;
    }

    .vn-train-price-choice-label {
        font-size: 11px;
        padding: 3px 7px;
    }

    .vn-train-time {
        font-size: 10px;
        line-height: 1.15;
        margin-top: 2px;
        white-space: nowrap;
    }

    .vn-train-duration {
        color: #6b7280;
        display: block;
        font-size: 10px;
        font-weight: 500;
        line-height: 1.15;
        margin-top: 2px;
        white-space: nowrap;
    }

    .vn-train-seat-name {
        font-size: 12px;
        line-height: 1.25;
    }

    .vn-train-price-tier-note {
        font-size: 10px;
    }
}

@media (max-width: 640px) {
    .vn-train-price-search .vn-train-price {
        padding: 14px;
    }

    .vn-train-price-search h2 {
        font-size: 22px;
    }

    .vn-train-price-matrix-wrapper {
        border-radius: 12px;
    }

    .vn-price-continue {
        justify-content: center;
        width: 100%;
    }

    .vn-train-price-scroll-tools {
        align-items: flex-start;
    }

    .vn-train-price-matrix-wrapper.vn-train-table-scroll--full {
        bottom: 10px;
        left: 10px;
        padding: 12px;
        right: 10px;
        top: 10px;
    }

    .vn-train-price-matrix-wrapper.vn-train-table-scroll--full .vn-train-price-scroll-tools {
        left: 18px;
        max-width: calc(100vw - 36px);
        overflow-x: auto;
        top: 18px;
    }
}
