/* Giao diện chung khổ ĐIỆN THOẠI (≤700px) cho các trang con — 01/11/2026.
 *
 * Anh Mừng: "ngoại trừ các trang hành trình đơn hàng, hãy check các trang còn lại
 * bản mobile có bố cục hợp lý và chuyên nghiệp, đồng bộ chưa". Bố cục từng trang
 * vẫn ổn; chỗ lệch là phần đầu trang: nền lá mờ, chữ thường, chú ếch to chiếm nửa
 * màn hình, trong khi trang chủ và trang Cửa hàng điện thoại (bản 0138) đã là xanh
 * một màu, chữ in hoa, ếch nhỏ bên phải. Bản đối xứng của giao-dien-mt.css:
 *   1. phần đầu trang con xanh #1A582C phẳng, gọn lại;
 *   2. ảnh ếch trong phần đầu thu còn 84px nằm bên phải chữ (như /san-pham/);
 *   3. h1 phần đầu chữ in hoa cùng cỡ trang Cửa hàng điện thoại;
 *   4. h2 in hoa của khuôn (tiêu đề khối, 13–15px giãn chữ rộng, đọc như dòng phụ)
 *      lên 18px bớt giãn chữ, gần cỡ tiêu đề khối trang chủ điện thoại (20px).
 * KHÔNG áp cho trang chủ, bài viết, trang một sản phẩm (kiểu app riêng), giỏ /
 * thanh toán / tra cứu đơn. Trang Cửa hàng có luật riêng ở cua-hang-dt.css.
 * Khuôn toàn style inline nên bám vị trí (<section> ngay sau <header>) và chuỗi
 * style — nhớ dt-khuon.js có thể viết lại style thành dạng có dấu cách (bắt cả hai).
 */

@media (max-width: 700px) {
	/* 1. Phần đầu xanh phẳng */
	body:not(.home):not(.single-post):not(.single-product) header + section[style*="background:#1A582C"],
	body:not(.home):not(.single-post):not(.single-product) header + section[style*="background:#23773C"] {
		background: #1A582C !important;
		border-top: 0 !important;
	}
	body:not(.home):not(.single-post):not(.single-product) header + section[style*="background:#1A582C"] > [style*="position:absolute"],
	body:not(.home):not(.single-post):not(.single-product) header + section[style*="background:#23773C"] > [style*="position:absolute"] {
		display: none !important;
	}
	body:not(.home):not(.single-post):not(.single-product) header + section[style*="background:#1A582C"] > div:not([style*="position:absolute"]),
	body:not(.home):not(.single-post):not(.single-product) header + section[style*="background:#23773C"] > div:not([style*="position:absolute"]) {
		padding: calc(22px * var(--r, 1)) 16px calc(24px * var(--r, 1)) !important;
	}

	/* 2. Ếch nhỏ bên phải chữ. Ba dạng khuôn: (a) Hướng dẫn, Cẩm nang — cột chữ +
	 * cột ảnh; (b) Liên hệ — <img> nằm thẳng trong khối, order:2; (c) Về Froga —
	 * lưới chữ + <img> tròn. Đổi cả ba về một hàng flex không xuống dòng. Bỏ qua
	 * phần đầu nền kem (Hành trình: ảnh là bản đồ, phải giữ to). */
	body:not(.home):not(.single-post):not(.single-product):not(.post-type-archive-product) header + section:not([style*="linear-gradient"]) > div:not([style*="position:absolute"]):has(img) {
		display: flex !important; flex-wrap: nowrap !important;
		align-items: flex-start !important; gap: 12px !important;
	}
	body:not(.home):not(.single-post):not(.single-product):not(.post-type-archive-product) header + section:not([style*="linear-gradient"]) > div:not([style*="position:absolute"]):has(img) > :not(img):not(:has(img)) {
		flex: 1 1 auto !important; min-width: 0;
	}
	body:not(.home):not(.single-post):not(.single-product):not(.post-type-archive-product) header + section:not([style*="linear-gradient"]) > div:not([style*="position:absolute"]):has(img) > div:has(img) {
		flex: 0 0 calc(84px * var(--r, 1)) !important; order: 2; margin-top: 6px;
	}
	body:not(.home):not(.single-post):not(.single-product):not(.post-type-archive-product) header + section:not([style*="linear-gradient"]) > div:not([style*="position:absolute"]):has(img) > div:has(img) img,
	body:not(.home):not(.single-post):not(.single-product):not(.post-type-archive-product) header + section:not([style*="linear-gradient"]) > div:not([style*="position:absolute"]):has(img) > img {
		width: calc(84px * var(--r, 1)) !important; max-width: none !important; height: auto !important;
		padding: 0 !important; margin: 6px 0 0 !important;
	}
	body:not(.home):not(.single-post):not(.single-product):not(.post-type-archive-product) header + section:not([style*="linear-gradient"]) > div:not([style*="position:absolute"]):has(img) > img {
		flex: 0 0 auto !important; order: 2;
	}

	/* 3. Tiêu đề trang in hoa (cả phần đầu nền kem của Hành trình) */
	body:not(.home):not(.single-post):not(.single-product) header + section h1 {
		text-transform: uppercase;
		font-size: calc(24px * var(--r, 1)) !important;
		line-height: 1.3 !important; /* rà soát 01/11: 1.15 thì dấu dòng dưới (Ụ, Á, Ầ) đâm vào chữ dòng trên */
		letter-spacing: .01em !important;
		text-wrap: balance;
	}
	/* Ba trang trụ (tru-cot.php): tiêu đề mục bị luật h2 chung của điện thoại kéo về ~13px, nhỏ hơn thân
	 * bài ~17px → ngược thứ bậc (rà soát 01/11) */
	h2[style*="font-size:clamp(17px,2.4vw,26px)"] { font-size: calc(19px * var(--r, 1)) !important; line-height: 1.3 !important; }
	/* <br> của khuôn ngắt theo bề ngang máy tính; cột chữ điện thoại hẹp hơn (có ếch
	 * bên phải) nên bỏ để trình duyệt chia dòng đều — trước ra "HƯỚNG DẪN SỬ / DỤNG".
	 * Khuôn viết liền "dụng<br>máy": theme.mjs (hauXuLy) chèn dấu cách trước <br> trong
	 * h1, không có thì ẩn <br> là dính chữ. (Mẹo br{content:""} br::after không ăn.) */
	body:not(.home):not(.single-post):not(.single-product) header + section h1 br { display: none; }

	/* 4. Tiêu đề khối in hoa của khuôn: to hơn, bớt giãn chữ */
	body:not(.home):not(.single-post):not(.single-product) h2[style*="text-transform:uppercase"],
	body:not(.home):not(.single-post):not(.single-product) h2[style*="text-transform: uppercase"] {
		font-size: calc(18px * var(--r, 1)) !important;
		letter-spacing: .02em !important;
		line-height: 1.25 !important;
	}
}

/* Trang Sản phẩm, điện thoại: bốn ô số liệu (3 sản phẩm · 24 tháng HSD · ≥99% · 3 KHÔNG) xếp một cột,
   mỗi ô cao ~105px, dài cả màn (anh 01/11/2026: "phần này gọn hơn") → lưới 2×2, ô thấp, chữ nhỏ lại. */
@media (max-width: 700px) {
	body.post-type-archive-product div[style*="minmax(215px"] {
		grid-template-columns: 1fr 1fr !important; gap: 10px !important; margin-top: 18px !important;
	}
	body.post-type-archive-product div[style*="minmax(215px"] > div {
		padding: 14px 10px 12px !important; border-radius: 14px !important;
	}
	body.post-type-archive-product div[style*="minmax(215px"] > div > div:nth-child(1) { font-size: calc(24px * var(--r, 1)) !important; }
	body.post-type-archive-product div[style*="minmax(215px"] > div > div:nth-child(2) { font-size: calc(12.5px * var(--r, 1)) !important; margin-top: 6px !important; }
	body.post-type-archive-product div[style*="minmax(215px"] > div > div:nth-child(3) { font-size: calc(11.5px * var(--r, 1)) !important; line-height: 1.4 !important; margin-top: 3px !important; }
}

/* Phần đầu ba trang Kế hoạch (717), Hướng dẫn (38), Cẩm nang (39) — điện thoại, 01/11/2026.
 * Bản đầu (ếch góc phải, nhãn một hàng, 4 bước thành thanh tiến độ) đã thay bằng bản theo thiết kế
 * "Froga Mobile - Trang nội dung" anh Mừng duyệt cùng ngày: xem nd-dt-ke-hoach.css, nd-dt-huong-dan.css,
 * nd-dt-cam-nang.css (nạp bởi nd-dt.php). Ở đây chỉ còn dải mục lục ngang trong thanh đầu trang Cẩm nang
 * (Hướng dẫn thay dải này bằng hàng viên chọn trong trang, nd-dt-huong-dan.js). */
@media (max-width: 700px) {
	/* — Dải mục lục ngang dưới thanh đầu trang: chữ đầu thẳng lề 16px, mờ dần mép phải báo còn cuộn */
	body.page-id-38 header .froga-cuon-mep,
	body.page-id-39 header .froga-cuon-mep {
		padding: 0 6px !important;
		-webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent);
	}
	body.page-id-38 header .froga-cuon-mep > a,
	body.page-id-39 header .froga-cuon-mep > a {
		padding: 11px 10px !important; font-size: 12.5px !important; gap: 6px !important;
	}
}
