/*
 * Cookie (D-58, D-61, D-62): giống mẫu hungphatlaptop.com, đổi đỏ
 * sang vàng Hoàng Phương. Nút "Cookie" góc dưới trái + hộp thoại
 * giữa màn hình trên lớp nền mờ. Chế độ sáng = mẫu nền trắng;
 * chế độ tối (mặc định) nền tối chữ sáng. Vàng #ffd600 làm nền
 * (vòng icon, nút Đồng ý); chữ vàng trên nền trắng dùng #826200.
 * z-index: pill 85 (dưới nút lên đầu trang 90, ngăn kéo 999),
 * lớp nền hộp thoại 1100.
 */

/* Màu theo chế độ: mặc định tối (theme thương hiệu), sáng = mẫu nền trắng. */
.hpt-cookie-pill,
.hpt-cookie-bg {
	--ck-surface: #17171c;
	--ck-line: #34343c;
	--ck-btn-line: #4a4a55;
	--ck-title: #f2f1ee;
	--ck-text: #c9c9d1;
	--ck-ink: #ffd600;
	--ck-hover: #26262d;
	--ck-scrim: rgb(0 0 0 / 55%);
	--ck-shadow: 0 6px 20px rgb(0 0 0 / 45%);
}

:root[data-theme="light"] .hpt-cookie-pill,
:root[data-theme="light"] .hpt-cookie-bg {
	--ck-surface: #fff;
	--ck-line: #e4e4e8;
	--ck-btn-line: #d9d9de;
	--ck-title: #16161a;
	--ck-text: #2b2b30;
	--ck-ink: #826200;
	--ck-hover: #f1f1f4;
	--ck-scrim: rgb(120 120 128 / 45%);
	--ck-shadow: 0 6px 20px rgb(0 0 0 / 22%);
}

.hpt-cookie-pill {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 85;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	height: 50px;
	margin: 0;
	padding: 0 24px 0 18px;
	border: 1px solid var(--ck-line);
	border-radius: 999px;
	background: var(--ck-surface);
	box-shadow: var(--ck-shadow);
	color: var(--ck-title);
	font-family: var(--hpt-font-body, system-ui, sans-serif);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 300ms ease,
		box-shadow 150ms ease;
}

.hpt-cookie-pill.is-in {
	opacity: 1;
	pointer-events: auto;
}

/* Hộp đang mở thì ẩn nút (như mẫu) */
.hpt-cookie-open .hpt-cookie-pill {
	visibility: hidden;
}

.hpt-cookie-pill:hover {
	box-shadow: 0 8px 26px rgb(0 0 0 / 30%);
}

.hpt-cookie-pill svg {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	color: var(--ck-ink);
}

/* Lớp nền mờ */
.hpt-cookie-bg {
	position: fixed;
	inset: 0;
	z-index: 1100;
	display: grid;
	place-items: center;
	box-sizing: border-box;
	padding: 16px;
	background: var(--ck-scrim);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity 200ms ease;
}

.hpt-cookie-bg[hidden] {
	display: none;
}

.hpt-cookie-bg.is-in {
	opacity: 1;
}

.hpt-cookie-box {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 480px;
	max-height: calc(100dvh - 32px);
	padding: 28px 28px 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--ck-line);
	border-radius: 16px;
	background: var(--ck-surface);
	box-shadow: 0 16px 48px rgb(0 0 0 / 28%);
	color: var(--ck-text);
	font-family: var(--hpt-font-body, system-ui, sans-serif);
	font-size: 15px;
	line-height: 25px;
	transform: translateY(8px);
	transition: transform 200ms ease;
}

.hpt-cookie-bg.is-in .hpt-cookie-box {
	transform: none;
}

.hpt-cookie-title {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 40px 16px 0;
	color: var(--ck-title);
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 28px;
}

/* Icon trong vòng tròn vàng đặc */
.hpt-cookie-title svg {
	flex: 0 0 auto;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 10px;
	border-radius: 50%;
	background: #ffd600;
	color: #16161a;
}

.hpt-cookie-text {
	margin: 0;
	color: inherit;
}

.hpt-cookie-link {
	position: relative;
	display: inline-block;
	margin-top: 12px;
	color: var(--ck-ink);
	font-weight: 700;
	text-decoration: none;
}

.hpt-cookie-link::before {
	content: "Xem ";
	color: var(--ck-text);
	font-weight: 400;
}

.hpt-cookie-link:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hpt-cookie-link::after {
	content: "";
	position: absolute;
	inset: -10px -4px;
}

.hpt-cookie-x {
	position: absolute;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ck-title);
	cursor: pointer;
}

.hpt-cookie-x:hover {
	background: var(--ck-hover);
}

/* Hai nút cùng cỡ, cùng hàng, bo góc nhẹ như mẫu */
.hpt-cookie-act {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 20px;
}

.hpt-cookie-btn {
	box-sizing: border-box;
	height: 48px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--ck-btn-line);
	border-radius: 6px;
	background: transparent;
	color: var(--ck-title);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition:
		background-color 150ms ease,
		border-color 150ms ease;
}

.hpt-cookie-btn:hover {
	border-color: var(--ck-title);
}

.hpt-cookie-btn--yes {
	border-color: #ffd600;
	background: #ffd600;
	color: #16161a;
}

.hpt-cookie-btn--yes:hover {
	border-color: #f0c800;
	background: #f0c800;
}

.hpt-cookie-pill:focus-visible,
.hpt-cookie-x:focus-visible,
.hpt-cookie-btn:focus-visible,
.hpt-cookie-link:focus-visible {
	outline: 2px solid var(--ck-ink);
	outline-offset: 2px;
}

.hpt-consent-open:focus-visible {
	outline: 2px solid var(--hpt-focus, #ffd600);
	outline-offset: 2px;
}

/* Link "Cài đặt cookie" ở dải copyright: nút trông như link chân trang */
.hpt-consent-open {
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.hpt-consent-open:hover {
	color: var(--hpt-accent-ink, #ffd600);
}

/* inline-flex: innerText tách thành dòng riêng, không dính Copyright */
.hpt-consent-footer {
	display: inline-flex;
	margin-inline-start: 16px;
}

/* Mobile: nút "Cookie" vẫn có chữ (như mẫu) nhưng gọn hơn */
@media (max-width: 767px) {

	.hpt-cookie-pill {
		bottom: 16px;
		left: 16px;
		gap: 8px;
		height: 44px;
		padding: 0 18px 0 14px;
		font-size: 14px;
	}

	.hpt-cookie-pill__txt {
		display: inline;
	}

	.hpt-cookie-pill svg {
		width: 22px;
		height: 22px;
	}

	.hpt-cookie-box {
		padding: 24px 20px 20px;
	}

	.hpt-cookie-title {
		font-size: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.hpt-cookie-pill,
	.hpt-cookie-bg,
	.hpt-cookie-box,
	.hpt-cookie-btn {
		transition: none;
	}

	.hpt-cookie-box {
		transform: none;
	}
}
