/*
 * Lớp điều chỉnh để CSS cũ (base.css, pages/*.css) chạy trên khung GeneratePress.
 * Nạp sau cùng.
 */

/* Bootstrap reboot (site cũ dựa vào): mọi phần tử tính kích thước gồm cả padding. */
*,
*::before,
*::after {
	box-sizing: border-box;
}

a {
	text-decoration: none;
}

body {
	font-size: 16px;
	line-height: 1.65;
	font-family: 'Open Sans', Arial, Helvetica, sans-serif;
}

/* Ô nhập, nút bấm, form… dùng chung font với trang (GP và Fluent Forms mặc định dùng font hệ thống). */
button,
input,
select,
textarea,
.fluentform,
.fluentform .ff-el-form-control,
.fluentform .ff-btn,
.ff-default .ff-el-form-control,
.ff-default .ff-btn {
	font-family: inherit;
}

/* ---------- Khung trang ---------- */

/* GP gắn class "container" cho #page; CSS cũ có .container riêng. */
#page.container {
	width: 100%;
	max-width: none;
	padding: 0;
}

.mt-block-page .site-content,
.mt-block-page .inside-article {
	padding: 0 !important;
}

.mt-block-page .site-main {
	margin: 0 !important;
}

.mt-block-page .entry-content:not(:first-child),
.mt-block-page .entry-content {
	margin-top: 0;
}

.mt-block-page .site-main > article {
	margin-bottom: 0;
}

/* Trang tin, chuyên mục: giữ khung có lề như các container của site cũ. */
body:not(.mt-block-page) #page.container {
	width: calc(100% - 72px);
	max-width: 1280px;
	padding: 0 15px;
}

/* Chữ đậm đứng riêng được bọc trong text block: bỏ hộp bọc khỏi bố cục. */
.gb-text.mt-inline-wrap {
	display: contents;
}

/* GP tô nền xám cho a.button; site cũ dùng .btn-* để tô màu. */
a.button {
	background-color: transparent;
	color: inherit;
}

a.button.btn-primary,
a.button.primary {
	background-color: var(--primary);
	color: #fff;
}

a.button.btn-primary:hover,
a.button.primary:hover {
	background-color: var(--primary-dark);
	color: #fff;
}

a.button.btn-danger,
a.button.red,
a.button.btn-red {
	background-color: var(--secondary);
	color: #fff;
}

a.button.btn-danger:hover,
a.button.red:hover,
a.button.btn-red:hover {
	background-color: #c81d22;
	color: #fff;
}

a.button.btn-blue {
	background-color: var(--primary);
	color: #fff;
}

/* Site cũ: .button không có display riêng (hiển thị inline), trừ khi kèm .btn. */
.button:not(.btn) {
	display: inline;
}

/* ---------- Topbar ---------- */

.mt-topbar__left > div,
.mt-topbar__left > div > *,
.mt-topbar__right > * {
	display: inline-block;
}

.mt-topbar a {
	color: #fff;
}

.mt-topbar a:hover {
	color: #ffd9da;
}

/* ---------- Header + menu ---------- */

.site-header {
	border-top: 2px solid #123d72;
	border-bottom: 1px solid #e5e5e5;
}

.site-header .inside-header {
	width: calc(100% - 72px);
	max-width: 1280px;
	min-height: 70px;
	padding: 0 15px;
	margin: 0 auto;
	box-sizing: border-box;
}

.site-header .site-logo,
.site-header .site-branding {
	margin-right: 35px;
}

.site-header .header-image {
	display: block;
	max-width: 180px;
	height: auto;
}

@media (min-width: 1200px) {
	.site-header .main-navigation {
		flex: 1 1 auto;
		margin-left: 0;
	}

	.site-header .main-navigation .inside-navigation {
		justify-content: flex-start;
	}

	.site-header .main-navigation .main-nav {
		flex: 1 1 auto;
	}

	.site-header .main-navigation .main-nav > ul {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		width: 100%;
	}

	.main-navigation .main-nav > ul > li {
		margin-right: 20px;
	}

	.main-navigation .main-nav > ul > li:last-child {
		margin-right: 0;
		margin-left: auto;
	}

	.main-navigation .main-nav > ul > li > a {
		padding: 0;
		line-height: 70px;
		font-size: 14px;
		font-weight: 700;
		text-transform: uppercase;
		white-space: nowrap;
	}

	.main-navigation .main-nav > ul > li.menu-item-has-children > a {
		padding-right: 0;
	}

	/* Không hiện mũi tên dropdown trên desktop (site cũ không có). */
	.main-navigation .main-nav > ul > li > a .dropdown-menu-toggle {
		display: none;
	}

	/* Nút "Yêu cầu báo giá" cuối menu. */
	.main-navigation .main-nav > ul > li.mt-menu-cta > a {
		line-height: 1.5;
		padding: 10px 20px;
		border-radius: 5px;
		background: var(--secondary);
		color: #fff;
	}

	.main-navigation .main-nav > ul > li.mt-menu-cta > a:hover {
		background: #c81d22;
		color: #fff;
	}

	/* Dropdown giống .submenu cũ. */
	.main-navigation ul ul {
		width: 370px;
		max-width: calc(100vw - 24px);
		padding: 10px;
		background: #fff;
		border: 1px solid #a9c8ec;
		border-top: 3px solid #064a98;
		border-radius: 6px;
		box-shadow: 0 15px 35px rgba(0, 45, 90, .12);
		top: calc(100% - 1px);
	}

	.main-navigation:not(.toggled) .main-nav > ul > li:hover > ul,
	.main-navigation:not(.toggled) .main-nav > ul > li.sfHover > ul {
		left: 50%;
		transform: translateX(-50%);
	}

	.main-navigation .main-nav ul ul li a {
		display: flex;
		align-items: center;
		min-height: 55px;
		padding: 8px 14px;
		font-size: 17px;
		font-weight: 600;
		line-height: 1.3;
		color: #263c57;
		border-radius: 5px;
		text-transform: none;
	}

	.main-navigation .main-nav ul ul li a:hover {
		color: #064a98;
		background: #f0f6fd;
	}
}

/* Mobile: menu xổ xuống dưới header. */
@media (max-width: 1199px) {
	.site-header .inside-header {
		width: 100%;
		padding: 0 15px;
	}

	.site-header .header-image {
		max-width: 160px;
	}

	.main-navigation .main-nav > ul > li {
		border-bottom: 1px solid #edf1f5;
	}

	.main-navigation .main-nav > ul > li > a {
		min-height: 52px;
		display: flex;
		align-items: center;
		padding: 12px 5px;
		font-size: 16px;
		font-weight: 700;
		line-height: 1.3;
		text-transform: uppercase;
	}

	.main-navigation .main-nav ul ul li a {
		min-height: 48px;
		padding: 12px 5px 12px 20px;
		font-size: 15px;
		font-weight: 600;
		color: #263c57;
	}

	.main-navigation .main-nav > ul > li.mt-menu-cta {
		border-bottom: 0;
		padding: 12px 0;
	}

	.main-navigation .main-nav > ul > li.mt-menu-cta > a {
		justify-content: center;
		background: var(--secondary);
		color: #fff;
		border-radius: 5px;
	}

	.main-navigation.toggled .main-nav {
		padding: 0 15px;
		box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
	}
}

/* ---------- Footer (Block Element) ---------- */

.site-footer .site-info {
	display: none;
}


/* ---------- Ô chèn form ---------- */

/* Trên site: ẩn cho đến khi chèn form thật. */
.mt-form-slot {
	display: none;
}

/* Khi đã có form bên trong thì hiện. */
.mt-form-slot:has(form) {
	display: block;
}

.mt-form-slot:has(form) .mt-form-slot__note {
	display: none;
}

/* ---------- Khối "Xem thêm" (core/details) ---------- */

.read-more > summary::-webkit-details-marker {
	display: none;
}

.read-more > summary::after {
	content: '';
	flex: none;
	width: 8px;
	height: 8px;
	margin-right: 4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-3px);
	transition: transform .2s;
}

.read-more[open] > summary::after {
	transform: rotate(-135deg) translateY(-3px);
}

/* ---------- Trang Dịch vụ: thẻ dịch vụ lấy tự động ---------- */

/* Số thứ tự 3.2, 3.3… như site cũ (3.1 là phần tổng quan). */
.mt-svc-grid {
	counter-reset: mt-svc 1;
}

.mt-svc-grid > .gb-loop-item {
	counter-increment: mt-svc;
}

.mt-svc-grid .svc-ribbon::before {
	content: '3.' counter(mt-svc);
}

/* Thẻ cuối cùng (lẻ) chiếm cả hàng. */
@media (min-width: 992px) {
	.mt-svc-grid > .col-lg-6:last-child:nth-child(odd) {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/* ---------- Tuyển dụng ---------- */

.job-card .job-status {
	display: inline-block;
	margin-bottom: 8px;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	background: #e7f6ec;
	color: #1e7a3c;
}

.job-card[data-status="is-closed"] .job-status {
	background: #fdecec;
	color: var(--secondary);
}

.job-card[data-status="is-closed"] .mt-job-apply {
	display: none;
}

.job-card h3 a {
	color: inherit;
}

/* ---------- Điện thoại ---------- */

.mt-topbar__left,
.mt-topbar__right {
	white-space: nowrap;
}

@media (max-width: 575px) {
	.mt-topbar .container {
		width: 100%;
		flex-direction: column;
		align-items: flex-start;
	}
}

.site-header .menu-toggle,
.site-header .mobile-menu-control-wrapper {
	background: transparent;
}

.site-header .menu-toggle {
	color: #123d72;
	padding: 0 0 0 12px;
	line-height: 70px;
}

@media (max-width: 1199px) {
	/* Mũi tên mở menu con nằm sát phải như site cũ. */
	.main-navigation .main-nav > ul > li > a .dropdown-menu-toggle {
		margin-left: auto;
	}
}

/* ---------- Fluent Forms (giống .quote-form của site cũ) ---------- */

.mt-form-slot .fluentform form {
	background: #fff;
	border: 1px solid #bcd3ee;
	border-radius: 5px;
	padding: 20px;
}

.mt-form-slot .fluentform .ff-el-group {
	margin-bottom: 16px;
}

.mt-form-slot .fluentform .ff-el-input--label label {
	font-size: 15px;
	font-weight: 600;
	color: var(--ink);
}

.mt-form-slot .fluentform .ff-el-is-required.asterisk-right label::after {
	color: var(--secondary);
}

.mt-form-slot .fluentform .ff-el-form-control {
	height: 44px;
	border: 1px solid #d8e1ec;
	border-radius: 0;
	font-size: 14px;
	color: var(--ink);
}

.mt-form-slot .fluentform textarea.ff-el-form-control {
	height: auto;
}

.mt-form-slot .fluentform .ff-el-form-control::placeholder,
.mt-form-slot .fluentform select.ff-el-form-control {
	font-size: 12px;
	text-transform: uppercase;
}

.mt-form-slot .fluentform .ff-el-form-control:focus {
	border-color: #8eb4df;
	box-shadow: 0 0 0 .2rem rgba(13, 79, 156, .12);
}

.mt-form-slot .fluentform .ff-el-help-message {
	font-size: 13px;
	color: var(--muted);
	font-style: normal;
}

/* Ô tải tệp: khung gạch đứt như site cũ. */
.mt-form-slot .fluentform .ff_file_upload_holder {
	min-height: 60px;
	padding: 12px 15px;
	border: 1px dashed #b5c8df;
	border-radius: 3px;
	background: #fff;
}

.mt-form-slot .fluentform .ff_upload_btn.ff-btn {
	background: var(--pale);
	color: var(--primary);
	border: 1px solid #bcd3ee;
	border-radius: 3px;
	font-size: 13px;
	font-weight: 700;
}

.mt-form-slot .fluentform .ff-el-tc label {
	font-weight: 400;
	font-size: 14px;
}

/* Nút gửi: đỏ, chữ in hoa, rộng hết khung. */
.mt-form-slot .fluentform .ff-btn-submit.mt-ff-submit,
.mt-form-slot .fluentform .ff_submit_btn_wrapper .ff-btn-submit {
	width: 100%;
	min-height: 46px;
	background: #ed1c24;
	border: 0;
	border-radius: 4px;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
}

.mt-form-slot .fluentform .ff-btn-submit:hover {
	background: #bd171f;
	opacity: 1;
}

.mt-form-slot .ff-message-success {
	border: 1px solid #bcd3ee;
	border-left: 4px solid var(--primary);
	background: var(--pale);
	box-shadow: none;
	color: var(--ink);
	padding: 18px 20px;
}

/* Liên hệ – mũi tên "Cơ chế phân tuyến": khi xoay dọc (dưới 992px) phải thu hẹp lại,
   nếu không khối xoay đè lên form phía trên (lỗi có sẵn từ site cũ). */
.contact-ref .route-arrow {
	pointer-events: none;
}

@media (max-width: 991.98px) {
	.contact-ref .route-arrow {
		width: 28px;
		justify-self: center;
	}
}

/* Menu ngang: màn 1200–1279px thu hẹp khoảng cách để vừa một hàng
   (site cũ bị tràn menu ở khổ này). Dưới 1200px dùng menu thu gọn. */
@media (min-width: 1200px) and (max-width: 1279.98px) {
	.main-navigation .main-nav > ul > li {
		margin-right: 14px;
	}

	.site-header .site-logo,
	.site-header .site-branding {
		margin-right: 24px;
	}
}
