/* ===== PDPA Cookie consent ===== */
.cc-banner[hidden],
.cc-modal[hidden] {
	display: none !important;
}

.cc-banner {
	position: fixed;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	width: calc(100% - 32px);
	max-width: 1040px;
	z-index: 1060;
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 18px 20px;
	background: #FFF;
	border-radius: 16px;
	box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .35);
	border: 1px solid rgba(0, 0, 0, .06);
	font-family: 'Maitree', serif;
	animation: cc-up .35s ease;
}

@keyframes cc-up {
	from { opacity: 0; transform: translate(-50%, 20px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

.cc-banner__body {
	display: flex;
	gap: 14px;
	flex: 1 1 auto;
}

.cc-banner__icon {
	flex: 0 0 44px;
	height: 44px;
	border-radius: 12px;
	background: #e9f7e8;
	color: #099F00;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
}

.cc-banner__text strong {
	display: block;
	font-size: 16px;
	color: #1f2933;
	margin-bottom: 2px;
}

.cc-banner__text p {
	font-size: 14px;
	line-height: 22px !important;
	color: #4b5563;
}

.cc-banner__text a,
.cc-modal a {
	color: #099F00;
	text-decoration: underline;
}

.cc-banner__actions {
	display: flex;
	gap: 8px;
	flex: 0 0 auto;
}

.cc-btn {
	font-family: 'Maitree', serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	padding: 12px 18px;
	border-radius: 10px;
	border: 2px solid transparent;
	cursor: pointer;
	white-space: nowrap;
	transition: filter .2s ease, background .2s ease;
}

.cc-btn:hover { filter: brightness(1.08); }
.cc-btn:focus-visible { outline: 3px solid #9fd89b; outline-offset: 2px; }

/* ปุ่มยอมรับ/ปฏิเสธ ขนาดและน้ำหนักเท่ากัน ตามแนวทาง PDPA */
.cc-btn--primary { background: #099F00; color: #FFF; }
.cc-btn--dark    { background: #374151; color: #FFF; }
.cc-btn--ghost   { background: #FFF; color: #374151; border-color: #d1d5db; }

/* ----- Modal ----- */
.cc-modal {
	position: fixed;
	inset: 0;
	z-index: 1070;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: 'Maitree', serif;
}

.cc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, .55);
}

.cc-modal__panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 32px);
	display: flex;
	flex-direction: column;
	background: #FFF;
	border-radius: 18px;
	box-shadow: 0 30px 60px -15px rgba(0, 0, 0, .45);
	overflow: hidden;
}

.cc-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid #eef0f2;
}

.cc-modal__head h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: #1f2933;
}

.cc-modal__close {
	border: 0;
	background: #f3f4f6;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	color: #374151;
}

.cc-modal__body {
	padding: 18px 22px;
	overflow-y: auto;
}

.cc-modal__intro {
	font-size: 14px;
	margin-bottom: 14px !important;
}

.cc-cat {
	padding: 14px 16px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	margin-bottom: 10px;
}

.cc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 4px;
	cursor: pointer;
	color: #1f2933;
}

.cc-cat p {
	font-size: 13px;
	line-height: 20px !important;
	color: #6b7280;
}

.cc-cat__always {
	font-size: 12px;
	font-weight: 700;
	color: #099F00;
	white-space: nowrap;
}

.cc-switch {
	position: relative;
	flex: 0 0 46px;
	height: 26px;
}

.cc-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
	z-index: 1;
}

.cc-switch span {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #d1d5db;
	transition: background .2s ease;
}

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

.cc-switch input:checked + span { background: #099F00; }
.cc-switch input:checked + span::after { transform: translateX(20px); }
.cc-switch input:focus-visible + span { outline: 3px solid #9fd89b; outline-offset: 2px; }

.cc-modal__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
	padding: 14px 22px;
	border-top: 1px solid #eef0f2;
	background: #fafafa;
}

/* เนื้อหาบุคคลที่สามที่รอความยินยอม (เช่น Facebook) */
.cc-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 160px;
	padding: 20px;
	text-align: center;
	background: #f3f4f6;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	font-family: 'Maitree', serif;
	font-size: 14px;
	color: #4b5563;
}

.cc-placeholder i {
	font-size: 28px;
	color: #1877f2;
}

@media (max-width: 767px) {
	.cc-banner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		bottom: 0;
		width: 100%;
		border-radius: 16px 16px 0 0;
		padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
	}

	.cc-banner__icon { display: none; }

	.cc-banner__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.cc-banner__actions .cc-btn--ghost {
		grid-column: 1 / -1;
		order: 3;
	}

	.cc-modal { align-items: flex-end; padding: 0; }
	.cc-modal__panel { border-radius: 18px 18px 0 0; max-height: 90vh; }
	.cc-modal__foot .cc-btn { flex: 1 1 auto; }
}
