/* AG Bài viết bán hàng – Author: August - https://augustcsgo.com */
.ag-bs-ins,
.ag-bs-rel,
.ag-bs-toc,
.ag-bs-share { --g1: #0b6b4a; --g2: #0f9d6c; --red: #ef4444; box-sizing: border-box; }
.ag-bs-ins *, .ag-bs-rel *, .ag-bs-share * { box-sizing: border-box; }

/* Thanh tiến độ đọc */
.ag-bs-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 99999; height: 3px; pointer-events: none; }
.ag-bs-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #0f9d6c, #4cc38a); border-radius: 0 3px 3px 0; transition: width .1s linear; }
.admin-bar .ag-bs-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .ag-bs-progress { top: 46px; } }

/* Mục lục */
.ag-bs-toc { margin: 0 0 24px; padding: 14px 18px; background: #f3fbf7; border: 1px solid #cfe9dc; border-left: 4px solid var(--g2); border-radius: 12px; }
.ag-bs-toc summary { font-weight: 800; color: var(--g1); cursor: pointer; list-style: none; }
.ag-bs-toc summary::-webkit-details-marker { display: none; }
.ag-bs-toc summary::after { content: "▾"; float: right; transition: transform .2s; }
.ag-bs-toc:not([open]) summary::after { transform: rotate(-90deg); }
.ag-bs-toc ul { margin: 10px 0 0; padding: 0; list-style: none; }
.ag-bs-toc li { position: relative; margin: 5px 0; padding-left: 16px; list-style: none; }
.ag-bs-toc li::before { content: ""; position: absolute; top: .6em; left: 2px; width: 6px; height: 6px; background: var(--g2); border-radius: 50%; }
.ag-bs-toc li.is-h3 { margin-left: 18px; font-size: .95em; }
.ag-bs-toc li.is-h3::before { background: transparent; border: 1.5px solid var(--g2); }
.ag-bs-toc a { color: #1f2937; }
.ag-bs-toc a:hover { color: var(--g2); }
.ag-bs-article h2[id], .ag-bs-article h3[id] { scroll-margin-top: 110px; }
html { scroll-behavior: smooth; }

/* Khối chèn trong bài */
.ag-bs-ins { clear: both; margin: 22px 0 26px; }
.ag-bs-off { position: absolute; top: 8px; left: 8px; padding: 3px 8px; font-size: 12px; font-weight: 800; line-height: 1.2; color: #fff; background: var(--red); border-radius: 999px; }
.ag-bs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-height: 40px;
	margin: 0;
	padding: 0 16px;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.2;
	color: #fff !important;
	text-decoration: none !important;
	text-transform: none;
	background: var(--g2);
	border: 1.5px solid var(--g2);
	border-radius: 10px;
	transition: filter .2s, background .2s;
}
.ag-bs-btn:hover { filter: brightness(1.08); }
.ag-bs-btn.is-ghost { color: var(--g2) !important; background: #fff; }
.ag-bs-btn.is-ghost:hover { color: #fff !important; background: var(--g2); }
.ag-bs-btn.is-sm { width: 100%; min-height: 36px; padding: 0 8px; font-size: 13px; }
.ag-bs-btn.added { display: none; }
.ag-bs-ins .added_to_cart, .ag-bs-rel .added_to_cart { display: block; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--g1); text-align: center; }

.ag-bs-card {
	display: grid;
	grid-template-columns: 180px minmax(0, 1fr);
	gap: 18px;
	padding: 14px;
	background: #fff;
	border: 1px solid #e5efe9;
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(11, 107, 74, .08);
}
.ag-bs-card__img { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #f3f4f6; border-radius: 12px; }
.ag-bs-card__img img { display: block; width: 100%; height: 100%; margin: 0 !important; object-fit: cover; }
.ag-bs-card__in { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ag-bs-card__kicker { align-self: flex-start; padding: 2px 10px; font-size: 12px; font-weight: 800; color: #5b3d00; background: #fdecc0; border-radius: 999px; }
.ag-bs-card__name { font-size: 18px; font-weight: 800; line-height: 1.35; color: #1f2937 !important; text-decoration: none !important; }
.ag-bs-card__name:hover { color: var(--g2) !important; }
.ag-bs-card__meta { font-size: 13px; color: #6b7280; }
.ag-bs-stars { font-weight: 800; color: #f59e0b; }
.ag-bs-card__price, .ag-bs-mini__price { font-size: 18px; font-weight: 800; color: var(--red); }
.ag-bs-card__price del, .ag-bs-mini__price del { margin-right: 6px; font-size: .8em; font-weight: 500; color: #9ca3af; }
.ag-bs-card__price ins, .ag-bs-mini__price ins { text-decoration: none; }
.ag-bs-card__desc { font-size: 14px; line-height: 1.55; color: #4b5563; }
.ag-bs-card__act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }

.ag-bs-grid { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 14px; }
.ag-bs-mini { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; background: #fff; border: 1px solid #e5efe9; border-radius: 14px; }
.ag-bs-mini__img { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #f3f4f6; border-radius: 10px; }
.ag-bs-mini__img img { display: block; width: 100%; height: 100%; margin: 0 !important; object-fit: cover; }
.ag-bs-mini__name { display: -webkit-box; overflow: hidden; font-size: 14px; font-weight: 700; line-height: 1.35; color: #1f2937 !important; text-decoration: none !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.7em; }
.ag-bs-mini__price { font-size: 15px; margin-top: auto; }

/* Voucher giữa bài */
.ag-bs-vc { padding: 14px; background: linear-gradient(135deg, #fff8e6, #fef3c7); border: 1px dashed #f7b731; border-radius: 16px; }
.ag-bs-vc .ag-vc-block { margin: 0; }

/* Chia sẻ */
.ag-bs-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 26px 0; padding: 14px 16px; background: #f9fafb; border-radius: 12px; }
.ag-bs-share > span { flex: 1 1 100%; margin-right: 4px; font-weight: 700; color: #374151; }
.ag-bs-share a, .ag-bs-share button {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	margin: 0;
	padding: 0 14px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	color: #fff !important;
	text-decoration: none !important;
	text-transform: none;
	letter-spacing: 0;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}
.ag-bs-share__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-bs-share__btns > * { margin: 0 !important; }
.ag-bs-share .is-zalo { background: #0068ff; }
.ag-bs-share .is-fb { background: #1877f2; }
.ag-bs-share .is-copy { color: #374151 !important; background: #e5e7eb; }

/* Liên quan */
.ag-bs-rel { margin: 28px 0; }
.ag-bs-rel__t { margin: 0 0 14px !important; font-size: 20px; font-weight: 800; color: var(--g1); }
.ag-bs-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ag-bs-post { display: flex; flex-direction: column; gap: 6px; color: #1f2937 !important; text-decoration: none !important; }
.ag-bs-post__img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #e8f7ef; border-radius: 12px; }
.ag-bs-post__img img { display: block; width: 100%; height: 100%; margin: 0 !important; object-fit: cover; transition: transform .4s; }
.ag-bs-post:hover img { transform: scale(1.05); }
.ag-bs-post__ph { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 34px; }
.ag-bs-post__t { font-weight: 800; line-height: 1.35; }
.ag-bs-post:hover .ag-bs-post__t { color: var(--g2); }
.ag-bs-post__d { font-size: 13px; color: #6b7280; }

@media (max-width: 849px) {
	.ag-bs-grid { grid-template-columns: repeat(min(var(--n, 3), 3), minmax(0, 1fr)); }
}
@media (max-width: 549px) {
	.ag-bs-card { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 10px; }
	.ag-bs-card__name { font-size: 15px; }
	.ag-bs-card__desc { display: none; }
	.ag-bs-card__act .ag-bs-btn { flex: 1 1 100%; min-height: 36px; font-size: 13px; }
	.ag-bs-card__act .ag-bs-btn.is-ghost { display: none; }
	.ag-bs-grid { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
	.ag-bs-grid::-webkit-scrollbar { display: none; }
	.ag-bs-grid > .ag-bs-mini { flex: 0 0 44%; scroll-snap-align: start; }
	.ag-bs-posts { grid-template-columns: 1fr; }
	.ag-bs-post { flex-direction: row; align-items: center; gap: 12px; }
	.ag-bs-post__img { flex: 0 0 110px; }
	.ag-bs-post__d { display: none; }
}
