/* ==========================================================================
   Product category pages
   Cấp 1 – Figma 243:5031 (banner + ảnh lớn + mô tả)
   Cấp 2 – Figma 1134:2315 (banner + thẻ ảnh có tên + nội dung trong khung xanh nhạt)
   ========================================================================== */

/* ---------- Layout: sidebar 302 + main 954 ---------- */
.cat-page__grid {
	display: grid; grid-template-columns: 302px minmax(0, 954px);
	justify-content: space-between; gap: 24px; align-items: start;
}
.cat-page__main { min-width: 0; }

/* ---------- Sidebar ---------- */
/* Bám theo khi cuộn nội dung dài ("Xem thêm"); lúc đang bám (.is-stuck, main.js) cao hơn màn hình thì cuộn trong khung */
@media (min-width: 901px) {
	.cat-nav {
		--nav-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--header-h) + 24px);
		position: sticky; top: var(--nav-top);
	}
	.cat-nav.is-stuck { max-height: calc(100vh - var(--nav-top) - 24px); overflow-y: auto; scrollbar-width: thin; }
}
.cat-nav__list { display: grid; gap: 16px; }
.cat-nav__group.is-open { padding: 16px; background: var(--c-bg-soft); border-radius: var(--radius); }
.cat-nav__row { display: flex; align-items: center; gap: 8px; }
.cat-nav__head {
	flex: 1; min-width: 0;
	display: flex; align-items: center; gap: 16px;
	color: var(--c-gray-90);
}
.cat-nav__head:hover { color: var(--c-orange); }
.cat-nav__toggle {
	flex: 0 0 32px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
	border: 0; border-radius: 50%; background: none; color: #364970; cursor: pointer;
	transition: background-color .2s;
}
.cat-nav__toggle:hover { background: rgba(0, 102, 179, .1); }
.cat-nav__toggle svg { transition: transform .2s; }
.cat-nav__toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.cat-icon { flex: 0 0 80px; width: 80px; height: 80px; object-fit: contain; }
.cat-icon--svg { display: grid; place-items: center; }
.cat-icon--svg svg { width: 59px; height: 63px; }
.cat-nav__name {
	flex: 1; min-width: 0;
	font-size: 20px; font-weight: 600; line-height: 26px; text-transform: uppercase;
}
/* Nhóm đang mở: chữ + mũi tên cam (theo yêu cầu, khác Figma 1134:2326 vốn để xanh) */
.is-active .cat-nav__head,
.is-active .cat-nav__toggle { color: var(--c-orange); }

.cat-nav__children { display: grid; gap: 12px; margin-top: 16px; }
.cat-nav__children[hidden] { display: none; }
.cat-nav__children a { display: block; font-size: 18px; line-height: 1.25; letter-spacing: -0.27px; color: #404040; }
/* Mục con đang chọn / hover: chữ cam (Figma 1134:2378, đậm 700) */
.cat-nav__children a:hover,
.cat-nav__children a[aria-current] { color: var(--c-orange); }
.cat-nav__children a[aria-current] { font-weight: 700; }

/* ---------- Cấp 1: ảnh banner 954×533, bo 24px, cách mô tả 40px ---------- */
.cat-banner { margin-bottom: 40px; overflow: hidden; border-radius: 24px; }
.cat-banner img { width: 100%; aspect-ratio: 954 / 533; height: auto; object-fit: cover; }

/* ---------- Cấp 2: thẻ ảnh 302×230 bo 16px + tên 20px, lưới 3 cột cách 24px ---------- */
.cat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-bottom: 40px; }
.cat-card { display: flex; flex-direction: column; gap: 16px; }
.cat-card__media { display: block; overflow: hidden; border-radius: 16px; }
.cat-card__media img { width: 100%; aspect-ratio: 302 / 230; height: auto; object-fit: cover; transition: transform .4s; }
.cat-card__media:hover img { transform: scale(1.04); }
.cat-card__title { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.3px; color: #3a3a3a; }

/* Cấp 2: toàn bộ nội dung trong khung nền #EAF3FF, bo 24px, đệm 40px */
.cat-box { padding: 40px; background: #eaf3ff; border-radius: 24px; }

/* ---------- Nội dung mô tả danh mục (soạn trong WordPress) ---------- */
.prose--product { font-size: 16px; line-height: 1.5; color: #333; }
.prose--product > * + * { margin-top: 16px; }
.prose--product h2 {
	font-size: clamp(24px, 1.6vw + 6px, 32px); font-weight: 700; line-height: 1.2;
	letter-spacing: -0.48px; text-transform: uppercase; color: #3a3a3a;
}
.prose--product > h2 { margin-top: 40px; }
.prose--product > h2:first-child { margin-top: 0; }
.prose--product > h2 + * { margin-top: 24px; }
.prose--product h3,
.prose--product h4 { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.3px; color: #333; }
.prose--product > h3 + *,
.prose--product > h4 + * { margin-top: 8px; }
.prose--product ul { padding-left: 24px; list-style: disc; }
.prose--product ol { padding-left: 24px; list-style: decimal; }
.prose--product li { line-height: 1.25; }
.prose--product strong { color: #333; }
.prose--product a { color: var(--c-primary); text-decoration: none; }
.prose--product a:hover { text-decoration: underline; }

/* Ảnh: bo 16px; ảnh lớn cách nội dung phía trên 24px */
.prose--product img { max-width: 100%; height: auto; border-radius: 16px; }
.prose--product > p > img,
.prose--product > p > a > img,
.prose--product .wp-caption img,
.prose--product figure img { display: block; width: 100%; }
.prose--product > p:has(> img:only-child),
.prose--product > p:has(> a:only-child > img),
.prose--product > .wp-caption,
.prose--product > figure,
.prose--product > .prose-gallery { margin-top: 24px; }
.prose--product .wp-caption { max-width: 100% !important; }
.prose--product .wp-caption-text,
.prose--product figcaption { margin-top: 8px; font-size: 14px; text-align: center; color: #8a96a3; }
/* Nhiều ảnh liền nhau -> hàng 2 ảnh (Figma: 425×268, cách 24px) */
.prose-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.prose-gallery > * { margin: 0; }
.prose-gallery img { width: 100%; aspect-ratio: 425 / 268; object-fit: cover; }

/* "Quy trình đặt hàng": mỗi bước một dòng 20px */
.cat-steps > * + * { margin-top: 16px; }
.cat-steps p,
.cat-steps li { font-size: 20px; font-weight: 500; line-height: 1.2; letter-spacing: -0.3px; color: #333; }
.cat-steps ul,
.cat-steps ol { padding-left: 0; list-style: none; }
.cat-steps li + li { margin-top: 16px; }

/* ---------- Nội dung dài: thu gọn, bấm "Xem thêm" để mở (chỉ khi có JS) ---------- */
.cat-more { --more-h: 700px; --more-bg: #fff; position: relative; }
.cat-box .cat-more { --more-bg: #eaf3ff; }
.js .cat-more__body { overflow: hidden; transition: max-height .45s ease; }
.js .cat-more:not(.is-open) .cat-more__body { max-height: var(--more-h); }
.cat-more__bar { position: relative; display: flex; justify-content: center; margin-top: 24px; }
.cat-more__bar[hidden] { display: none; }
/* lớp mờ dần phủ cuối phần bị thu gọn */
.cat-more:not(.is-open) .cat-more__bar::before {
	content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% + 24px); height: 180px;
	background: linear-gradient(to bottom, transparent, var(--more-bg)); pointer-events: none;
}
.cat-more__btn .icon svg { width: 20px; height: 20px; transition: transform .2s; }
.cat-more__btn:hover .icon svg { transform: translateY(2px); }
.cat-more.is-open .cat-more__btn .icon svg { transform: rotate(180deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
	.cat-page__grid { grid-template-columns: 260px minmax(0, 1fr); }
	.cat-icon { flex-basis: 56px; width: 56px; height: 56px; }
	.cat-nav__name { font-size: 16px; line-height: 22px; }
}
@media (max-width: 900px) {
	.cat-page__grid { grid-template-columns: 1fr; }
	.cat-nav { order: 2; }
	.cat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.cat-card__title { font-size: 17px; }
	.cat-box { padding: 24px; }
	.cat-steps p, .cat-steps li { font-size: 18px; }
	.cat-more { --more-h: 560px; }
}
@media (max-width: 560px) {
	.prose-gallery { grid-template-columns: 1fr; }
}
