/* ===== Cookie Consent (PDPA) ===== */

.cc-banner {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 1050;
	width: min(440px, calc(100vw - 40px));
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 20px 22px 18px;
	border-radius: 16px;
	background: #FFF;
	color: #333;
	font-family: 'Prompt', sans-serif;
	box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.04);
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.cc-banner[hidden],
.cc-banner [hidden] {
	display: none !important;
}

.cc-banner.cc-visible {
	opacity: 1;
	transform: none;
}

.cc-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.cc-head-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: linear-gradient(120deg, #01c1f0 0%, #06c400 100%);
	color: #FFF;
	font-size: 18px;
}

.cc-title {
	font-size: 18px;
	font-weight: 600;
	color: #222;
}

.cc-banner p.cc-text {
	font-size: 14px;
	line-height: 1.65 !important;
	color: #555;
	margin: 0 0 14px !important;
}

.cc-text a {
	color: #2f8a02;
	text-decoration: underline;
}

.cc-prefs {
	margin: 0 0 14px;
	border-top: 1px solid #eee;
}

.cc-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 0;
	border-bottom: 1px solid #eee;
}

.cc-row-text {
	display: flex;
	flex-direction: column;
	margin: 0;
	cursor: pointer;
}

.cc-row-text strong {
	font-size: 14.5px;
	font-weight: 600;
	color: #222;
}

.cc-row-text small {
	font-size: 12.5px;
	line-height: 1.5;
	color: #777;
}

/* สวิตช์เปิด/ปิด */
.cc-switch {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	position: relative;
	width: 44px;
	height: 24px;
	margin: 0;
	border-radius: 999px;
	background: #cfd4da;
	cursor: pointer;
	transition: background 0.2s ease;
}

.cc-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #FFF;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease;
}

.cc-switch:checked {
	background: #06c400;
}

.cc-switch:checked::after {
	transform: translateX(20px);
}

.cc-switch:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.cc-switch:focus-visible {
	outline: 3px solid #01c1f0;
	outline-offset: 2px;
}

.cc-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.cc-btn {
	padding: 9px 16px;
	border: 0;
	border-radius: 999px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: filter 0.2s ease, background 0.2s ease;
}

.cc-btn:focus-visible {
	outline: 3px solid #01c1f0;
	outline-offset: 2px;
}

.cc-btn-link {
	margin-right: auto;
	padding-left: 0;
	padding-right: 0;
	background: none;
	color: #555;
	text-decoration: underline;
}

.cc-btn-outline {
	background: #f1f3f5;
	color: #333;
}

.cc-btn-outline:hover {
	background: #e5e8eb;
}

.cc-btn-primary {
	background: linear-gradient(120deg, #01c1f0 0%, #06c400 100%);
	color: #FFF;
}

.cc-btn-primary:hover {
	filter: brightness(1.06);
}

/* มือถือ: ลอยอยู่เหนือแถบปุ่มติดต่อด้านล่าง */
@media (max-width: 767px) {
	.cc-banner {
		left: 10px;
		right: 10px;
		width: auto;
		bottom: calc(82px + env(safe-area-inset-bottom));
		max-height: calc(100vh - 110px);
		padding: 16px 16px 14px;
	}

	.cc-actions .cc-btn-outline,
	.cc-actions .cc-btn-primary {
		flex: 1 1 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cc-banner {
		transition: none;
	}
}
