/* ==========================================================================
   SaigonBook – bổ sung cho Blocksy
   Màu dùng biến palette của Blocksy để tự đổi theo chế độ sáng/tối:
   1 xanh rêu (chính) · 2 cam đất (nhấn) · 3 chữ · 4 tiêu đề · 5 viền · 6/7 nền nhạt · 8 trắng
   ========================================================================== */

:root {
	--sgb-shopee: #ee4d2d;
	--sgb-shopee-dark: #d73211;
	--sgb-tiktok: #111111;
	--sgb-radius: 14px;
	--sgb-cover-radius: 6px;
	--sgb-shadow: 0 10px 30px -12px rgba(21, 61, 51, 0.25);
	--sgb-shadow-lg: 0 24px 50px -20px rgba(21, 61, 51, 0.35);
}

::selection {
	background: var(--theme-palette-color-2);
	color: #fff;
}

/* --------------------------------------------------------------------------
   Nút mua trên sàn
   ----------------------------------------------------------------------- */
.sgb-buy-group {
	display: flex;
	gap: 8px;
	width: 100%;
}

.sgb-buy {
	--_bg: var(--sgb-shopee);
	--_bg-h: var(--sgb-shopee-dark);
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 12px;
	border-radius: 10px;
	background: var(--_bg);
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	white-space: nowrap;
	transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.sgb-buy:hover,
.sgb-buy:focus-visible {
	background: var(--_bg-h);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px -8px var(--_bg);
}

.sgb-buy:focus-visible {
	outline: 2px solid var(--theme-palette-color-2);
	outline-offset: 2px;
}

.sgb-buy--tiktok {
	--_bg: var(--sgb-tiktok);
	--_bg-h: #2b2b2b;
}

.sgb-buy--soon {
	--_bg: var(--theme-palette-color-6);
	--_bg-h: var(--theme-palette-color-6);
	color: var(--theme-palette-color-3) !important;
	cursor: default;
}

.sgb-icon {
	display: inline-flex;
	width: 18px;
	height: 18px;
	flex: none;
}

.sgb-icon svg {
	width: 100%;
	height: 100%;
}

.sgb-buy-group--single .sgb-buy {
	min-height: 52px;
	font-size: 16px;
	border-radius: 12px;
}

.sgb-buy-group--single .sgb-icon {
	width: 22px;
	height: 22px;
}

/* --------------------------------------------------------------------------
   Thẻ sách (Blocksy product card)
   ----------------------------------------------------------------------- */
[data-products] .product figure,
.sgb-book-card__cover {
	position: relative;
}

[data-products] .product .ct-media-container,
[data-products] .product figure img {
	border-radius: var(--sgb-cover-radius);
}

[data-products] .product figure .ct-media-container {
	box-shadow: var(--sgb-shadow);
	transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.35s ease;
}

[data-products] .product:hover figure .ct-media-container {
	transform: translateY(-6px);
	box-shadow: var(--sgb-shadow-lg);
}

[data-products] .woocommerce-loop-product__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.6em;
}

.sgb-card-author {
	font-size: 13px;
	color: var(--theme-palette-color-3);
	opacity: 0.85;
	margin-top: -4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sgb-card-author a {
	color: inherit;
}

[data-products] .product .price {
	font-weight: 700;
	color: var(--theme-palette-color-2);
}

[data-products] .product .price del {
	font-weight: 400;
	font-size: 0.85em;
	color: var(--theme-palette-color-3);
	opacity: 0.6;
}

[data-products] .ct-woo-card-actions {
	width: 100%;
}

[data-products] .ct-woo-card-actions .sgb-buy-group {
	margin-top: 4px;
}

@media (max-width: 480px) {
	.sgb-buy-group--card {
		gap: 6px;
	}

	.sgb-buy-group--card .sgb-buy {
		padding: 8px 6px;
		font-size: 13px;
		gap: 4px;
	}

	.sgb-buy-group--card .sgb-icon {
		width: 16px;
		height: 16px;
	}
}

.onsale,
.ct-woo-badge-onsale {
	background: var(--theme-palette-color-2) !important;
	border-radius: 20px !important;
}

/* --------------------------------------------------------------------------
   Trang chi tiết sách
   ----------------------------------------------------------------------- */
.single-product .woocommerce-product-gallery img {
	border-radius: var(--sgb-cover-radius);
}

.single-product .woocommerce-product-gallery .ct-media-container,
.single-product .woocommerce-product-gallery .flexy-items {
	border-radius: var(--sgb-cover-radius);
}

.single-product div.product .summary .product_title {
	margin-bottom: 8px;
}

.sgb-book-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin-bottom: 18px;
	font-size: 15px;
	color: var(--theme-palette-color-3);
}

.sgb-book-meta i {
	font-style: normal;
	opacity: 0.4;
}

.sgb-book-meta a {
	color: var(--theme-palette-color-1);
	font-weight: 600;
}

.single-product .summary .price {
	font-size: 28px !important;
	font-weight: 700;
	color: var(--theme-palette-color-2) !important;
}

.single-product .summary .price del {
	font-size: 18px;
	font-weight: 400;
	color: var(--theme-palette-color-3);
	opacity: 0.6;
}

.sgb-buybox {
	margin: 22px 0 26px;
	padding: 20px;
	border: 1px solid var(--theme-palette-color-5);
	border-radius: var(--sgb-radius);
	background: var(--theme-palette-color-7);
}

.sgb-buybox__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 14px;
}

.sgb-buybox__title {
	font-weight: 700;
	color: var(--theme-palette-color-4);
}

.sgb-buybox__save {
	padding: 3px 10px;
	border-radius: 20px;
	background: var(--theme-palette-color-2);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.sgb-buybox__trust {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 16px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
}

.sgb-buybox__trust li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.sgb-buybox__trust .sgb-icon {
	color: var(--theme-palette-color-1);
	width: 20px;
	height: 20px;
}

.sgb-buybox__note {
	margin: 14px 0 0;
	font-size: 12.5px;
	opacity: 0.7;
}

@media (max-width: 600px) {
	.sgb-buy-group--single {
		flex-direction: column;
	}

	.sgb-buybox__trust {
		grid-template-columns: 1fr;
	}
}

.woocommerce-product-attributes {
	border-radius: var(--sgb-radius);
	overflow: hidden;
}

.woocommerce-product-attributes th {
	width: 180px;
	font-weight: 600;
}

/* Thanh mua nhanh (mobile) */
.sgb-sticky-buy {
	position: fixed;
	z-index: 50;
	left: 0;
	right: 0;
	bottom: 0;
	display: none;
	align-items: center;
	gap: 10px;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
	background: var(--theme-palette-color-8);
	box-shadow: 0 -8px 24px -10px rgba(0, 0, 0, 0.25);
	transform: translateY(110%);
	transition: transform 0.3s ease;
}

.sgb-sticky-buy.is-visible {
	transform: none;
}

.sgb-sticky-buy__info {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 40%;
}

.sgb-sticky-buy__title {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sgb-sticky-buy__price {
	font-size: 14px;
	font-weight: 700;
	color: var(--theme-palette-color-2);
}

.sgb-sticky-buy__price del {
	display: none;
}

.sgb-sticky-buy .sgb-buy-group {
	flex: 1 1 60%;
	width: auto;
}

.sgb-sticky-buy .sgb-buy {
	padding: 8px;
	font-size: 13px;
}

.sgb-sticky-buy .sgb-buy__label {
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (max-width: 768px) {
	.sgb-sticky-buy {
		display: flex;
	}

	/* Nhiều sàn: rút gọn nhãn thành tên sàn. Một sàn: giữ nguyên "Mua ngay". */
	.sgb-sticky-buy .sgb-buy-group--sticky .sgb-buy + .sgb-buy .sgb-buy__label,
	.sgb-sticky-buy .sgb-buy-group--sticky .sgb-buy:has(+ .sgb-buy) .sgb-buy__label {
		font-size: 0;
	}

	.sgb-sticky-buy .sgb-buy-group--sticky .sgb-buy--shopee:has(+ .sgb-buy) .sgb-buy__label::after {
		content: "Shopee";
		font-size: 13px;
	}

	.sgb-sticky-buy .sgb-buy-group--sticky .sgb-buy--shopee + .sgb-buy--tiktok .sgb-buy__label::after {
		content: "TikTok";
		font-size: 13px;
	}

	body.sgb-has-sticky .ct-back-to-top {
		bottom: 90px;
	}
}

/* --------------------------------------------------------------------------
   Block giá (GreenShift query loop)
   ----------------------------------------------------------------------- */
.sgb-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 8px;
	font-weight: 700;
	color: var(--theme-palette-color-2);
}

.sgb-price del {
	order: 2;
	font-size: 0.85em;
	font-weight: 400;
	color: var(--theme-palette-color-3);
	opacity: 0.6;
}

.sgb-price ins {
	text-decoration: none;
}

.sgb-price__badge {
	order: 3;
	padding: 1px 7px;
	border-radius: 20px;
	background: color-mix(in srgb, var(--theme-palette-color-2) 14%, transparent);
	color: var(--theme-palette-color-2);
	font-size: 12px;
}

/* --------------------------------------------------------------------------
   Trang chủ / GreenShift helpers
   ----------------------------------------------------------------------- */
.sgb-book-card {
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sgb-book-card__cover {
	display: block;
	border-radius: var(--sgb-cover-radius);
	overflow: hidden;
	aspect-ratio: 1 / 1;
	box-shadow: var(--sgb-shadow);
	transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.35s ease;
}

.sgb-book-card__cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sgb-book-card:hover .sgb-book-card__cover {
	transform: translateY(-6px);
	box-shadow: var(--sgb-shadow-lg);
}

.sgb-book-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.7em;
	margin: 6px 0 0;
	font-size: 16px;
	line-height: 1.35;
	font-weight: 600;
}

.sgb-book-card__title a {
	color: var(--theme-palette-color-4);
	text-decoration: none;
}

.sgb-book-card__title a:hover {
	color: var(--theme-palette-color-1);
}

.sgb-book-card .sgb-buy-group {
	margin-top: auto;
}

.gspbgrid_list_builder .wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gspbgrid_list_builder .gspbgrid_item {
	margin: 0;
}

/* Thanh trượt sách ngang trên mobile cho grid trang chủ */
@media (max-width: 767px) {
	.sgb-scroll-row .wp-block-post-template {
		display: flex !important;
		flex-wrap: nowrap !important;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		gap: 14px !important;
		padding-bottom: 10px;
		margin-right: calc(-1 * min(3vw, 20px)) !important;
		scrollbar-width: none;
	}

	.sgb-scroll-row .wp-block-post-template::-webkit-scrollbar {
		display: none;
	}

	.sgb-scroll-row .gspbgrid_item {
		flex: 0 0 46% !important;
		max-width: 46% !important;
		scroll-snap-align: start;
	}
}

/* Thẻ danh mục */
.sgb-cat-card svg {
	transition: transform 0.3s ease;
}

.sgb-cat-card:hover svg {
	transform: scale(1.12) rotate(-4deg);
}

/* --------------------------------------------------------------------------
   Header / Footer
   ----------------------------------------------------------------------- */
[data-row="top"] .ct-header-text {
	font-size: 13px;
}

.ct-search-box input[type="search"] {
	border-radius: 999px !important;
}

.ct-footer .wp-block-heading,
.ct-footer .widget-title {
	font-size: 17px;
	margin-bottom: 14px;
}

.ct-footer ul.wp-block-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ct-footer ul.wp-block-list li {
	margin-bottom: 8px;
}

.sgb-footer-platforms {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 14px;
}

.sgb-footer-platforms a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	color: inherit;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.sgb-footer-platforms a:hover {
	background: rgba(255, 255, 255, 0.16);
}

/* --------------------------------------------------------------------------
   Blog
   ----------------------------------------------------------------------- */
.entry-card .ct-media-container,
.entry-card .ct-image-container {
	border-radius: var(--sgb-radius);
}

.sgb-disclosure {
	padding: 14px 18px;
	border-left: 4px solid var(--theme-palette-color-2);
	border-radius: 8px;
	background: var(--theme-palette-color-7);
	font-size: 14px;
}

/* Tôn trọng người dùng giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* --------------------------------------------------------------------------
   Query Grid (GreenShift Query) & thẻ sách Content Block
   ----------------------------------------------------------------------- */
.sgb-qgrid {
	display: grid !important;
	grid-template-columns: repeat(var(--sgb-cols, 5), minmax(0, 1fr));
	gap: 32px 22px;
}

.sgb-qgrid--5 { --sgb-cols: 5; }
.sgb-qgrid--4 { --sgb-cols: 4; }
.sgb-qgrid--3 { --sgb-cols: 3; gap: 32px 28px; }

@media (max-width: 1100px) {
	.sgb-qgrid--5 { --sgb-cols: 4; }
}

@media (max-width: 991px) {
	.sgb-qgrid--5,
	.sgb-qgrid--4 { --sgb-cols: 3; }
	.sgb-qgrid--3 { --sgb-cols: 2; }
}

@media (max-width: 767px) {
	.sgb-qgrid--3 { --sgb-cols: 1; }
}

.sgb-qgrid > .gspbgrid_item {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.sgb-card,
.sgb-card > .sgb-book-card {
	height: 100%;
}

.sgb-sale-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	padding: 3px 9px;
	border-radius: 20px;
	background: var(--theme-palette-color-2);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
}

.sgb-book-card .sgb-card-author {
	margin-top: -4px;
}

/* Danh sách sản phẩm WooCommerce dùng thẻ Content Block */
[data-products] > li.sgb-card-item {
	display: flex;
	flex-direction: column;
	text-align: left;
}

[data-products] > li.sgb-card-item > .sgb-card {
	width: 100%;
}

/* Hero */
.sgb-hl {
	position: relative;
	white-space: nowrap;
	color: var(--sgb-shopee);
}

.sgb-hl--dark {
	color: var(--theme-palette-color-4);
	background: linear-gradient(transparent 62%, color-mix(in srgb, var(--theme-palette-color-2) 30%, transparent) 62%);
}

/* Hero: cụm bìa sách nổi bật (block saigonbook/hero-books) */
.sgb-hero-books {
	--_w: 260px;
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	height: 500px;
	margin-inline: auto;
}

.sgb-hero-books__cover {
	position: absolute;
	top: 30px;
	left: 50%;
	display: block;
	width: var(--_w);
	aspect-ratio: 1 / 1;
	border-radius: 4px 10px 10px 4px;
	overflow: hidden;
	background: var(--theme-palette-color-6);
	box-shadow:
		0 2px 4px rgba(16, 24, 20, 0.12),
		0 18px 36px -10px rgba(16, 24, 20, 0.35),
		0 40px 60px -30px rgba(16, 24, 20, 0.35);
	transform: translateX(-50%);
	transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s ease;
}

/* Gáy sách: vệt sáng/tối bên trái tạo cảm giác bìa thật */
.sgb-hero-books__cover::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0, rgba(255, 255, 255, 0.28) 2.5%, rgba(255, 255, 255, 0) 7%, rgba(0, 0, 0, 0.06) 100%);
	pointer-events: none;
}

.sgb-hero-books__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sgb-hero-books__cover.is-main {
	z-index: 3;
	animation: sgbHeroFloat 6s ease-in-out infinite;
}

.sgb-hero-books__cover.is-left,
.sgb-hero-books__cover.is-right {
	--_w: 200px;
	top: 92px;
	z-index: 2;
	filter: saturate(0.92);
}

.sgb-hero-books__cover.is-left {
	transform: translateX(-118%) rotate(-9deg);
}

.sgb-hero-books__cover.is-right {
	transform: translateX(18%) rotate(8deg);
}

.sgb-hero-books:hover .sgb-hero-books__cover.is-left {
	transform: translateX(-128%) rotate(-12deg);
}

.sgb-hero-books:hover .sgb-hero-books__cover.is-right {
	transform: translateX(28%) rotate(11deg);
}

.sgb-hero-books__cover.is-left:hover,
.sgb-hero-books__cover.is-right:hover {
	z-index: 4;
	filter: none;
}

@keyframes sgbHeroFloat {
	0%, 100% { transform: translateX(-50%) translateY(0); }
	50% { transform: translateX(-50%) translateY(-10px); }
}

.sgb-hero-books__badge {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--theme-palette-color-2);
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	box-shadow: 0 8px 18px -6px rgba(184, 69, 42, 0.6);
}

.sgb-hero-books__card {
	position: absolute;
	right: 0;
	bottom: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: min(290px, 70%);
	padding: 14px 16px 16px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 18px 40px -16px rgba(16, 24, 20, 0.35);
	animation: sgbHeroCard 5s ease-in-out infinite;
}

@keyframes sgbHeroCard {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-8px); }
}

.sgb-hero-books__eyebrow {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--theme-palette-color-2);
}

.sgb-hero-books__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-family: var(--theme-font-family, inherit);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--theme-palette-color-4) !important;
	text-decoration: none !important;
}

.sgb-hero-books__title:hover {
	color: var(--theme-palette-color-1) !important;
}

.sgb-hero-books__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 2px;
}

.sgb-hero-books__price {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
	line-height: 1.2;
	font-size: 17px;
	font-weight: 800;
	color: var(--sgb-shopee);
}

.sgb-hero-books__price del {
	order: 2;
	font-size: 12px;
	font-weight: 500;
	color: var(--theme-palette-color-3);
	opacity: 0.7;
}

.sgb-hero-books__price ins {
	text-decoration: none;
}

.sgb-hero-books__buy {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: none;
	padding: 9px 14px;
	border-radius: 10px;
	background: var(--sgb-shopee);
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none !important;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.sgb-hero-books__buy:hover {
	background: var(--sgb-shopee-dark);
	transform: translateY(-1px);
}

.sgb-hero-books__buy .sgb-icon {
	width: 16px;
	height: 16px;
}

@media (max-width: 999.98px) {
	.sgb-hero-books {
		--_w: 230px;
		height: 460px;
	}

	.sgb-hero-books__cover.is-left,
	.sgb-hero-books__cover.is-right {
		--_w: 180px;
	}
}

@media (max-width: 689.98px) {
	.sgb-hero-books {
		--_w: 46vw;
		height: auto;
		padding-top: calc(46vw * 1.5 + 40px);
		max-width: 420px;
	}

	.sgb-hero-books__cover {
		top: 10px;
	}

	.sgb-hero-books__cover.is-left,
	.sgb-hero-books__cover.is-right {
		--_w: 34vw;
		top: 44px;
	}

	.sgb-hero-books__cover.is-left {
		transform: translateX(-112%) rotate(-8deg);
	}

	.sgb-hero-books__cover.is-right {
		transform: translateX(12%) rotate(8deg);
	}

	.sgb-hero-books__card {
		position: relative;
		width: 100%;
		margin-top: -36px;
		text-align: left;
		animation: none;
	}

	.sgb-hero-books__badge {
		width: 46px;
		height: 46px;
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sgb-hero-books__cover,
	.sgb-hero-books__card {
		animation: none !important;
		transition: none !important;
	}
}

/* GreenShift Woo: giá & % giảm trong thẻ sách */
.sgb-price .gspb_price_value {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 8px;
}

.sgb-price .gspb_price_value del {
	order: 2;
}

.gspb-discountbox.sgb-sale-badge:not(:has(.gspb_discount_wrap)) {
	display: none;
}

.sgb-sale-badge .gspb_discount_value::before {
	content: "-";
}

/* Top bar trên nền xanh */
[data-row*="top"] .ct-header-text {
	color: rgba(255, 255, 255, 0.82);
}

[data-row*="top"] .ct-header-text strong {
	color: #fff;
}

[data-row*="top"] .ct-header-socials .ct-icon {
	fill: rgba(255, 255, 255, 0.85);
}

[data-row*="top"] .ct-header-text p {
	margin: 0;
}

.sgb-card-author a {
	text-decoration: none;
}

.sgb-card-author a:hover {
	color: var(--theme-palette-color-1);
	text-decoration: underline;
}

.sgb-book-card__title {
	min-height: 2.7em;
	margin-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   Nút sàn trên thẻ sách – kiểu gọn (soft pill)
   ----------------------------------------------------------------------- */
.sgb-buy-group--card {
	gap: 6px;
}

.sgb-buy-group--card .sgb-buy {
	--_soft: #fff2ee;
	--_line: #f9d5cb;
	--_ink: var(--sgb-shopee);
	min-height: 34px;
	padding: 6px 10px;
	gap: 5px;
	border: 1px solid var(--_line);
	border-radius: 8px;
	background: var(--_soft);
	color: var(--_ink) !important;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
	box-shadow: none;
}

.sgb-buy-group--card .sgb-buy--tiktok {
	--_soft: #f3f3f4;
	--_line: #e2e2e5;
	--_ink: #18181b;
}

.sgb-buy-group--card .sgb-buy .sgb-icon {
	width: 15px;
	height: 15px;
}

.sgb-buy-group--card .sgb-buy:hover,
.sgb-buy-group--card .sgb-buy:focus-visible {
	background: var(--_bg);
	border-color: var(--_bg);
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 14px -8px var(--_bg);
}

/* Icon TikTok có phần trắng – trên nền nhạt đổi sang màu chữ */
.sgb-buy-group--card .sgb-buy--tiktok .sgb-icon path[fill="#fff"] {
	fill: currentColor;
}

@media (max-width: 480px) {
	.sgb-buy-group--card .sgb-buy {
		min-height: 32px;
		padding: 5px 6px;
		font-size: 12px;
	}

	.sgb-buy-group--card .sgb-buy .sgb-icon {
		width: 14px;
		height: 14px;
	}
}

/* --------------------------------------------------------------------------
   Footer nền xanh đậm
   ----------------------------------------------------------------------- */
.ct-footer [data-row*="middle"],
.ct-footer [data-row*="bottom"] {
	color: rgba(255, 255, 255, 0.72);
}

.ct-footer [data-row*="middle"] .wp-block-heading,
.ct-footer [data-row*="middle"] .widget-title {
	color: #fff;
	font-family: inherit;
	font-weight: 700;
}

.ct-footer [data-row*="middle"] a,
.ct-footer [data-row*="bottom"] a {
	color: rgba(255, 255, 255, 0.78);
	text-decoration: none;
}

.ct-footer [data-row*="middle"] a:hover,
.ct-footer [data-row*="bottom"] a:hover {
	color: #f2a27f;
}

.ct-footer [data-row*="bottom"] {
	font-size: 14px;
}

.ct-footer .ct-footer-socials .ct-icon {
	fill: rgba(255, 255, 255, 0.8);
}

.ct-footer .sgb-footer-platforms .sgb-buy,
.ct-footer .sgb-footer-platforms a {
	color: #fff;
}

/* Sidebar bộ lọc: danh sách dài thì cuộn gọn */
.ct-sidebar .woocommerce-widget-layered-nav-list {
	max-height: 260px;
	overflow-y: auto;
	padding-right: 6px;
	scrollbar-width: thin;
}

.ct-sidebar .widget {
	margin-bottom: 36px;
}

.ct-sidebar .wc-block-product-categories-list {
	list-style: none;
	padding-left: 0;
}

.ct-sidebar .wc-block-product-categories-list--depth-1 {
	padding-left: 14px;
}

.ct-footer [data-row*="middle"],
.ct-footer [data-row*="bottom"] {
	--theme-text-color: rgba(255, 255, 255, 0.74);
	--theme-heading-color: #ffffff;
	--theme-link-initial-color: rgba(255, 255, 255, 0.8);
	--theme-link-hover-color: #f2a27f;
}

.ct-footer [data-row*="middle"] p,
.ct-footer [data-row*="middle"] li,
.ct-footer [data-row*="bottom"] .ct-footer-copyright {
	color: rgba(255, 255, 255, 0.74);
}

/* Sách chưa có ảnh bìa */
.sgb-book-card__cover:not(:has(img))::before {
	content: "SaigonBook";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		linear-gradient(135deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%) 0 0 / 18px 18px,
		linear-gradient(160deg, var(--theme-palette-color-1), #0b2420);
	color: rgba(255, 255, 255, 0.75);
	font-family: Lora, serif;
	font-size: 18px;
	font-weight: 700;
}

/* Nút sàn luôn thẳng hàng ở đáy thẻ, kể cả khi sách không có tác giả */
.gspbgrid_item > .sgb-card,
li.sgb-card-item > .sgb-card {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	height: auto;
}

.sgb-card > .sgb-book-card {
	flex: 1 1 auto;
	height: auto;
}

/* Dropdown menu: rộng theo mục dài nhất để chữ không xuống dòng */
@media (min-width: 1000px) {
	.ct-header [data-id="menu"] .sub-menu {
		width: max-content;
		min-width: var(--dropdown-width, 280px);
		max-width: 480px;
	}

	.ct-header [data-id="menu"] .sub-menu .ct-menu-link {
		white-space: nowrap;
	}
}

/* Tablet/mobile: dùng ngăn kéo "Bộ lọc" thay cho sidebar */
@media (max-width: 999.98px) {
	.woocommerce-shop .ct-sidebar,
	.tax-product_cat .ct-sidebar,
	.tax-pa_tac-gia .ct-sidebar,
	.tax-pa_nha-xuat-ban .ct-sidebar,
	.tax-product_tag .ct-sidebar {
		display: none;
	}
}

.ct-sidebar .ct-filter-widget-wrapper + .ct-filter-widget-wrapper,
.ct-sidebar .widget + .widget {
	margin-top: 8px;
}

/* Footer: thông tin công ty vận hành */
.ct-footer .sgb-footer-company {
	font-size: 13px;
	line-height: 1.5;
	letter-spacing: 0.01em;
	margin-bottom: 10px;
}
.ct-footer ul.sgb-footer-contact li {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-size: 14px;
	line-height: 1.55;
}
.ct-footer ul.sgb-footer-contact li > span { flex: 1; min-width: 0; }
.ct-footer [data-id="copyright"] a { text-decoration: underline; text-underline-offset: 2px; }

/* Thanh khuyến mãi trên cùng */
.sgb-topbar {
	background: var(--theme-palette-color-1);
	color: #fff;
	font-size: 13.5px;
	line-height: 1.4;
	text-align: center;
}
.sgb-topbar__inner {
	max-width: var(--theme-normal-container-max-width, 1290px);
	margin: 0 auto;
	padding: 8px 16px;
}
.sgb-topbar a { color: #fff; text-decoration: underline; }

/* Ô tìm sản phẩm trong header */
.sgb-search {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 620px;
	margin: 0 auto;
	background: var(--theme-palette-color-7);
	border: 2px solid var(--theme-palette-color-5);
	border-radius: 999px;
	padding: 4px 4px 4px 18px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sgb-search:focus-within {
	border-color: var(--theme-palette-color-1);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-palette-color-1) 15%, transparent);
	background: #fff;
}
.sgb-search input[type="search"] {
	flex: 1;
	min-width: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	height: 40px;
	padding: 0 !important;
	font-size: 15px;
}
.sgb-search button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 40px;
	min-height: 40px;
	padding: 0 18px;
	border-radius: 999px;
	background: var(--theme-palette-color-1);
	color: #fff;
	font-weight: 700;
	border: 0;
	cursor: pointer;
}
.sgb-search button:hover { background: var(--theme-palette-color-4); }
[data-id="text"]:has(.sgb-search) { width: 100%; }
[data-row*="middle"] [data-column="middle"] { flex: 1 1 auto; }
@media (max-width: 999px) {
	.sgb-search { max-width: none; padding-left: 14px; }
	.sgb-search button span { display: none; }
	.sgb-search button { padding: 0 12px; }
	.sgb-topbar { font-size: 12.5px; }
}

/* Mây thẻ (độ tuổi / nhu cầu) dạng nút bo tròn */
.widget_product_tag_cloud .tagcloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.widget_product_tag_cloud .tagcloud a {
	font-size: 13.5px !important;
	font-weight: 600;
	line-height: 1;
	padding: 9px 14px;
	border-radius: 999px;
	background: var(--theme-palette-color-7);
	border: 1px solid var(--theme-palette-color-5);
	color: var(--theme-palette-color-4);
	text-decoration: none;
	transition: all 0.2s ease;
}
.widget_product_tag_cloud .tagcloud a:hover {
	background: var(--theme-palette-color-1);
	border-color: var(--theme-palette-color-1);
	color: #fff;
}

/* Hàng nút danh mục con (trang danh mục) */
.sgb-subcats {
	position: relative;
	margin: 0 0 22px;
	width: 100%;
}
.sgb-subcats__track {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	padding: 4px 2px 8px;
	cursor: grab;
	-webkit-overflow-scrolling: touch;
}
.sgb-subcats__track::-webkit-scrollbar { display: none; }
.sgb-subcats__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.sgb-subcats__track.is-dragging a { pointer-events: none; }
.sgb-subcats__chip {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	scroll-snap-align: start;
	padding: 6px 14px 6px 6px;
	border-radius: 999px;
	border: 1.5px solid var(--theme-palette-color-5);
	background: #fff;
	color: var(--theme-palette-color-4);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none;
	user-select: none;
	transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.sgb-subcats__chip:hover {
	border-color: var(--theme-palette-color-1);
	color: var(--theme-palette-color-1);
}
.sgb-subcats__chip.is-active {
	background: var(--theme-palette-color-1);
	border-color: var(--theme-palette-color-1);
	color: #fff;
	box-shadow: 0 8px 18px -10px var(--theme-palette-color-1);
}
.sgb-subcats__icon {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--theme-palette-color-7);
}
.sgb-subcats__icon--all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	color: var(--theme-palette-color-1);
}
.sgb-subcats__chip.is-active .sgb-subcats__icon--all { background: rgba(255, 255, 255, 0.2); color: #fff; }
.sgb-subcats__count {
	font-size: 12px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--theme-palette-color-7);
	color: var(--theme-palette-color-3);
}
.sgb-subcats__chip.is-active .sgb-subcats__count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.sgb-subcats__arrow {
	position: absolute;
	top: calc(50% - 4px);
	transform: translateY(-50%);
	z-index: 2;
	width: 34px;
	height: 34px;
	min-height: 0;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--theme-palette-color-5);
	background: #fff;
	color: var(--theme-palette-color-4);
	font-size: 20px;
	line-height: 1;
	box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.3);
	cursor: pointer;
}
.sgb-subcats__arrow.is-prev { left: -6px; }
.sgb-subcats__arrow.is-next { right: -6px; }
.sgb-subcats__arrow:hover { color: var(--theme-palette-color-1); border-color: var(--theme-palette-color-1); }
.sgb-subcats.has-next::after,
.sgb-subcats.has-prev::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 8px;
	width: 48px;
	pointer-events: none;
	z-index: 1;
}
.sgb-subcats.has-next::after { right: 0; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 80%); }
.sgb-subcats.has-prev::before { left: 0; background: linear-gradient(270deg, rgba(255, 255, 255, 0), #fff 80%); }
@media (hover: none), (max-width: 689px) {
	.sgb-subcats__arrow { display: none; }
	.sgb-subcats__chip { font-size: 13.5px; }
}

/* Đầu trang danh mục: nền gradient + icon danh mục nhỏ phía trên tiêu đề (thay ảnh nền phóng to) */
.tax-product_cat .hero-section[data-type="type-2"] {
	background: radial-gradient(circle at 85% 0%, var(--theme-palette-color-6) 0%, rgba(255, 255, 255, 0) 55%), linear-gradient(180deg, var(--theme-palette-color-7) 0%, #fff 100%);
	--min-height: 0;
	min-height: 0;
	padding: 36px 0 28px;
}
.tax-product_cat .hero-section[data-type="type-2"] > figure {
	position: static;
	display: flex;
	justify-content: center;
	margin: 0 0 10px;
	height: auto;
}
.tax-product_cat .hero-section[data-type="type-2"] > figure::after { display: none; }
.tax-product_cat .hero-section[data-type="type-2"] .ct-media-container {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.35);
}
.tax-product_cat .hero-section[data-type="type-2"] .ct-media-container img {
	position: static;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.tax-product_cat .hero-section[data-type="type-2"] .entry-header { padding: 0 16px; }
.tax-product_cat .hero-section[data-type="type-2"] .page-title { color: var(--theme-palette-color-4); }
.tax-product_cat .hero-section[data-type="type-2"] .page-description { color: var(--theme-palette-color-3); max-width: 640px; margin: 8px auto 0; }

/* Widget danh mục ở thanh bên */
.widget_product_categories {
	background: #fff;
	border: 1px solid var(--theme-palette-color-5);
	border-radius: 20px;
	padding: 18px 14px 12px;
	box-shadow: 0 14px 34px -28px rgba(0, 0, 0, 0.35);
}
.widget_product_categories .widget-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 17px;
	margin: 0 6px 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--theme-palette-color-5);
}
.widget_product_categories .widget-title::before {
	content: "";
	width: 4px;
	height: 18px;
	border-radius: 4px;
	background: var(--theme-palette-color-1);
}
.widget_product_categories ul.product-categories,
.widget_product_categories ul.children {
	list-style: none;
	margin: 0;
	padding: 0;
}
.sgb-cat-item { margin: 0; }
.sgb-cat-item__row {
	display: flex;
	align-items: center;
	gap: 4px;
	border-radius: 14px;
	transition: background 0.2s ease;
}
.sgb-cat-item__row:hover { background: var(--theme-palette-color-7); }
.sgb-cat-item__link {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 8px;
	color: var(--theme-palette-color-4);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}
.sgb-cat-item__link:hover { color: var(--theme-palette-color-1); }
.sgb-cat-item__icon {
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border-radius: 50%;
	object-fit: cover;
	background: var(--theme-palette-color-7);
}
.sgb-cat-item__icon--empty {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	color: var(--theme-palette-color-1);
}
.sgb-cat-item__name { flex: 1; min-width: 0; }
.sgb-cat-item__count {
	flex-shrink: 0;
	min-width: 26px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--theme-palette-color-7);
	color: var(--theme-palette-color-3);
	font-size: 12px;
	font-weight: 700;
	text-align: center;
}
.sgb-cat-item__toggle {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	min-height: 0;
	padding: 0;
	margin-right: 4px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--theme-palette-color-3);
	cursor: pointer;
	transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}
.sgb-cat-item__toggle:hover { background: var(--theme-palette-color-6); color: var(--theme-palette-color-1); }
.sgb-cat-item.is-open > .sgb-cat-item__row .sgb-cat-item__toggle { transform: rotate(90deg); color: var(--theme-palette-color-1); }
/* Danh mục con: thu gọn, đường dẫn bên trái */
.sgb-cat-item > ul.children {
	display: none;
	margin: 2px 0 6px 25px;
	border-left: 2px solid var(--theme-palette-color-5);
}
.sgb-cat-item.is-open > ul.children {
	display: block;
	animation: sgbCatOpen 0.25s ease;
}
@keyframes sgbCatOpen {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}
.sgb-cat-item.is-depth-1 .sgb-cat-item__link {
	font-size: 14px;
	font-weight: 500;
	padding: 6px 10px 6px 14px;
	color: var(--theme-palette-color-3);
}
.sgb-cat-item.is-depth-1 .sgb-cat-item__row { border-radius: 10px; margin-left: 6px; }
/* Mục đang xem */
.sgb-cat-item.current-cat > .sgb-cat-item__row { background: var(--theme-palette-color-6); }
.sgb-cat-item.current-cat > .sgb-cat-item__row .sgb-cat-item__link { color: var(--theme-palette-color-1); font-weight: 700; }
.sgb-cat-item.current-cat > .sgb-cat-item__row .sgb-cat-item__count { background: var(--theme-palette-color-1); color: #fff; }
.sgb-cat-item.current-cat-parent > .sgb-cat-item__row .sgb-cat-item__link { color: var(--theme-palette-color-1); }
.sgb-cat-item.is-depth-1.current-cat > .sgb-cat-item__row { box-shadow: inset 3px 0 0 var(--theme-palette-color-1); }

/* Widget lọc (giá, thương hiệu, nhãn, đang lọc): khung thẻ thống nhất với widget danh mục */
.widget_price_filter,
.widget_layered_nav,
.widget_product_tag_cloud,
.widget_layered_nav_filters {
	background: #fff;
	border: 1px solid var(--theme-palette-color-5);
	border-radius: 20px;
	padding: 18px 18px 16px;
	box-shadow: 0 14px 34px -28px rgba(0, 0, 0, 0.35);
}
.widget_price_filter .widget-title,
.widget_layered_nav .widget-title,
.widget_product_tag_cloud .widget-title,
.widget_layered_nav_filters .widget-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 17px;
	margin: 0 0 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--theme-palette-color-5);
}
.widget_price_filter .widget-title::before,
.widget_layered_nav .widget-title::before,
.widget_product_tag_cloud .widget-title::before,
.widget_layered_nav_filters .widget-title::before {
	content: "";
	width: 4px;
	height: 18px;
	border-radius: 4px;
	background: var(--theme-palette-color-1);
}

/* Thanh kéo giá (jQuery UI) */
.widget_price_filter .price_slider {
	position: relative;
	height: 6px;
	margin: 10px 9px 22px;
	border-radius: 999px;
	background: var(--theme-palette-color-5);
}
.widget_price_filter .ui-slider-range {
	position: absolute;
	top: 0;
	height: 100%;
	border-radius: 999px;
	background: var(--theme-palette-color-1);
}
.widget_price_filter .ui-slider-handle {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 20px;
	height: 20px;
	margin-left: -10px;
	transform: translateY(-50%);
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--theme-palette-color-1);
	box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.35);
	cursor: grab;
	outline: none;
	touch-action: none;
}
.widget_price_filter .ui-slider-handle:focus-visible,
.widget_price_filter .ui-slider-handle.ui-state-active {
	box-shadow: 0 0 0 6px color-mix(in srgb, var(--theme-palette-color-1) 20%, transparent);
	cursor: grabbing;
}
.widget_price_filter .price_slider_amount {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.widget_price_filter .price_slider_amount .price_label {
	order: -1;
	flex: 1 1 100%;
	font-size: 14px;
	font-weight: 600;
	color: var(--theme-palette-color-4);
}
.widget_price_filter .price_slider_amount .price_label span {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 8px;
	background: var(--theme-palette-color-7);
	color: var(--theme-palette-color-1);
}
.widget_price_filter .price_slider_amount .button {
	min-height: 38px;
	padding: 0 20px;
	border-radius: 999px;
	font-size: 14px;
	margin-left: auto;
}
.widget_price_filter .price_slider_amount .clear { display: none; }
.sgb-price-ranges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px dashed var(--theme-palette-color-5);
}
.sgb-price-ranges__chip {
	padding: 7px 12px;
	border-radius: 999px;
	border: 1px solid var(--theme-palette-color-5);
	background: var(--theme-palette-color-7);
	color: var(--theme-palette-color-4);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: all 0.2s ease;
}
.sgb-price-ranges__chip:hover { border-color: var(--theme-palette-color-1); color: var(--theme-palette-color-1); }
.sgb-price-ranges__chip.is-active { background: var(--theme-palette-color-1); border-color: var(--theme-palette-color-1); color: #fff; }
.sgb-price-ranges__clear {
	display: inline-block;
	margin-top: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--theme-palette-color-2);
	text-decoration: none;
}

/* Lọc theo thuộc tính (thương hiệu…): ô tick + số lượng */
.woocommerce-widget-layered-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 320px;
	overflow-y: auto;
	scrollbar-width: thin;
}
.woocommerce-widget-layered-nav-list__item {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 2px 0;
	font-size: 14.5px;
}
.woocommerce-widget-layered-nav-list__item > a {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 6px;
	border-radius: 10px;
	color: var(--theme-palette-color-4);
	font-weight: 500;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}
.woocommerce-widget-layered-nav-list__item > a::before {
	content: "";
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border-radius: 6px;
	border: 2px solid var(--theme-palette-color-5);
	background: #fff center / 12px no-repeat;
	transition: all 0.2s ease;
}
.woocommerce-widget-layered-nav-list__item > a:hover { background: var(--theme-palette-color-7); color: var(--theme-palette-color-1); }
.woocommerce-widget-layered-nav-list__item > a:hover::before { border-color: var(--theme-palette-color-1); }
.woocommerce-widget-layered-nav-list__item--chosen > a { color: var(--theme-palette-color-1); font-weight: 700; }
.woocommerce-widget-layered-nav-list__item--chosen > a::before {
	border-color: var(--theme-palette-color-1);
	background-color: var(--theme-palette-color-1);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.woocommerce-widget-layered-nav-list__item .count {
	flex-shrink: 0;
	min-width: 26px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--theme-palette-color-7);
	color: var(--theme-palette-color-3);
	font-size: 12px;
	font-weight: 700;
	text-align: center;
}
/* Đang lọc: nhãn có nút xoá */
.widget_layered_nav_filters ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.widget_layered_nav_filters li a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--theme-palette-color-6);
	color: var(--theme-palette-color-1);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}
.widget_layered_nav_filters li a::before { content: "✕"; font-size: 11px; }
.ct-sidebar .ct-widget + .ct-widget { margin-top: 22px; }

/* Nút "Bộ lọc" + ngăn kéo thanh bên (dưới 1000px) */
.sgb-filter-toggle,
.sgb-drawer-head { display: none; }
@media (max-width: 999.98px) {
	.sgb-filter-toggle {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		min-height: 40px;
		padding: 0 16px;
		margin: 0 8px 14px 0;
		border-radius: 999px;
		border: 1.5px solid var(--theme-palette-color-5);
		background: #fff;
		color: var(--theme-palette-color-4);
		font-weight: 700;
		font-size: 14px;
		cursor: pointer;
	}
	.sgb-filter-toggle__count {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 20px;
		height: 20px;
		padding: 0 6px;
		border-radius: 999px;
		background: var(--theme-palette-color-1);
		color: #fff;
		font-size: 12px;
	}
	#sidebar.ct-hidden-sm,
	#sidebar.ct-hidden-md {
		display: block !important;
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 100000;
		width: min(88vw, 380px);
		max-width: none;
		margin: 0;
		padding: 0 16px 28px;
		overflow-y: auto;
		background: var(--theme-palette-color-7);
		box-shadow: 20px 0 60px -20px rgba(0, 0, 0, 0.35);
		transform: translateX(-105%);
		transition: transform 0.3s ease;
		visibility: hidden;
	}
	body.sgb-filters-open #sidebar { transform: none; visibility: visible; }
	#sidebar .ct-sidebar { display: block !important; position: static !important; }
	.sgb-drawer-head {
		position: sticky;
		top: 0;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0 -16px 16px;
		padding: 16px;
		background: var(--theme-palette-color-7);
		border-bottom: 1px solid var(--theme-palette-color-5);
		font-size: 18px;
	}
	.sgb-drawer-close {
		width: 36px;
		height: 36px;
		min-height: 0;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: #fff;
		color: var(--theme-palette-color-4);
		font-size: 16px;
		cursor: pointer;
	}
	.sgb-drawer-backdrop {
		position: fixed;
		inset: 0;
		z-index: 99999;
		background: rgba(0, 0, 0, 0.4);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s ease;
	}
	body.sgb-filters-open { overflow: hidden; }
	body.sgb-filters-open .sgb-drawer-backdrop { opacity: 1; pointer-events: auto; }
}

/* ============ Menu điện thoại (offcanvas) ============ */
#offcanvas .ct-panel-inner {
	background: #fff !important;
	width: min(88vw, 380px);
	max-width: none;
	box-shadow: -24px 0 60px -20px rgba(0, 0, 0, 0.35);
}
#offcanvas[data-behaviour="right-side"] .ct-panel-inner { border-radius: 24px 0 0 24px; }
#offcanvas[data-behaviour="left-side"] .ct-panel-inner { border-radius: 0 24px 24px 0; }
#offcanvas .ct-panel-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px 14px;
	border-bottom: 1px solid var(--theme-palette-color-5);
	background: linear-gradient(180deg, var(--theme-palette-color-7) 0%, #fff 100%);
}
.sgb-oc-brand { display: inline-flex; align-items: center; min-width: 0; }
.sgb-oc-brand img { display: block; height: 42px; width: auto; max-width: 220px; object-fit: contain; }
#offcanvas .ct-toggle-close {
	position: static;
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 50%;
	background: var(--theme-palette-color-7);
	color: var(--theme-palette-color-4);
	--theme-icon-color: var(--theme-palette-color-4);
	--theme-icon-hover-color: var(--theme-palette-color-1);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
#offcanvas .ct-panel-content { padding-top: 10px; }
#offcanvas .ct-panel-content-inner { padding: 4px 16px 24px; gap: 18px; }

/* Mục cấp 1 */
#offcanvas .mobile-menu { width: 100%; --theme-link-initial-color: var(--theme-palette-color-4); --theme-link-hover-color: var(--theme-palette-color-1); --theme-link-active-color: var(--theme-palette-color-1); }
#offcanvas .mobile-menu > ul > li { border-bottom: 1px solid var(--theme-palette-color-5); }
#offcanvas .mobile-menu > ul > li:last-child { border-bottom: 0; }
#offcanvas .mobile-menu .ct-menu-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 4px;
	font-size: 15.5px;
	font-weight: 700;
	color: var(--theme-palette-color-4);
	--menu-item-padding: 0;
}
#offcanvas .mobile-menu .current-menu-item > .ct-menu-link,
#offcanvas .mobile-menu .current-menu-item > .ct-sub-menu-parent > .ct-menu-link,
#offcanvas .mobile-menu .current-menu-ancestor > .ct-sub-menu-parent > .ct-menu-link { color: var(--theme-palette-color-1); }
#offcanvas .ct-sub-menu-parent { display: flex; align-items: center; justify-content: space-between; }
#offcanvas .ct-sub-menu-parent .ct-menu-link { flex: 1; }
#offcanvas .ct-toggle-dropdown-mobile {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--theme-palette-color-7);
	color: var(--theme-palette-color-4);
	--theme-icon-color: var(--theme-palette-color-3);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.25s ease;
}
#offcanvas .dropdown-active > .ct-sub-menu-parent .ct-toggle-dropdown-mobile { background: var(--theme-palette-color-1); --theme-icon-color: #fff; }
.sgb-menu-icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 12px;
	background: var(--theme-palette-color-7);
	color: var(--theme-palette-color-1);
}
.sgb-menu-icon--img { object-fit: cover; border-radius: 50%; padding: 0; }
.sgb-menu-label { min-width: 0; }
#offcanvas .current-menu-item > .ct-menu-link .sgb-menu-icon--svg { background: var(--theme-palette-color-1); color: #fff; }

/* Danh mục con: lưới 2 cột dạng ô */
#offcanvas .mobile-menu .sub-menu {
	margin: 0 0 12px;
	padding: 0;
}
#offcanvas .mobile-menu .dropdown-active > .sub-menu {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	height: auto !important;
}
#offcanvas .mobile-menu .sub-menu > li { margin: 0; min-width: 0; }
#offcanvas .mobile-menu .sub-menu .ct-menu-link {
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	height: 100%;
	min-height: 96px;
	padding: 12px 8px;
	border-radius: 16px;
	border: 1px solid var(--theme-palette-color-5);
	background: var(--theme-palette-color-7);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
}
#offcanvas .mobile-menu .sub-menu .ct-menu-link:hover,
#offcanvas .mobile-menu .sub-menu .current-menu-item > .ct-menu-link { border-color: var(--theme-palette-color-1); background: #fff; }
#offcanvas .mobile-menu .sub-menu .sgb-menu-icon { width: 44px; height: 44px; }
#offcanvas .mobile-menu .sub-menu .ct-menu-link::before { display: none; }

/* Nút ưu đãi, mạng xã hội, liên hệ */
#offcanvas [data-id="button"] { width: 100%; }
#offcanvas [data-id="button"] .ct-button { width: 100%; justify-content: center; min-height: 48px; border-radius: 999px; font-weight: 700; }
#offcanvas [data-id="socials"] { justify-content: center; width: 100%; }
#offcanvas [data-id="socials"] .ct-social-box { justify-content: center; gap: 10px; }
#offcanvas [data-id="socials"] a { width: 40px; height: 40px; border-radius: 50%; background: var(--theme-palette-color-7); display: inline-flex; align-items: center; justify-content: center; --theme-icon-color: var(--theme-palette-color-4); }
.sgb-oc-contact {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 6px 10px;
	width: 100%;
	padding: 14px 16px;
	border-radius: 18px;
	background: linear-gradient(135deg, var(--theme-palette-color-6) 0%, var(--theme-palette-color-7) 100%);
	border: 1px solid var(--theme-palette-color-5);
}
.sgb-oc-contact__label { grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--theme-palette-color-3); }
.sgb-oc-contact__tel { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 17px; font-weight: 800; color: var(--theme-palette-color-4); text-decoration: none; }
.sgb-oc-contact__tel svg { color: var(--theme-palette-color-1); }
.sgb-oc-contact__zalo { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: #0068FF; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }

/* Menu thả xuống (máy tính): rộng tối đa 300px */
.ct-header [data-id="menu"] {
	--dropdown-width: 300px;
}
.ct-header [data-id="menu"] .sub-menu {
	width: 300px;
	max-width: 300px;
}
.ct-header [data-id="menu"] .sub-menu .ct-menu-link {
	white-space: normal;
}

/* Chữ nhấn ở hero theo màu thương hiệu (thay màu cam Shopee của theme gốc) */
.sgb-hl {
	color: var(--theme-palette-color-1);
	background: linear-gradient(transparent 64%, color-mix(in srgb, var(--theme-palette-color-1) 16%, transparent) 64%);
}

/* ============ "Vì sao chọn" trên điện thoại: lưới 2×2 thẻ nhỏ gọn ============ */
@media (max-width: 689.98px) {
	section.sgb-why { padding-top: 40px !important; padding-bottom: 40px !important; }
	.sgb-why h2 { font-size: 22px !important; line-height: 1.3 !important; margin-bottom: 0 !important; }
	.sgb-why h2 + p { margin-top: 10px !important; font-size: 14.5px !important; line-height: 1.6 !important; }
	.sgb-why [data-type="content-area-component"] > div:first-child:not(:has(h3)) { margin-bottom: 18px !important; }
	/* Lưới thẻ */
	.sgb-why div:has(> div > h3) {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 10px !important;
	}
	/* Thẻ */
	.sgb-why div:has(> h3) {
		display: flex !important;
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 6px !important;
		padding: 14px 12px 14px !important;
		border-radius: 16px !important;
		min-width: 0;
	}
	.sgb-why div:has(> h3) > span:first-child,
	.sgb-why div:has(> h3) > svg:first-child {
		width: 38px !important;
		height: 38px !important;
		min-width: 38px;
		padding: 9px !important;
		border-radius: 12px !important;
		font-size: 20px !important;
		line-height: 1 !important;
		margin-bottom: 2px;
	}
	.sgb-why div:has(> h3) > h3 {
		font-size: 14.5px !important;
		line-height: 1.3 !important;
		margin: 2px 0 0 !important;
	}
	.sgb-why div:has(> h3) > p {
		font-size: 12.5px !important;
		line-height: 1.45 !important;
		margin: 0 !important;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	/* SaigonBook: 3 bước mua sách gọn hơn */
	.sgb-why div:has(> div > span + div) { gap: 12px !important; margin-bottom: 20px !important; }
	.sgb-why div:has(> span + div) > span { width: 34px !important; height: 34px !important; font-size: 15px !important; }
	.sgb-why div:has(> span + div) > div > div:first-child { font-size: 15px !important; }
	.sgb-why div:has(> span + div) > div > div:last-child { font-size: 13px !important; }
	.sgb-why [data-type="content-area-component"] > div:first-child:has(h3) { gap: 24px !important; }
}

/* Trang chủ: hero sát header (bỏ khoảng đệm 50px của khung nội dung Blocksy) */
.home #main > .ct-container-full:first-child,
.home #main > .ct-container-full { padding-top: 0 !important; }

/* Ô tìm kiếm: không còn khung chữ nhật bên trong khi focus; cỡ chữ 16px để iOS không tự phóng to */
.sgb-search input[type="search"],
.sgb-search input[type="search"]:focus,
.sgb-search input[type="search"]:focus-visible {
	-webkit-appearance: none;
	appearance: none;
	outline: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}
.sgb-search input[type="search"]::-webkit-search-decoration,
.sgb-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
@media (max-width: 999.98px) {
	.sgb-search input[type="search"] { font-size: 16px !important; }
	.sgb-search { box-shadow: none; }
}

/* Khối mua: dải tiết kiệm (số tiền + % giảm) dưới tiêu đề */
.sgb-buybox__head { margin-bottom: 10px; }
.sgb-buybox__save {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	padding: 8px 10px 8px 12px;
	border-radius: 12px;
	border: 1px dashed color-mix(in srgb, var(--theme-palette-color-1) 40%, transparent);
	background: color-mix(in srgb, var(--theme-palette-color-1) 7%, #fff);
	color: var(--theme-palette-color-4);
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.3;
	white-space: normal;
}
.sgb-buybox__save-icon { display: inline-flex; color: var(--theme-palette-color-1); flex-shrink: 0; }
.sgb-buybox__save-text { flex: 1; min-width: 0; }
.sgb-buybox__save-text strong { color: var(--theme-palette-color-1); font-weight: 800; white-space: nowrap; }
.sgb-buybox__save-pct {
	flex-shrink: 0;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--theme-palette-color-1);
	color: #fff;
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

/* Điện thoại: chặn mọi phần tử tràn ngang (không tạo vùng cuộn mới nên header dính vẫn chạy) */
html, body { max-width: 100%; overflow-x: clip; }
@supports not (overflow: clip) { body { overflow-x: hidden; } }
.sgb-search input[type="search"]::-webkit-search-decoration,
.sgb-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.sgb-search, .sgb-search * { -webkit-tap-highlight-color: transparent; }
.sgb-search:focus-within { outline: none; }

/* Hero trên điện thoại: 2 nút chính cùng một hàng; hàng nhãn / "Tìm theo xe" thành dải vuốt ngang */
@media (max-width: 689.98px) {
	.sgb-hero h1 + style + p + style + div {
		display: flex !important; flex-wrap: nowrap !important; gap: 8px !important; justify-content: stretch !important;
	}
	.sgb-hero h1 + style + p + style + div > a {
		flex: 1 1 0; min-width: 0; min-height: 46px !important;
		padding-left: 10px !important; padding-right: 10px !important;
		font-size: clamp(13px, 3.7vw, 15px) !important; white-space: nowrap; justify-content: center; text-align: center;
	}
	.sgb-hero h1 ~ ul,
	.sgb-hero h1 + style + p + style + div + style + div {
		display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-snap-type: x proximity;
		margin-right: calc(-1 * var(--wp--custom--spacing--side, min(3vw, 20px))) !important;
		padding-right: var(--wp--custom--spacing--side, min(3vw, 20px)); padding-bottom: 2px;
		-webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent);
	}
	.sgb-hero h1 ~ ul::-webkit-scrollbar,
	.sgb-hero h1 + style + p + style + div + style + div::-webkit-scrollbar { display: none; }
	.sgb-hero h1 ~ ul > li,
	.sgb-hero h1 + style + p + style + div + style + div > * { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; }
	/* Căn giữa an toàn: vừa khung thì ở giữa, tràn thì cuộn được từ đầu */
	.sgb-hero:not(.sgb-hero--moto) h1 ~ ul { justify-content: flex-start !important; }
	.sgb-hero:not(.sgb-hero--moto) h1 ~ ul > li:first-of-type { margin-left: auto; }
	.sgb-hero:not(.sgb-hero--moto) h1 ~ ul > li:last-of-type { margin-right: auto; }
}
@media (max-width: 689.98px) {
	/* Khối chữ hero không được rộng hơn màn hình (dải vuốt ngang tự cuộn bên trong) */
	.sgb-hero div:has(> h1) { width: 100%; max-width: 100%; min-width: 0; align-self: stretch; }
	.sgb-hero h1 ~ ul, .sgb-hero h1 + style + p + style + div { max-width: 100%; min-width: 0; }
}

/* Menu máy tính: khoảng cách giữa icon danh mục và tên */
#header .ct-menu-link .sgb-menu-icon { width: 30px; height: 30px; margin-right: 10px; }
#header .sub-menu .ct-menu-link .sgb-menu-icon { width: 26px; height: 26px; margin-right: 10px; }

/* Header máy tính: ô tìm kiếm chiếm phần giữa rộng hơn (logo + nút hai bên co theo nội dung) */
@media (min-width: 1000px) {
	#header [data-device="desktop"] [data-row*="middle"] > .ct-container:has([data-column="middle"] .sgb-search) {
		grid-template-columns: auto minmax(0, 1fr) auto !important; column-gap: 36px;
	}
	#header [data-device="desktop"] [data-column="middle"]:has(.sgb-search) { justify-content: center; }
	#header [data-device="desktop"] [data-column="middle"]:has(.sgb-search) > *,
	#header [data-device="desktop"] [data-column="middle"] .entry-content { width: 100%; }
	#header .sgb-search { max-width: 720px; margin-left: auto; margin-right: auto; }
}
