/* ==========================================================================
   WP LandingPage — CSS bổ sung

   ⚠️ File này nạp SAU ladi.css + ladi-layout.css nên nó THẮNG mọi xung đột.
   Vì vậy ở đây TUYỆT ĐỐI không đặt lại kiểu cho các thẻ chung (body, h1–h6, p,
   img, ul…). ladi.css đã có sẵn bộ reset đầy đủ, và ladi-layout.css định vị từng
   phần tử theo toạ độ pixel — chỉ cần một dòng `p { margin: 0 0 1em }` hay
   `img { height: auto }` ở đây là bố cục xô lệch hàng loạt.

   Đã từng dính đúng lỗi này: khai báo `body { font-family: … }` khiến font gốc
   (Cocon, SVN-Gotham) tải về nhưng không được áp dụng, làm sai lệch 2,8% pixel
   trên toàn trang.

   Chỉ đặt kiểu cho các class .wlp-* do theme tự thêm vào.
   ========================================================================== */

/* -------------------------------------------------- 1. Trợ năng nền tảng */

/* Tự định nghĩa thay vì dựa vào CSS lõi WordPress — nếu site gỡ wp-block-library
   thì các nhãn dành cho trình đọc màn hình sẽ hiện thành chữ thật giữa giao diện. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Viền focus rõ ràng cho người dùng bàn phím. Bản gốc LadiPage không có. */
.wlp-skip:focus-visible,
.ladi-form input:focus-visible,
.ladi-form select:focus-visible,
.ladi-form textarea:focus-visible,
a[data-action]:focus-visible,
.wlp-float__btn:focus-visible {
	outline: 3px solid #004AAD;
	outline-offset: 2px;
}

.wlp-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999999;
	padding: 12px 20px;
	background: #fff;
	color: #004AAD;
	font-weight: 700;
	text-decoration: none;
}

.wlp-skip:focus {
	left: 8px;
	top: 8px;
}

/* ------------------------------------------------- 1b. Thanh menu dính

   Bản gốc để JS đặt position:fixed cho SECTION11. Làm bằng JS thì khung hình
   ĐẦU TIÊN vẫn vẽ header trong luồng, đẩy mọi thứ xuống ~65px rồi mới nhảy lên
   — người dùng thấy logo bị nhân đôi trong khoảnh khắc đó. Đặt bằng CSS thì
   đúng ngay từ đầu, không nháy.

   Chiều cao lấy từ ladi-layout.css: 64.9163px (máy tính) / 74px (điện thoại).
   ------------------------------------------------------------------------ */
#SECTION11 {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 90000050;
}

/* Khối giữ chỗ, bù đúng phần header đã rời khỏi luồng tài liệu. */
.wlp-header-spacer { height: 64.9163px; }

@media (max-width: 767px) {
	.wlp-header-spacer { height: 74px; }
}

/* ---------------------------------------------- 1c. Hiệu ứng của bản gốc

   Keyframes nằm ở assets/css/ladi-keyframes.css (trích nguyên bản).
   Bản gốc gắn hiệu ứng qua JS; ở đây gắn thẳng bằng CSS cho chắc.
   `pulse` chạy vô hạn để hút mắt vào các nút kêu gọi hành động.
   ------------------------------------------------------------------------ */
#BUTTON19 > .ladi-button,
#BUTTON20 > .ladi-button,
#BUTTON29 > .ladi-button,
#BUTTON39 > .ladi-button,
#BUTTON9  > .ladi-button {
	animation: pulse 1.6s ease-in-out infinite;
	transform-origin: center center;
}

/* Dừng nhấp nháy khi người dùng đang tương tác — đỡ rối mắt lúc bấm. */
@media (hover: hover) {
	#BUTTON19:hover > .ladi-button,
	#BUTTON20:hover > .ladi-button,
	#BUTTON29:hover > .ladi-button,
	#BUTTON39:hover > .ladi-button,
	#BUTTON9:hover  > .ladi-button {
		animation-play-state: paused;
	}
}

/* Hiệu ứng xuất hiện cho các phần tử bản gốc đánh dấu chờ animation. */
@keyframes wlpFadeUp {
	from { opacity: 0; transform: translateY(18px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ------------------------------------------------------- 2. Form của theme */

/* Bẫy honeypot: ẩn khỏi mắt người và khỏi luồng bố cục, bot vẫn thấy trong HTML. */
.wlp-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wlp-form__message {
	margin: 10px 0 0;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.5;
	position: relative;
	z-index: 5;
}

.wlp-form__message.is-success {
	background: #e7f6ec;
	color: #16643a;
	border: 1px solid #a7dcbb;
}

.wlp-form__message.is-error {
	background: #fdecec;
	color: #a02222;
	border: 1px solid #f2b7b7;
}

.wlp-form.is-sending { opacity: .75; }
.wlp-form.is-sending .ladi-button { cursor: progress; }

/* Ô nhập sai: viền đỏ, không chỉ dựa vào màu mà còn có thông báo chữ kèm theo. */
.ladi-form [aria-invalid="true"] {
	outline: 2px solid #d63638;
	outline-offset: 1px;
}

/* --------------------------------------------------- 3. Nút liên hệ nổi */

.wlp-float {
	position: fixed;
	right: 12px;
	z-index: 90000090;
	display: flex;
	flex-direction: column;
	gap: 8px;
	/* Tránh thanh điều hướng của iPhone. */
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.wlp-float__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	/* Tối thiểu 44px — ngón tay cần vùng chạm đủ lớn. */
	min-height: 48px;
	padding: 10px 16px;
	border-radius: 999px;
	font-family: "Open Sans", system-ui, sans-serif;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	color: #fff;
	box-shadow: 0 6px 20px rgb(0 0 0 / .25);
}

.wlp-float__btn--call { background: #ED0973; }
.wlp-float__btn--zalo { background: #0068FF; justify-content: center; }

@media (hover: hover) {
	.wlp-float__btn:hover { filter: brightness(1.08); }
}

/* Màn hẹp chỉ hiện biểu tượng để không che nội dung. */
@media (max-width: 575px) {
	.wlp-float__label { display: none; }
	.wlp-float__btn--call { padding: 10px; }
}

/* ------------------------------------------------------ 4. Trang phụ (404) */

.wlp-simple {
	max-width: 640px;
	margin: 0 auto;
	padding: 64px 20px;
	text-align: center;
	font-family: "Open Sans", system-ui, sans-serif;
}

.wlp-simple h1 {
	margin-bottom: 16px;
	font-size: 28px;
	color: #004AAD;
}

.wlp-simple a {
	display: inline-block;
	margin-top: 20px;
	padding: 12px 28px;
	border-radius: 999px;
	background: #ED0973;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}
