/**
 * Flatsome Lite - Category SEO Content Styles
 * Chuẩn SEO & Flat Design, responsive hoàn hảo trên mọi thiết bị.
 */

/* Ẩn triệt để mô tả danh mục ở phía trên đầu danh sách sản phẩm */
.category-page-container > .category-seo-plain,
.category-page-container > .category-seo-box,
.category-header-wrapper + .category-seo-plain,
.category-header-wrapper + .category-seo-box,
.woocommerce-products-header .term-description,
.category-page-container > .term-description,
.category-page-row > .col > .category-seo-plain,
.category-page-row > .col > .category-seo-box,
.category-seo-plain,
.category-seo-box {
	display: none !important;
}

/* Subcategories & Related Categories Bar */
.category-header-wrapper {
	margin-bottom: 20px;
}

.category-breadcrumbs-wrapper.category-breadcrumbs,
.category-header-wrapper .category-breadcrumbs {
	margin-bottom: 6px;
	font-size: 13px;
	color: #64748b;
}

.category-header-wrapper .category-page-title,
.category-header-wrapper .category-title {
	margin-top: 0;
	margin-bottom: 12px;
	font-weight: 700;
	font-size: 26px;
	line-height: 1.25;
	color: #0f172a;
}

.category-subcategories-wrapper {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
	width: 100%;
}

.category-subcategories-wrapper:empty {
	margin-bottom: 0;
	display: none;
}

.category-subcategories-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.category-subcategory-pill {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	color: #334155;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	transition: all 0.2s ease-in-out;
}

.category-subcategory-pill:hover {
	background: #0284c7;
	border-color: #0284c7;
	color: #ffffff;
	box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}

/* Top Content danh mục sản phẩm (term_meta[cat_header]) */
.custom-category-header,
.category-top-content {
	margin-bottom: 24px;
	font-size: 14.5px;
	line-height: 1.7;
	color: #334155;
}

.category-top-content > *:last-child,
.category-top-content p:last-child {
	margin-bottom: 0 !important;
}

.category-seo-bottom-wrapper {
	margin-top: 40px;
	margin-bottom: 40px;
	width: 100%;
}

.category-seo-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 10px;
	position: relative;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
	box-sizing: border-box;
}

/* Các section UX Builder nằm trong #categorySeoBottom */
#categorySeoBottom .container .section,
#categorySeoBottom .row .section,
.category-seo-bottom-wrapper .container .section,
.category-seo-bottom-wrapper .row .section {
	padding-left: 0;
	padding-right: 0;
}

@media (max-width: 849px) {
	div#categorySeoBottom {
		padding: 0;
		margin-left: -15px;
		margin-right: -15px;
		width: 100vw;
		max-width: 100vw;
		box-sizing: border-box;
	}

	.category-seo-card {
		padding: 10px;
	}

	div#categorySeoBottom .container .section,
	div#categorySeoBottom .row .section,
	#categorySeoBottom .container .section,
	#categorySeoBottom .row .section {
		padding-left: 0;
		padding-right: 0;
	}
}

/* Collapsible state with max-height */
.category-seo-card.is-collapsible .category-seo-content {
	max-height: var(--cat-max-height, 380px);
	overflow: hidden;
	transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-seo-card.is-collapsible.is-expanded .category-seo-content {
	max-height: none !important;
	overflow: visible;
}

/* Gradient overlay at bottom */
.category-seo-card.is-collapsible .category-seo-gradient {
	position: absolute;
	bottom: 56px;
	left: 0;
	right: 0;
	height: 110px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.92) 70%, #ffffff 100%);
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.3s ease;
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
}

.category-seo-card.is-collapsible.is-expanded .category-seo-gradient {
	opacity: 0;
	visibility: hidden;
}

/* Action button bar */
.category-seo-action-bar {
	position: relative;
	text-align: center;
	margin-top: 14px;
	z-index: 2;
}

.category-seo-btn-readmore {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 24px;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	color: #0284c7;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.category-seo-btn-readmore:hover {
	background: #f0f9ff;
	border-color: #0284c7;
	color: #0369a1;
	box-shadow: 0 3px 10px rgba(2, 132, 199, 0.12);
}

.category-seo-card.is-expanded .category-seo-btn-readmore .btn-arrow-icon {
	transform: rotate(180deg);
}

/* Term description content at bottom */
.category-term-description-content {
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px dashed #e2e8f0;
}

.category-term-description-content:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.category-ux-block-content {
	width: 100%;
}

/* Typography styles inside category SEO */
.category-seo-content h2 {
	font-size: 1.35rem;
	font-weight: 700;
	color: #0f172a;
	margin-top: 24px;
	margin-bottom: 12px;
	position: relative;
	padding-left: 14px;
}

.category-seo-content h2:first-child {
	margin-top: 0;
}

.category-seo-content h2::before {
	content: '';
	position: absolute;
	left: 0;
	top: 4px;
	bottom: 4px;
	width: 4px;
	background: #0284c7;
	border-radius: 2px;
}

.category-seo-content h3 {
	font-size: 1.15rem;
	font-weight: 700;
	color: #1e293b;
	margin-top: 18px;
	margin-bottom: 10px;
}

.category-seo-content p {
	font-size: 14.5px;
	line-height: 1.7;
	color: #334155;
	margin-bottom: 16px;
}

.category-seo-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 14px auto;
	display: block;
}

.category-seo-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 18px 0;
	font-size: 13.5px;
}

.category-seo-content table th,
.category-seo-content table td {
	border: 1px solid #e2e8f0;
	padding: 10px 14px;
}

.category-seo-content table th {
	background: #f8fafc;
	font-weight: 700;
	color: #0f172a;
}
