/* ==========================================================================
   Mai Thu Packaging – main stylesheet
   Thiết kế gốc: Figma frame 1728px, nội dung rộng 1280px.
   ========================================================================== */

/* ---------- Fonts (self-hosted Inter variable) ---------- */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-vietnamese.woff2") format("woff2");
	unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
	--c-primary: #0066b3;
	--c-primary-700: #00559a;
	--c-primary-900: #00467b;
	--c-accent: #af2c2c;
	--c-text: #2c2c2c;
	--c-text-muted: rgba(44, 44, 44, 0.7);
	--c-gray-90: #1d2733;
	--c-gray-40: #aaaeb2;
	--c-gray-30: #c7c9cc;
	--c-line: #e3e6ea;
	--c-bg: #fff;
	--c-bg-soft: #eaf3ff;
	--c-orange: #f7941d;
	--c-orange-2: #ffa11e;
	--c-heading: #3a3a3a;
	--c-body: #4a4a4a;

	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	--container: 1280px;
	--gutter: clamp(16px, 4vw, 32px);
	--radius-sm: 8px;
	--radius: 16px;
	--radius-pill: 100px;
	--shadow-card: 0 4px 24px rgba(0, 40, 80, 0.08);

	--section-y: clamp(56px, 7vw, 96px);
	--header-h: 102px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--c-text);
	background: var(--c-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-primary); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.25; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.screen-reader-text {
	position: absolute !important;
	top: 0; left: 0;
	width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%);
	white-space: nowrap; border: 0;
}
.skip-link {
	position: absolute; left: 16px; top: -100px; z-index: 1000;
	padding: 12px 20px; background: var(--c-primary); color: #fff; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 16px; color: #fff; }

/* ---------- Layout ---------- */
.container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--soft { background: var(--c-bg-soft); }

.section--flush { padding-top: 0; }

.section-head { text-align: center; max-width: 724px; margin: 0 auto clamp(28px, 3vw, 40px); }
.section-head--wide { max-width: 1062px; }
.section-title {
	font-size: clamp(28px, 2.4vw + 6px, 40px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.6px;
	text-transform: uppercase;
	color: var(--c-heading);
	text-wrap: balance;
}
.section-sub { margin-top: 16px; color: var(--c-body); font-size: 16px; line-height: 24px; }
.section-cta { display: flex; justify-content: center; margin-top: 24px; }
.container--narrow { max-width: calc(900px + var(--gutter) * 2); }

/* Bố cục 2 cột (ảnh + chữ) */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.split + .split { margin-top: var(--section-y); }
.split__body { position: relative; display: flex; flex-direction: column; gap: 24px; padding-top: 24px; }
.split__body .section-title { margin-bottom: 16px; }
.split__text { display: grid; gap: 24px; font-size: 16px; line-height: 24px; color: var(--c-body); }
.split__text strong { color: var(--c-primary); }
.split--reverse { align-items: center; }
.split--reverse .split__body { padding-top: 0; }
@media (max-width: 991px) {
	.split { grid-template-columns: 1fr; gap: 32px; }
	.split--reverse .split__media { order: -1; }
	.split__body { padding-top: 0; }
}

.rounded-img { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }

/* Checklist with blue ✓ bullets */
.checklist { display: grid; gap: 8px; }
.checklist li {
	display: flex; align-items: center; gap: 16px;
	font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--c-gray-90);
}
.checklist li::before {
	content: "✓"; flex: 0 0 28px; height: 28px; margin-top: 2px;
	display: grid; place-items: center;
	border-radius: 50%; background: var(--c-primary); color: #fff;
	font-size: 15px; font-weight: 400; line-height: 1;
}

/* ---------- Icons ---------- */
.icon { display: inline-flex; flex-shrink: 0; line-height: 0; }
.icon svg { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	border: 1px solid transparent;
	border-radius: var(--radius-pill);
	font-weight: 700; line-height: 1.4; white-space: nowrap;
	transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn .icon svg { transition: transform .2s; }
.btn:hover .icon svg { transform: translateX(3px); }
.btn--md { padding: 12px 20px; font-size: 16px; }
.btn--lg { padding: 16px 20px; font-size: 18px; }
.btn--sm { padding: 8px 16px; font-size: 14px; }
.btn--sm .icon svg { width: 20px; height: 20px; }

.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-700); color: #fff; }
.btn--light { background: #fff; color: var(--c-primary); }
.btn--light:hover { background: var(--c-bg-soft); color: var(--c-primary); }
.btn--outline { border-color: var(--c-primary); color: var(--c-primary); background: transparent; }
.btn--outline:hover { background: var(--c-primary); color: #fff; }

.icon-btn {
	display: inline-grid; place-items: center;
	width: 40px; height: 40px; padding: 0;
	border: 0; border-radius: 50%; background: transparent;
	color: var(--c-primary); font-size: 28px; line-height: 1;
}
.icon-btn:hover { background: var(--c-bg-soft); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { position: relative; z-index: 50; padding-top: 16px; }
.has-hero .site-header { position: absolute; inset: 0 0 auto; }

/* Top bar: "Theo dõi" + social, language */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar__social,
.lang-switch__current {
	display: flex; align-items: center; gap: 8px;
	height: 40px; padding: 0 8px;
	border: 1px solid var(--c-line); border-radius: var(--radius-sm);
}
.has-hero .topbar__social,
.has-hero .lang-switch__current { border-color: #fff; color: #fff; }
.topbar__label { font-size: 16px; }

.social-links { display: flex; align-items: center; gap: 8px; }
.social-links a { display: block; transition: transform .2s; }
.social-links a:hover { transform: translateY(-2px); }

/* Language dropdown */
.lang-switch { position: relative; }
.lang-switch__current { background: transparent; font-size: 14px; font-weight: 700; }
.lang-switch__current .icon--caret-down { color: var(--c-accent); }
.lang-switch__current .icon--caret-down svg { width: 12px; height: 6px; transition: transform .2s; }
.lang-switch.is-open .icon--caret-down svg { transform: rotate(180deg); }
.lang-switch__list {
	position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; z-index: 60;
	padding: 6px; background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-card);
	opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .2s;
}
.lang-switch.is-open .lang-switch__list { opacity: 1; visibility: visible; transform: none; }
.lang-switch__list a {
	display: flex; align-items: center; gap: 10px; padding: 8px 10px;
	border-radius: 6px; font-size: 14px; color: var(--c-text);
}
.lang-switch__list a:hover,
.lang-switch__list a[aria-current] { background: var(--c-bg-soft); color: var(--c-primary); }
.flag svg { width: 24px; height: 24px; border-radius: 50%; }

/* Floating white nav card */
.masthead {
	max-width: calc(1330px + var(--gutter) * 2);
	margin: 16px auto 0;
	padding-inline: var(--gutter);
}
/* Ghim header khi cuộn (class do main.js gắn) */
.header-stuck .masthead {
	position: fixed; top: 12px; left: 0; right: 0; z-index: 80;
	animation: masthead-in .25s ease;
}
.no-hero.header-stuck .site-header { padding-bottom: var(--masthead-h, 118px); }
@keyframes masthead-in { from { transform: translateY(-100%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.masthead__inner {
	display: flex; align-items: center; justify-content: space-between; gap: 19px;
	min-height: var(--header-h);
	padding: 24px;
	background: #fff;
	border-radius: var(--radius);
	box-shadow: 0 6px 30px rgba(0, 51, 102, 0.12);
}
.brand img { width: 208px; height: auto; }
.masthead__actions { display: flex; align-items: center; gap: 16px; }

/* Primary nav (desktop) */
.primary-nav .menu { display: flex; align-items: center; gap: 8px; }
.primary-nav .menu > li { position: relative; display: flex; align-items: center; }
.primary-nav .menu > li > a {
	display: block; padding: 10px;
	font-size: 18px; font-weight: 700; line-height: 1.4; white-space: nowrap;
	color: var(--c-text);
}
.primary-nav .menu > li > a:hover,
.primary-nav .menu > .current-menu-item > a,
.primary-nav .menu > .current-menu-ancestor > a,
.primary-nav .menu > .current-menu-parent > a { color: var(--c-primary); }

.submenu-toggle {
	display: inline-grid; place-items: center;
	width: 24px; height: 24px; margin-left: -6px; padding: 0;
	border: 0; background: none; color: var(--c-text);
}
.submenu-toggle svg { transition: transform .2s; }

.primary-nav__head,
.primary-nav__foot { display: none; }

@media (min-width: 1200px) {
	.burger { display: none; }

	/* Mega menu căn theo thẻ menu trắng (không tràn cả màn hình) */
	.masthead__inner { position: relative; }

	/*
	 * Menu con cấp 1. Khi ẩn: không nhận chuột (pointer-events: none) để vùng vô hình
	 * không "bắt" hover và tự bật menu khi rê chuột qua banner.
	 */
	/* Dropdown nằm dưới thẻ menu trắng (cách mép thẻ 8px), giống panel mega */
	.primary-nav .menu > li > .sub-menu {
		--bridge: 44px;
		position: absolute; left: -10px; top: calc(100% + 36px); z-index: 60;
		min-width: 240px; padding: 10px;
		background: #fff; border-radius: 12px; box-shadow: var(--shadow-card);
		opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px);
		transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
	}
	/* Cầu nối vô hình: rê chuột từ mục menu xuống menu con không bị đóng giữa chừng */
	.primary-nav .menu > li > .sub-menu::before {
		content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: var(--bridge);
	}
	.primary-nav .menu > li:hover > .sub-menu,
	.primary-nav .menu > li:has(:focus-visible) > .sub-menu,
	.primary-nav .menu > li.is-open > .sub-menu {
		opacity: 1; visibility: visible; pointer-events: auto; transform: none;
		transition: opacity .18s ease, transform .18s ease, visibility 0s;
	}
	.primary-nav .menu > li:hover > .submenu-toggle svg,
	.primary-nav .menu > li.is-open > .submenu-toggle svg { transform: rotate(180deg); }

	.primary-nav .sub-menu a {
		display: block; padding: 8px 12px; border-radius: 6px;
		font-size: 15px; font-weight: 500; color: var(--c-text);
	}
	.primary-nav .sub-menu a:hover,
	.primary-nav .sub-menu .current-menu-item > a { background: var(--c-bg-soft); color: var(--c-primary); }
	.primary-nav .sub-menu .submenu-toggle { display: none; }

	/* Mega menu: Sản phẩm → các nhóm danh mục thành cột (Figma không có mũi tên ở mục này) */
	.primary-nav .menu > .menu-item--mega { position: static; }
	.primary-nav .menu > .menu-item--mega > .submenu-toggle { width: 0; margin: 0; overflow: hidden; }
	.primary-nav .menu > .menu-item--mega > .submenu-toggle:focus-visible { width: 24px; }
	/* Panel mega có overflow (cuộn) nên cầu nối đặt ở mục cha, chỉ tồn tại khi đang hover */
	.primary-nav .menu > .menu-item--mega:hover::after {
		content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 36px); height: 52px;
	}
	.primary-nav .menu > .menu-item--mega > .sub-menu {
		left: 0; right: 0; top: calc(100% + 8px);
		display: block; columns: 4; column-gap: 24px;
		padding: 28px 32px 20px;
		max-height: min(72vh, 640px); overflow-y: auto; overscroll-behavior: contain;
		border-radius: var(--radius);
	}
	.primary-nav .menu-item--mega > .sub-menu > li { display: block; break-inside: avoid; margin-bottom: 12px; }
	.primary-nav .menu-item--mega > .sub-menu > li > a {
		padding: 6px 12px; font-size: 15px; font-weight: 700; color: var(--c-primary); text-transform: uppercase;
	}
	/* Danh sách con trong mega: luôn theo trạng thái của panel cha (inherit), không tự hiện */
	.primary-nav .menu-item--mega .sub-menu .sub-menu {
		position: static; min-width: 0; padding: 0 0 8px;
		opacity: 1; visibility: inherit; pointer-events: inherit; transform: none; transition: none;
		background: none; box-shadow: none; border-radius: 0;
	}
	.primary-nav .menu-item--mega .sub-menu .sub-menu::before { display: none; }
	.primary-nav .menu-item--mega .sub-menu .sub-menu a { padding: 5px 12px; font-size: 14px; font-weight: 500; }
}

@media (min-width: 1200px) and (max-width: 1439px) {
	.masthead__inner { padding: 18px 20px; gap: 12px; }
	.brand img { width: 170px; }
	.primary-nav .menu { gap: 0; }
	.primary-nav .menu > li > a { font-size: 16px; padding: 10px 8px; }
}

/* Mobile / tablet: off-canvas drawer */
@media (max-width: 1199px) {
	:root { --header-h: 72px; }
	.masthead__inner { padding: 12px 16px; }
	.brand img { width: 150px; }
	.masthead__cta { display: none; }
	.topbar__label { display: none; }

	.burger { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
	.burger span { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }

	.primary-nav {
		position: fixed; inset: 0 0 0 auto; z-index: 100;
		width: min(380px, 88vw);
		display: flex; flex-direction: column;
		background: #fff; box-shadow: -10px 0 40px rgba(0, 0, 0, .15);
		transform: translateX(100%); visibility: hidden;
		transition: transform .3s ease, visibility 0s linear .3s;
		overflow-y: auto; overscroll-behavior: contain;
	}
	.nav-open .primary-nav { transform: none; visibility: visible; transition: transform .3s ease; }
	.primary-nav__head {
		display: flex; align-items: center; justify-content: space-between;
		padding: 16px 20px; border-bottom: 1px solid var(--c-line);
	}
	.primary-nav__foot { display: block; padding: 20px; margin-top: auto; }
	.primary-nav__foot .btn { width: 100%; }

	.primary-nav .menu { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 12px; }
	.primary-nav .menu li { flex-wrap: wrap; }
	.primary-nav .menu > li { border-bottom: 1px solid var(--c-line); }
	.primary-nav .menu > li > a { flex: 1; font-size: 17px; padding: 14px 8px; }
	.primary-nav .menu li > a { flex: 1; }
	.submenu-toggle { width: 44px; height: 44px; margin: 0; }
	.is-open > .submenu-toggle svg { transform: rotate(180deg); }

	.primary-nav .sub-menu { display: none; width: 100%; padding: 0 0 8px 12px; }
	.primary-nav .is-open > .sub-menu { display: block; }
	.primary-nav .sub-menu li { display: flex; align-items: center; }
	.primary-nav .sub-menu a { display: block; padding: 10px 8px; font-size: 15px; color: var(--c-text); }
	.primary-nav .sub-menu .sub-menu a { font-size: 14px; color: var(--c-text-muted); }

	.nav-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0, 20, 40, .45); }
	/* Menu trượt nằm trong header (z-index 50) -> khi mở phải nâng cả header lên trên backdrop,
	   nếu không backdrop đè lên menu và mọi lần chạm đều đóng menu. */
	.nav-open .site-header { z-index: 100; }
	.nav-open { overflow: hidden; }
}

/* Search panel */
.search-panel {
	max-width: 720px; margin: 12px auto 0; padding: 12px;
	background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.search-panel form { display: flex; gap: 8px; }
.search-panel input {
	flex: 1; min-width: 0; padding: 12px 16px;
	border: 1px solid var(--c-line); border-radius: var(--radius-pill); outline: none;
}
.search-panel input:focus { border-color: var(--c-primary); }

/* ==========================================================================
   Inner page banner + breadcrumbs
   ========================================================================== */
/* Banner xanh đầu trang con (Figma: cao 462px, header nằm đè lên, hoa văn 10%) */
.page-banner {
	position: relative; isolation: isolate;
	min-height: clamp(300px, 26.7vw, 462px);
	display: flex; align-items: flex-end;
	padding: clamp(190px, 15.6vw, 270px) 0 clamp(48px, 5.5vw, 96px);
	background: var(--c-primary);
	color: #fff; text-align: center;
}
.page-banner::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: url("../img/pattern.webp") left top / auto 100% repeat-x; opacity: .1;
}
.page-banner .container { display: flex; flex-direction: column; gap: 24px; }
.page-banner__title {
	font-size: clamp(28px, 2.4vw + 6px, 40px); font-weight: 700; line-height: 1.2;
	letter-spacing: -0.6px; text-transform: uppercase; text-wrap: balance;
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 16px; line-height: 24px; }
.breadcrumbs li + li::before { content: "•"; margin-right: 6px; opacity: .8; }
.breadcrumbs a { opacity: .85; }
.breadcrumbs a:hover { color: inherit; opacity: 1; text-decoration: underline; }

/* ==========================================================================
   Rich text (bài viết, mô tả sản phẩm)
   ========================================================================== */
.prose { font-size: 16px; line-height: 1.7; color: var(--c-text); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: clamp(22px, 2vw, 28px); margin-top: 1.6em; text-transform: uppercase; }
.prose h3 { font-size: 20px; margin-top: 1.4em; }
.prose h4 { font-size: 18px; margin-top: 1.2em; }
.prose ul { list-style: disc; padding-left: 1.4em; }
.prose ol { list-style: decimal; padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--c-primary); text-decoration: underline; }
.prose img { border-radius: var(--radius-sm); height: auto; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { font-size: 14px; color: var(--c-text-muted); text-align: center; margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--c-line); padding: 10px 12px; text-align: left; }
.prose blockquote { margin: 1.5em 0; padding: 12px 20px; border-left: 4px solid var(--c-primary); background: var(--c-bg-soft); }
.prose .alignleft { float: left; margin: 0 1.5em 1em 0; }
.prose .alignright { float: right; margin: 0 0 1em 1.5em; }
.prose .aligncenter { margin-inline: auto; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
	position: relative;
	padding: 96px 0 40px;
	color: #fff;
	background: var(--c-primary-900) url("../img/footer-bg.webp") center / cover no-repeat;
	isolation: isolate;
}
.site-footer::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 70, 123, 0.9); }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.site-footer__grid {
	display: grid;
	grid-template-columns: 302px repeat(3, minmax(0, 302px));
	justify-content: space-between;
	gap: 40px 24px;
}
.site-footer__logo img { width: 232px; }
.site-footer__brand p { margin: 20px 0 12px; line-height: 1.5; }
.site-footer__fanpage { display: block; width: 300px; max-width: 100%; border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 4px rgba(0, 0, 0, .25); }
.site-footer__fanpage img { width: 100%; height: auto; }

.footer-title {
	padding-left: 12px; border-left: 1px solid #fff;
	font-size: 24px; font-weight: 600; line-height: 1.4;
	margin-bottom: 24px;
}
.footer-list + .footer-title { margin-top: 40px; }
.footer-links, .footer-list { display: grid; gap: 10px; line-height: 1.4; }
.footer-list--loose { gap: 16px; }

.site-footer__bottom {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
	margin-top: 32px; padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, .5);
	line-height: 24px;
}
.site-footer__bottom a { margin-left: 4px; }

@media (max-width: 1199px) {
	.site-footer { padding-top: 64px; }
	.site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.site-footer__grid { grid-template-columns: 1fr; }
	.footer-title { font-size: 20px; margin-bottom: 16px; }
}

/* ==========================================================================
   Shared sections
   ========================================================================== */

/* ---------- Tại sao chọn Mai Thư ---------- */
.why-us {
	position: relative; isolation: isolate; color: #fff;
	background: var(--c-primary-900) url("../img/why-bg.webp") center / cover no-repeat;
}
.why-us::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 80, 140, 0.89); }
.why-us .section-title,
.why-us .section-sub { color: #fff; }
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.why-card {
	display: flex; flex-direction: column; gap: 8px;
	min-height: 308px; padding: 32px;
	background: #fff; color: var(--c-gray-90);
	border: 1px solid transparent; border-radius: var(--radius);
	transition: transform .25s, box-shadow .25s;
}
.why-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, .18); }
.why-card__icon { margin-bottom: 16px; }
.why-card__icon svg { width: 56px; height: 56px; }
.why-card__title { font-size: 24px; font-weight: 600; line-height: 1.4; }
.why-card__text { font-size: 16px; line-height: 1.4; }
.why-card__text strong { color: var(--c-primary); font-weight: 400; }
.why-card--accent {
	position: relative; isolation: isolate;
	background: var(--c-orange); border-color: var(--c-primary); color: #fff;
}
.why-card--accent::after {
	content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
	background: url("../img/pattern.webp") center / cover; opacity: .12;
}
.why-card--accent .why-card__text strong { color: #fff; font-weight: 700; }

@media (max-width: 991px) {
	.why-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
	.why-card { min-height: 0; }
}

/* ---------- Carousel (scroll-snap + small JS for arrows/autoplay) ---------- */
.carousel { position: relative; }
.carousel__track {
	display: flex; gap: 24px;
	overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scroll-behavior: smooth;
	scrollbar-width: none;
	padding-inline: calc(50% - var(--slide-w) / 2);
	/* điểm bắt dính lệch phải --snap-shift (khớp với offsetFor trong main.js) */
	scroll-padding-left: calc(var(--snap-shift, 0px) * 2);
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__slide { position: relative; flex: 0 0 var(--slide-w); scroll-snap-align: center; }
.carousel__arrow {
	position: absolute; top: 50%; z-index: 2;
	display: grid; place-items: center;
	width: 32px; height: 32px; padding: 0; margin-top: -16px;
	border: 0; border-radius: 50%; background: var(--c-primary); color: #fff;
	box-shadow: 0 2px 8px rgba(0, 51, 102, .25);
	transition: background .2s, transform .2s;
}
.carousel__arrow:hover { background: var(--c-primary-900); transform: scale(1.08); }
.carousel__arrow .icon, .carousel__arrow svg { display: block; width: 20px; height: 20px; }
/* Mặc định: mũi tên nằm ở khe giữa thẻ trung tâm và thẻ bên cạnh */
.carousel__arrow--prev { left: calc(50% - var(--slide-w) / 2 - 28px); }
.carousel__arrow--prev svg { transform: rotate(90deg); }
.carousel__arrow--next { right: calc(50% - var(--slide-w) / 2 - 28px); }
.carousel__arrow--next svg { transform: rotate(-90deg); }

/* ---------- Bìa catalogue (trang chủ, E-Catalogue) ---------- */
.catalogue-card {
	display: block; overflow: hidden; border-radius: var(--radius);
	aspect-ratio: 302 / 427; background: #dbe8f7;
	box-shadow: 0 8px 24px rgba(0, 51, 102, .08);
}
.catalogue-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.catalogue-card:hover img { transform: scale(1.04); }

/* ---------- Stat boxes ---------- */
.stat-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0; }
.stat-box {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	min-height: 200px; padding: 24px; text-align: center;
	background: rgba(255, 255, 255, .85); border: 1px solid var(--c-primary); border-radius: var(--radius);
}
.stat-box dt { font-size: clamp(36px, 2.5vw + 8px, 48px); font-weight: 700; line-height: 1.2; color: var(--c-primary); }
.stat-box dd { margin: 10px 0 0; font-size: 18px; font-weight: 500; line-height: 1.4; color: var(--c-body); }
@media (max-width: 991px) {
	.stat-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.stat-box { min-height: 150px; }
}

/* ---------- Certification logos ---------- */
.cert-logos {
	display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center;
	gap: 24px 48px; max-width: 1690px; margin: 0 auto; padding-inline: var(--gutter);
}
.cert-logos img { height: 150px; width: auto; object-fit: contain; }
@media (max-width: 1600px) { .cert-logos { gap: 24px 36px; } .cert-logos img { height: 110px; } }
@media (max-width: 767px) { .cert-logos { gap: 16px 24px; } .cert-logos img { height: 64px; } }

/* Dải logo chạy liên tục (trang chủ): 4 bản danh sách nối nhau, trượt đúng nửa track rồi lặp lại */
.cert-marquee {
	--marquee-gap: 64px;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.cert-marquee__track { display: flex; width: max-content; animation: cert-marquee 50s linear infinite; }
.cert-marquee:hover .cert-marquee__track { animation-play-state: paused; }
.cert-marquee .cert-logos {
	flex: none; flex-wrap: nowrap; align-items: center; justify-content: flex-start;
	gap: var(--marquee-gap); max-width: none; margin: 0; padding: 0 var(--marquee-gap) 0 0;
}
@keyframes cert-marquee { to { transform: translateX(-50%); } }
@media (max-width: 1600px) { .cert-marquee { --marquee-gap: 48px; } }
@media (max-width: 767px) { .cert-marquee { --marquee-gap: 32px; } .cert-marquee__track { animation-duration: 28s; } }
@media (prefers-reduced-motion: reduce) {
	.cert-marquee { -webkit-mask-image: none; mask-image: none; }
	.cert-marquee__track { animation: none; width: auto; justify-content: center; }
	.cert-marquee .cert-logos { flex-wrap: wrap; justify-content: center; padding: 0 var(--gutter); }
	.cert-marquee .cert-logos[aria-hidden] { display: none; }
}

/* ---------- Liên hệ ngay để được tư vấn ---------- */
.contact-cta { position: relative; overflow: hidden; background: #f7f7fa; }
.contact-cta__form .cf { max-width: 610px; }
.contact-cta .section-title { margin-bottom: 40px; }
@media (min-width: 1280px) { .contact-cta .section-title { white-space: nowrap; } }
.contact-cta__image {
	position: absolute; right: 0; top: calc(var(--section-y) + 102px);
	width: min(852px, calc(50% - 16px)); height: auto; pointer-events: none;
}
@media (max-width: 991px) {
	.contact-cta__form { max-width: none; }
	.contact-cta__image { position: static; width: 100%; margin-top: 40px; }
}

/* ---------- Form (Contact Form 7, class "cf") ---------- */
.cf { display: grid; gap: 24px; }
.cf p { margin: 0; }
.cf fieldset.hidden-fields-container { display: none; }
.cf__row { display: grid; gap: 24px 32px; }
.cf__row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf__field { display: flex; flex-direction: column; gap: 8px; }
.cf__label { font-size: 16px; font-weight: 500; line-height: 28px; color: #00080c; }
.cf__label em { font-style: normal; color: #d80027; }
.cf .wpcf7-form-control-wrap { display: block; }
.cf input[type="text"],
.cf input[type="email"],
.cf input[type="tel"],
.cf textarea,
.cf select {
	width: 100%; height: 48px; padding: 0 10px;
	border: 0; border-bottom: 1px solid #dddde5; border-radius: var(--radius-sm);
	background: #fff; font-size: 16px; letter-spacing: -0.32px; color: #050529;
	outline: none; transition: border-color .2s, box-shadow .2s;
}
.cf textarea { height: 120px; min-height: 84px; padding: 10px; line-height: 24px; resize: vertical; }
.cf ::placeholder { color: #88889e; }
.cf input:focus, .cf textarea:focus, .cf select:focus { border-bottom-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0, 102, 179, .12); }

.cf__phone {
	display: flex; align-items: center; height: 48px; padding-left: 10px;
	background: #fff; border-bottom: 1px solid #dddde5; border-radius: var(--radius-sm);
}
.cf__phone:focus-within { border-bottom-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0, 102, 179, .12); }
.cf__phone .wpcf7-form-control-wrap { flex: 0 0 auto; }
.cf__phone .wpcf7-form-control-wrap:last-child { flex: 1; min-width: 0; }
.cf__phone input[type="tel"],
.cf__phone select { height: 46px; border: 0; box-shadow: none !important; background-color: transparent; }
.cf__flag { flex: 0 0 24px; width: 24px; height: 18px; margin-right: 6px; background: url("../icons/flag-vn-rect.svg") center / 24px 24px no-repeat; }
.cf__flag[data-cc]:not([data-cc="+84"]) { display: none; }
.cf__phone select.cf__cc {
	width: auto; padding: 0 22px 0 0; font-weight: 600; cursor: pointer;
	appearance: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23050529' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E") right center no-repeat;
}
.cf__phone input[type="tel"] { padding-left: 8px; }
.cf__actions { display: flex; }
.cf .wpcf7-submit {
	height: auto; border: 0; cursor: pointer;
	padding: 12px 20px; font-size: 18px; font-weight: 500;
	padding-right: 54px;
	background: var(--c-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 19l7-7-7-7'/%3E%3C/svg%3E") right 20px center no-repeat;
}
.cf .wpcf7-spinner { margin: auto 12px; }
.cf .wpcf7-not-valid-tip { display: block; margin-top: 6px; font-size: 14px; color: #d80027; }
.cf .wpcf7-not-valid { border-bottom-color: #d80027 !important; }
.wpcf7 form .wpcf7-response-output {
	margin: 0; padding: 12px 16px; border-radius: var(--radius-sm);
	border: 1px solid var(--c-primary); background: var(--c-bg-soft); font-size: 15px;
}
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output { border-color: #d80027; background: #fff3f4; }
.wpcf7 form.init .wpcf7-response-output,
.wpcf7 form.resetting .wpcf7-response-output,
.wpcf7 form.submitting .wpcf7-response-output { display: none; }
.screen-reader-response { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 640px) { .cf__row--2 { grid-template-columns: 1fr; } }

/* ---------- Video popup ---------- */
.video-dialog { width: min(1100px, 92vw); padding: 0; border: 0; background: transparent; overflow: visible; }
.video-dialog::backdrop { background: rgba(0, 10, 25, .8); }
.video-dialog__frame { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-dialog__frame iframe { width: 100%; height: 100%; border: 0; }
.video-dialog__close { position: absolute; right: -8px; top: -48px; width: 40px; height: 40px; border: 0; background: none; color: #fff; font-size: 36px; line-height: 1; }
