/*!
 * Tuidanam Product Description Read More
 * Version: 1.1.0
 *
 * Presentation:
 * - Technical/editorial
 * - Flat surface
 * - Small radius
 * - Clear borders
 * - No gold gradient or rounded marketing button
 */

:root {
	--tdn-readmore-max-height: 800px;
	--tdn-readmore-ink: #202522;
	--tdn-readmore-muted: #66706a;
	--tdn-readmore-line: #d7ddd9;
	--tdn-readmore-line-strong: #aab5ae;
	--tdn-readmore-paper: #f7f8f6;
	--tdn-readmore-surface: #ffffff;
	--tdn-readmore-accent: #3f5d4d;
	--tdn-readmore-accent-dark: #30483b;
	--tdn-readmore-accent-soft: #e8eeea;
	--tdn-readmore-focus: 0 0 0 3px rgba(63, 93, 77, 0.20);
}

.single-product-page #tab-description {
	position: relative;
	overflow: visible;
}

.single-product-page #tab-description.tdn-is-collapsed {
	max-height: var(--tdn-readmore-max-height);
	overflow: hidden;
}

/*
 * Giữ nguyên cơ chế ẩn tab chưa active của Flatsome.
 */
.single-product-page .tab-panels #tab-description.panel:not(.active) {
	height: 0 !important;
	overflow: hidden;
	padding-bottom: 0;
}

/*
 * Vùng điều khiển.
 */
.tdn-product-readmore {
	width: 100%;
	box-sizing: border-box;
	text-align: center;
}

/*
 * Trạng thái thu gọn:
 * control nằm tại đáy vùng nội dung bị giới hạn.
 */
#tab-description.tdn-is-collapsed > .tdn-product-readmore {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 20;
	padding-top: 54px;
	background:
		linear-gradient(
			to bottom,
			rgba(255, 255, 255, 0) 0%,
			rgba(255, 255, 255, 0.88) 52%,
			rgba(255, 255, 255, 1) 100%
		);
}

/*
 * Trạng thái mở:
 * control quay về document flow.
 */
#tab-description:not(.tdn-is-collapsed) > .tdn-product-readmore {
	position: relative;
	z-index: 1;
	margin-top: 28px;
	padding-top: 18px;
	border-top: 1px solid var(--tdn-readmore-line);
	background: transparent;
}

/*
 * Nút theo phong cách technical/editorial:
 * - không pill;
 * - không uppercase toàn bộ;
 * - border rõ;
 * - icon dạng dấu cộng/trừ tự dựng bằng CSS.
 */
.single-product-page
#tab-description
.tdn-product-readmore
.tdn-product-readmore__button {
	position: relative;
	display: inline-grid;
	grid-template-columns: auto auto 18px;
	width: max-content;
	max-width: 100%;
	white-space: nowrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 44px;
	padding: 10px 16px 10px 18px;
	border: 1px solid var(--tdn-readmore-line-strong);
	border-radius: 3px;
	outline: 0;
	background-color: var(--tdn-readmore-surface);
	background-image: none;
	color: var(--tdn-readmore-ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
	transition:
		border-color 0.18s ease,
		background-color 0.18s ease,
		color 0.18s ease,
		transform 0.18s ease;
}

/*
 * Trạng thái mặc định và trạng thái sau khi đã bấm.
 * Khóa màu để CSS button chung của theme không đổi sang vàng.
 */
.single-product-page
#tab-description
.tdn-product-readmore
.tdn-product-readmore__button:visited,
.single-product-page
#tab-description
.tdn-product-readmore
.tdn-product-readmore__button[aria-expanded="false"] {
	border-color: var(--tdn-readmore-line-strong);
	background-color: var(--tdn-readmore-surface);
	background-image: none;
	color: var(--tdn-readmore-ink);
	text-shadow: none;
	box-shadow: none;
}

/*
 * Hover.
 */
.single-product-page
#tab-description
.tdn-product-readmore
.tdn-product-readmore__button:hover {
	border-color: var(--tdn-readmore-accent);
	background-color: var(--tdn-readmore-paper);
	background-image: none;
	color: var(--tdn-readmore-accent-dark);
	text-shadow: none;
	box-shadow: none;
	transform: translateY(-1px);
}

/*
 * Focus bằng chuột hoặc bàn phím.
 */
.single-product-page
#tab-description
.tdn-product-readmore
.tdn-product-readmore__button:focus {
	border-color: var(--tdn-readmore-accent);
	outline: 0;
	background-color: var(--tdn-readmore-surface);
	background-image: none;
	color: var(--tdn-readmore-accent-dark);
	text-shadow: none;
	box-shadow: none;
}

.single-product-page
#tab-description
.tdn-product-readmore
.tdn-product-readmore__button:focus-visible {
	border-color: var(--tdn-readmore-accent);
	outline: 2px solid var(--tdn-readmore-accent);
	outline-offset: 3px;
	background-color: var(--tdn-readmore-surface);
	background-image: none;
	color: var(--tdn-readmore-accent-dark);
	text-shadow: none;
	box-shadow: var(--tdn-readmore-focus);
}

/*
 * Khi đang mở nội dung.
 */
.single-product-page
#tab-description
.tdn-product-readmore
.tdn-product-readmore__button[aria-expanded="true"] {
	border-color: var(--tdn-readmore-accent);
	background-color: var(--tdn-readmore-accent-soft);
	background-image: none;
	color: var(--tdn-readmore-accent-dark);
	text-shadow: none;
	box-shadow: none;
}

/*
 * Active chỉ tồn tại trong khoảnh khắc đang nhấn.
 */
.single-product-page
#tab-description
.tdn-product-readmore
.tdn-product-readmore__button:active {
	border-color: var(--tdn-readmore-accent-dark);
	background-color: var(--tdn-readmore-accent-soft);
	background-image: none;
	color: var(--tdn-readmore-accent-dark);
	text-shadow: none;
	box-shadow: none;
	transform: translateY(0);
}

.tdn-product-readmore__label {
	pointer-events: none;
}

/*
 * Icon cộng / trừ.
 */
.tdn-product-readmore__icon {
	position: relative;
	display: block;
	width: 18px;
	height: 18px;
	pointer-events: none;
}

.tdn-product-readmore__icon::before,
.tdn-product-readmore__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	border-radius: 999px;
	background: currentColor;
	transform: translate(-50%, -50%);
	transition: transform 0.18s ease, opacity 0.18s ease;
}

.tdn-product-readmore__icon::before {
	width: 12px;
	height: 1.5px;
}

.tdn-product-readmore__icon::after {
	width: 1.5px;
	height: 12px;
}

.tdn-product-readmore__button[aria-expanded="true"] .tdn-product-readmore__icon::after {
	opacity: 0;
	transform: translate(-50%, -50%) scaleY(0);
}

/*
 * Nhãn phụ giúp nút có cảm giác như control tài liệu.
 */
.tdn-product-readmore__button::before {
	content: "Mô tả";
	color: var(--tdn-readmore-muted);
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/*
 * JS dùng hidden trong quá trình đo chiều cao.
 */
.tdn-product-readmore[hidden] {
	display: none !important;
}

@media (max-width: 849px) {
	.single-product-page #tab-description {
		margin-bottom: 12px;
	}

	#tab-description.tdn-is-collapsed > .tdn-product-readmore {
		padding-top: 46px;
	}

	#tab-description:not(.tdn-is-collapsed) > .tdn-product-readmore {
		margin-top: 22px;
		padding-top: 15px;
	}

	.single-product-page #tab-description .tdn-product-readmore .tdn-product-readmore__button {
		width: max-content;
		max-width: calc(100% - 24px);
		min-height: 42px;
		padding: 9px 14px 9px 16px;
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.single-product-page #tab-description .tdn-product-readmore .tdn-product-readmore__button {
		grid-template-columns: auto auto 16px;
		gap: 9px;
	}

	.tdn-product-readmore__button::before {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html:focus-within {
		scroll-behavior: auto;
	}

	.tdn-product-readmore__button,
	.tdn-product-readmore__icon::before,
	.tdn-product-readmore__icon::after {
		transition: none !important;
	}
}