/**
 * BASE + LAYOUT SHELL — Gợi Ý Tốt
 *
 * Phase 0 chỉ dựng khung: reset, container, header, footer, CTA, disclosure.
 * Component của từng loại trang sẽ thêm ở Phase 1 theo mockup đã duyệt.
 */

/* ---------------------------------------------------------------- */
/* Reset tối thiểu                                                   */
/* ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	font-family: var(--gyt-font);
	font-size: var(--gyt-text-base);
	line-height: var(--gyt-leading);
	color: var(--gyt-text);
	background: var(--gyt-bg-page);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	margin: 0 0 var(--gyt-space-3);
	line-height: var(--gyt-leading-tight);
	font-weight: 700;
	color: var(--gyt-text);
}

h1 { font-size: var(--gyt-text-4xl); letter-spacing: -.02em; }
h2 { font-size: var(--gyt-text-2xl); }
h3 { font-size: var(--gyt-text-lg); }

p { margin: 0 0 var(--gyt-space-4); }

a { color: var(--gyt-brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Ảnh KHÔNG BAO GIỜ được gây CLS — luôn giữ tỉ lệ */
img { max-width: 100%; height: auto; display: block; }

ul, ol { margin: 0 0 var(--gyt-space-4); padding-left: 1.25em; }

table { border-collapse: collapse; width: 100%; }

button { font: inherit; }

/* Chỉ hiện cho trình đọc màn hình */
.gyt-sr-only {
	position: absolute; width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible {
	outline: 2px solid var(--gyt-brand);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- */
/* Bố cục                                                            */
/* ---------------------------------------------------------------- */
.gyt-container {
	width: 100%;
	max-width: var(--gyt-container);
	margin-inline: auto;
	padding-inline: var(--gyt-gutter);
}

.gyt-section { padding-block: var(--gyt-space-10); }
.gyt-section--tint { background: var(--gyt-bg-section); }

.gyt-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--gyt-space-4);
	margin-bottom: var(--gyt-space-5);
}

.gyt-section__title { margin: 0; font-size: var(--gyt-text-xl); }

/* Bố cục 2 cột: nội dung chính + sidebar dính (Product Review §24) */
.gyt-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--gyt-sidebar);
	gap: var(--gyt-space-8);
	align-items: start;
}

.gyt-layout__sidebar { position: sticky; top: var(--gyt-space-4); }

@media (max-width: 1024px) {
	.gyt-layout { grid-template-columns: minmax(0, 1fr); }
	.gyt-layout__sidebar { position: static; }
}

/* ---------------------------------------------------------------- */
/* Header                                                            */
/* ---------------------------------------------------------------- */
/**
 * HEADER và NỘI DUNG là HAI PANEL TRẮNG RIÊNG, nổi trên nền xanh nhạt.
 *
 * Mockup tách hai phần bằng cách này, không phải bằng một đường kẻ ngang.
 * Đường kẻ làm trang trông phẳng và rẻ tiền; hai panel bo góc có viền
 * tạo cảm giác tách bạch và chỉn chu hơn hẳn.
 */
/**
 * Header và nội dung là hai DẢI trắng tràn ngang, cách nhau một khe nền xanh nhạt.
 *
 * 🔴 KHÔNG bo góc, KHÔNG viền hai bên. Đã thử làm thành thẻ bo góc có viền dọc —
 *    trang trông bị bó hẹp lại như hộp. Tách bạch phải đến từ NỀN và KHE HỞ,
 *    không phải từ việc đóng khung.
 */
.gyt-header {
	background: var(--gyt-bg);
	border-bottom: 1px solid var(--gyt-border);
}

#gyt-main {
	margin-top: 14px;
	padding-bottom: var(--gyt-space-4);
	background: var(--gyt-bg);
	border-top: 1px solid var(--gyt-border);
	border-bottom: 1px solid var(--gyt-border);
}

/* Header cần có trọng lượng tương xứng với nội dung bên dưới.
   Trọng lượng đến từ CHIỀU CAO và KHOẢNG TRẮNG — không thêm bóng đổ. */
.gyt-header__top {
	display: flex;
	align-items: center;
	gap: var(--gyt-space-8);
	padding-block: 18px;
}

.gyt-logo { display: flex; align-items: center; gap: var(--gyt-space-3); text-decoration: none; }
.gyt-logo:hover { text-decoration: none; }

/* Ảnh logo — width/height cố định để KHÔNG gây CLS khi ảnh tải xong */
.gyt-logo__img {
	width: auto;
	height: 48px;
	max-width: 215px;
	object-fit: contain;
}

.gyt-logo--footer .gyt-logo__img { height: 40px; }

@media (max-width: 900px) {
	.gyt-logo__img { height: 36px; max-width: 160px; }
}

.gyt-logo__text { display: flex; flex-direction: column; }

.gyt-logo__mark {
	width: 38px; height: 38px;
	display: grid; place-items: center;
	border-radius: var(--gyt-radius);
	background: var(--gyt-brand);
	color: #fff;
	font-weight: 800;
	font-size: var(--gyt-text-lg);
	flex-shrink: 0;
}

.gyt-logo__name { font-size: var(--gyt-text-xl); font-weight: 800; color: var(--gyt-text); line-height: 1.1; }
.gyt-logo__tagline { font-size: var(--gyt-text-xs); color: var(--gyt-text-muted); }

/* Ô tìm kiếm — Homepage §4 yêu cầu search lớn, dễ thấy */
.gyt-search { flex: 1; max-width: 640px; }
.gyt-search__form { display: flex; }

.gyt-search__input {
	flex: 1;
	min-height: 50px;
	padding: 0 var(--gyt-space-5);
	font-size: var(--gyt-text-md);
	border: 1px solid var(--gyt-border);
	border-right: 0;
	border-radius: 10px 0 0 10px;
	background: var(--gyt-bg-soft);
}

.gyt-search__input:focus { outline: none; border-color: var(--gyt-brand); background: #fff; }

.gyt-search__submit {
	min-width: 58px;
	min-height: 50px;
	border: 0;
	border-radius: 0 10px 10px 0;
	background: var(--gyt-brand);
	color: #fff;
	cursor: pointer;
	transition: background .15s ease;
}
.gyt-search__submit:hover { background: var(--gyt-brand-dark); }

.gyt-header__links { display: flex; gap: var(--gyt-space-6); margin-left: auto; }
/* Vùng chạm ≥ 40px cho link chữ ở header: padding dọc thay vì tăng chiều cao dải (soát mobile 25/09) */
.gyt-header__links a { color: var(--gyt-text-soft); font-size: var(--gyt-text-base); font-weight: 500; display: inline-block; padding: 8px 0; margin: -8px 0; }
.gyt-header__links a:hover { color: var(--gyt-brand-dark); }

/* Điều hướng danh mục */
.gyt-nav { border-top: 1px solid var(--gyt-border-soft); }
.gyt-nav__list {
	display: flex; flex-wrap: wrap; gap: var(--gyt-space-8);
	margin: 0; padding: 3px 0; list-style: none;
}
/* 3 + 10 + 20 + 10 + 3 = 46px, bằng dải cũ (13 + 20 + 13) — chỉ vùng chạm rộng ra, không đổi bố cục */
.gyt-nav__list a { color: var(--gyt-text-soft); font-size: var(--gyt-text-base); font-weight: 500; display: inline-block; padding: 10px 0; }
.gyt-nav__list a:hover { color: var(--gyt-brand-dark); }

/* ---------------------------------------------------------------- */
/* CTA                                                               */
/* ---------------------------------------------------------------- */
.gyt-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--gyt-space-2);
	min-height: var(--gyt-tap-min);
	padding: 0 var(--gyt-space-5);
	border-radius: var(--gyt-radius);
	font-weight: 600;
	font-size: var(--gyt-text-md);
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease;
}
.gyt-cta:hover { text-decoration: none; }

/* Hành động thương mại — cam, chỉ dùng cho link sang Shopee */
.gyt-cta--affiliate { background: var(--gyt-cta); color: #fff; }
.gyt-cta--affiliate:hover { background: var(--gyt-cta-dark); color: #fff; }
.gyt-cta--block { display: flex; width: 100%; }

/* Hành động nội bộ — xanh lá */
.gyt-cta--brand { background: var(--gyt-brand); color: #fff; }
.gyt-cta--brand:hover { background: var(--gyt-brand-dark); color: #fff; }

/* Hành động phụ — viền */
.gyt-cta--ghost {
	background: #fff;
	color: var(--gyt-text-soft);
	border: 1px solid var(--gyt-border);
}
.gyt-cta--ghost:hover { border-color: var(--gyt-brand); color: var(--gyt-brand-dark); }

.gyt-cta--sm { min-height: 36px; padding: 0 var(--gyt-space-3); font-size: var(--gyt-text-sm); }

/* ---------------------------------------------------------------- */
/* Công bố tiếp thị liên kết                                         */
/* Nhỏ, gọn — KHÔNG làm box cảnh báo lớn (mọi spec đều nhắc)         */
/* ---------------------------------------------------------------- */
.gyt-disclosure {
	margin: var(--gyt-space-2) 0 0;
	font-size: var(--gyt-text-xs);
	color: var(--gyt-text-muted);
	line-height: 1.5;
}

/* ---------------------------------------------------------------- */
/* Breadcrumb                                                        */
/* ---------------------------------------------------------------- */
.gyt-breadcrumb {
	display: flex; flex-wrap: wrap; align-items: center;
	gap: var(--gyt-space-2);
	margin: 0; padding: var(--gyt-space-4) 0; list-style: none;
	font-size: var(--gyt-text-sm);
	color: var(--gyt-text-muted);
}
.gyt-breadcrumb li { display: flex; align-items: center; gap: var(--gyt-space-2); }
.gyt-breadcrumb li + li::before { content: "›"; color: var(--gyt-text-faint); }
.gyt-breadcrumb a { color: var(--gyt-text-muted); }
.gyt-breadcrumb a:hover { color: var(--gyt-brand-dark); }
.gyt-breadcrumb [aria-current] { color: var(--gyt-text-soft); }

/* ---------------------------------------------------------------- */
/* Nhãn loại trang                                                   */
/* ---------------------------------------------------------------- */
.gyt-label {
	display: inline-block;
	padding: 4px 10px;
	border-radius: var(--gyt-radius-sm);
	background: var(--gyt-brand-light);
	color: var(--gyt-brand-dark);
	font-size: var(--gyt-text-xs);
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

/* ---------------------------------------------------------------- */
/* Thanh CTA dính ở mobile                                           */
/* Mặc định ẨN. JS chỉ bật sau khi cuộn qua CTA hero (spec §23).     */
/* ---------------------------------------------------------------- */
.gyt-sticky-cta {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 50;
	display: flex;
	align-items: center;
	gap: var(--gyt-space-3);
	padding: var(--gyt-space-2) var(--gyt-space-4);
	background: #fff;
	border-top: 1px solid var(--gyt-border);
	box-shadow: 0 -2px 12px rgba(17, 24, 39, .08);
	/* chừa chỗ cho thanh điều hướng của trình duyệt trên iOS */
	padding-bottom: calc(var(--gyt-space-2) + env(safe-area-inset-bottom, 0px));
}

.gyt-sticky-cta[hidden] { display: none; }
.gyt-sticky-cta__info { flex: 1; min-width: 0; }
.gyt-sticky-cta__name {
	font-weight: 600; font-size: var(--gyt-text-base);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gyt-sticky-cta__price { font-size: var(--gyt-text-xs); color: var(--gyt-text-muted); }

/**
 * Chỉ dùng ở mobile — desktop đã có CTA ở sidebar dính rồi.
 *
 * 🔴 Ngưỡng này phải TRÙNG với ngưỡng sập bố cục 2 cột trong product.css (960px).
 * Lệch nhau thì có dải bề rộng vừa hiện sidebar desktop vừa hiện thanh dính mobile —
 * hai CTA cùng lúc, thừa và rối.
 */
@media (min-width: 961px) {
	.gyt-sticky-cta { display: none !important; }
}

/* Có thanh dính thì chừa chỗ, không để nó che nội dung cuối trang */
@media (max-width: 960px) {
	body.has-sticky-cta { padding-bottom: var(--gyt-sticky-h); }
}

/* ---------------------------------------------------------------- */
/* Footer                                                            */
/* ---------------------------------------------------------------- */
.gyt-footer {
	margin-top: 14px;
	padding-block: var(--gyt-space-8);
	border-top: 1px solid var(--gyt-border);
	background: var(--gyt-bg);
	font-size: var(--gyt-text-base);
}

.gyt-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: var(--gyt-space-8);
}

.gyt-footer__col h3 {
	font-size: var(--gyt-text-base);
	margin-bottom: var(--gyt-space-3);
}

.gyt-footer__col ul { margin: 0; padding: 0; list-style: none; }
.gyt-footer__col li { margin-bottom: var(--gyt-space-2); }
.gyt-footer__col a { color: var(--gyt-text-muted); }
.gyt-footer__col a:hover { color: var(--gyt-brand-dark); }

.gyt-footer__note {
	margin-top: var(--gyt-space-8);
	padding-top: var(--gyt-space-5);
	border-top: 1px solid var(--gyt-border);
	font-size: var(--gyt-text-xs);
	color: var(--gyt-text-muted);
}

@media (max-width: 768px) {
	.gyt-footer__grid { grid-template-columns: 1fr; gap: var(--gyt-space-6); }
}

/* ---------------------------------------------------------------- */
/* Responsive nền — Homepage §27: chỉ cần KHÔNG VỠ, chưa phải mobile  */
/* design cuối. Không tự sáng tác UX mobile ở giai đoạn này.          */
/* ---------------------------------------------------------------- */
@media (max-width: 900px) {
	h1 { font-size: var(--gyt-text-3xl); }
	h2 { font-size: var(--gyt-text-xl); }

	.gyt-header__top { flex-wrap: wrap; gap: var(--gyt-space-3); }
	.gyt-search { order: 3; flex-basis: 100%; max-width: none; }
	.gyt-header__links { gap: var(--gyt-space-4); font-size: var(--gyt-text-sm); }

	.gyt-nav__list { gap: var(--gyt-space-4); overflow-x: auto; flex-wrap: nowrap; }
	.gyt-nav__list::-webkit-scrollbar { display: none; }
	.gyt-nav__list a { white-space: nowrap; }
}

/* Mọi khối rộng (bảng, sơ đồ) phải tự cuộn NGANG TRONG NÓ,
   không bao giờ để cả trang cuộn ngang. */
.gyt-scroll-x {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------------- */
/* 26/09 — Thanh danh mục MỘT DÒNG + nút "Tất cả danh mục" (desktop)  */
/* ---------------------------------------------------------------- */
/* 8 danh mục không vừa 1280px -> "Bách Hóa Online" rớt xuống dòng riêng, hở một mảng (anh Khai: "rời rạc").
   Cách làm: danh sách vẫn flex-wrap nhưng KHOÁ chiều cao đúng một dòng + overflow hidden -> mục nào không vừa rơi
   sang dòng 2 bị ẩn TRỌN (không cắt giữa chữ). Mọi danh mục vẫn tới được qua nút "Tất cả danh mục". */
.gyt-nav__all { display: none; }
@media (min-width: 961px) {
	.gyt-nav { position: relative; display: flex; align-items: center; gap: var(--gyt-space-6); }
	.gyt-nav__list { flex: 1 1 auto; min-width: 0; height: 46px; overflow: hidden; row-gap: 20px; column-gap: 28px; }
	.gyt-nav__all { display: block; flex: 0 0 auto; }
	.gyt-nav__all > summary {
		display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer;
		padding: 8px 14px; border: 1px solid var(--gyt-border); border-radius: 10px;
		font-weight: 600; color: var(--gyt-text); background: #fff; white-space: nowrap;
	}
	.gyt-nav__all > summary::-webkit-details-marker { display: none; }
	.gyt-nav__all[open] > summary, .gyt-nav__all > summary:hover { border-color: var(--gyt-brand-light); color: var(--gyt-brand-dark); }
	.gyt-nav__allist {
		position: absolute; left: 0; top: calc(100% + 6px); z-index: 50;
		display: grid; grid-template-columns: repeat(3, minmax(200px, 1fr)); gap: 2px 18px;
		margin: 0; padding: 12px 14px; list-style: none;
		background: #fff; border: 1px solid var(--gyt-border); border-radius: 14px;
		box-shadow: 0 14px 34px rgba(17, 24, 39, .12);
	}
	.gyt-nav__allist a { display: block; padding: 9px 8px; border-radius: 8px; color: var(--gyt-text-soft); font-weight: 500; }
	.gyt-nav__allist a:hover { background: var(--gyt-brand-tint); color: var(--gyt-brand-dark); text-decoration: none; }
}

/* ---------------------------------------------------------------- */
/* Trang tĩnh (page.php — Về chúng tôi · Liên hệ · chính sách), 26/09 */
/* ---------------------------------------------------------------- */
.gyt-page__article { max-width: var(--gyt-measure, 840px); margin: 18px 0 40px; }
.gyt-page__h1 { margin: 0 0 18px; font-size: clamp(26px, 3vw, 36px); line-height: 1.25; letter-spacing: -.02em; font-weight: 800; }
.gyt-page__body { font-size: 16.5px; line-height: 1.8; color: var(--gyt-text-soft); }
.gyt-page__body h2 { margin: 30px 0 10px; font-size: 21px; line-height: 1.35; color: var(--gyt-text); }
.gyt-page__body p { margin: 0 0 14px; }
.gyt-page__body ul { margin: 0 0 16px; padding-left: 22px; }
.gyt-page__body li { margin-bottom: 6px; }
.gyt-page__body a { color: var(--gyt-brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.gyt-page__body .gyt-page__mail {
	display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 18px; padding: 12px 18px;
	border: 1.5px solid var(--gyt-brand-light); border-radius: 12px; background: var(--gyt-brand-tint);
	font-size: 17px; font-weight: 700; text-decoration: none;
}
.gyt-page__updated { margin: 28px 0 0; font-size: var(--gyt-text-sm); color: var(--gyt-text-muted); }
@media (max-width: 600px) {
	.gyt-page__body { font-size: 15.5px; line-height: 1.75; }
	.gyt-page__body h2 { font-size: 19px; margin-top: 24px; }
}
