/* แบนเนอร์ขอความยินยอมคุกกี้ (PDPA) — _cookie_consent.php + js/cookie-consent.js */
.cc {
	--cc-primary: #157d53;
	--cc-primary-dark: #005f39;
	--cc-ink: #1d2939;
	--cc-muted: #667085;
	--cc-line: #e4e7ec;
	font-family: 'Noto Sans Thai', sans-serif;
	color: var(--cc-ink);
}
.cc [hidden] { display: none !important; }

/* ---------- banner ---------- */
.cc-banner {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 1050;
	width: min(560px, calc(100vw - 260px));
	padding: 18px 20px;
	background: #fff;
	border: 1px solid var(--cc-line);
	border-radius: 16px;
	box-shadow: 0 20px 48px rgba(16, 24, 40, 0.18), 0 4px 10px rgba(16, 24, 40, 0.08);
	animation: cc-in 0.35s ease both;
}
.cc-banner-body {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}
.cc-banner-icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: rgba(21, 125, 83, 0.1);
	color: var(--cc-primary);
	font-size: 20px;
}
.cc-banner-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--cc-muted);
}
.cc-banner-text strong {
	font-size: 16px;
	color: var(--cc-ink);
}
.cc a {
	color: var(--cc-primary);
	text-decoration: underline;
}
.cc-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 14px;
}

/* ---------- buttons ---------- */
.cc-btn {
	appearance: none;
	min-height: 40px;
	padding: 8px 18px;
	border: 1px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.cc-btn:focus-visible { outline: 3px solid rgba(21, 125, 83, 0.4); outline-offset: 2px; }
.cc-btn-primary { background: var(--cc-primary); color: #fff; }
.cc-btn-primary:hover { background: var(--cc-primary-dark); }
.cc-btn-outline { background: #fff; border-color: #d0d5dd; color: var(--cc-ink); }
.cc-btn-outline:hover { border-color: var(--cc-primary); color: var(--cc-primary); }
.cc-btn-link { background: transparent; color: var(--cc-primary); padding-left: 8px; padding-right: 8px; margin-right: auto; }
.cc-btn-link:hover { text-decoration: underline; }

/* ---------- settings modal ---------- */
.cc-modal {
	position: fixed;
	inset: 0;
	z-index: 1060;
	display: grid;
	place-items: center;
	padding: 16px;
}
.cc-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 24, 40, 0.55);
	animation: cc-fade 0.2s ease both;
}
.cc-modal-box {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(560px, 100%);
	max-height: calc(100vh - 32px);
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(16, 24, 40, 0.3);
	overflow: hidden;
	animation: cc-in 0.25s ease both;
}
.cc-modal-head,
.cc-modal-foot {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 16px 20px;
}
.cc-modal-head {
	justify-content: space-between;
	border-bottom: 1px solid var(--cc-line);
	font-size: 18px;
}
.cc-modal-foot {
	flex-wrap: wrap;
	justify-content: flex-end;
	border-top: 1px solid var(--cc-line);
	background: #f9fafb;
}
.cc-x {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cc-muted);
	font-size: 18px;
	cursor: pointer;
}
.cc-x:hover { background: #f2f4f7; color: var(--cc-ink); }
.cc-modal-body {
	padding: 8px 20px 16px;
	overflow-y: auto;
}
.cc-intro {
	margin: 8px 0 12px !important;
	font-size: 14px;
	color: var(--cc-muted);
	line-height: 1.6 !important;
}
.cc-cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 10px;
	padding: 14px 16px;
	border: 1px solid var(--cc-line);
	border-radius: 12px;
	font-weight: 400;
	cursor: pointer;
}
div.cc-cat { cursor: default; background: #f9fafb; }
.cc-cat-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13px;
	line-height: 1.55;
	color: var(--cc-muted);
}
.cc-cat-text strong { font-size: 15px; color: var(--cc-ink); }
.cc-always {
	flex: none;
	font-size: 12px;
	font-weight: 600;
	color: var(--cc-primary);
}

/* toggle switch */
.cc-switch {
	appearance: none;
	-webkit-appearance: none;
	flex: none;
	position: relative;
	width: 46px;
	height: 26px;
	margin: 0;
	border-radius: 999px;
	background: #d0d5dd;
	cursor: pointer;
	transition: background-color 0.2s;
}
.cc-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25);
	transition: transform 0.2s;
}
.cc-switch:checked { background: var(--cc-primary); }
.cc-switch:checked::after { transform: translateX(20px); }
.cc-switch:focus-visible { outline: 3px solid rgba(21, 125, 83, 0.4); outline-offset: 2px; }

/* ---------- footer links ---------- */
.footer-policy-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 4px 18px;
}
.footer-policy-links a { color: inherit; text-decoration: underline; }
@media (max-width: 991.98px) {
	.footer-policy-links { justify-content: flex-start; margin-top: 6px; }
}

/* ---------- เนื้อหาหน้านโยบาย ---------- */
.policy-content { max-width: 860px; margin: 0 auto; color: #344054; font-size: 16px; line-height: 1.8; }
.policy-content h2 { margin: 32px 0 10px; font-size: 22px; font-weight: 600; color: #157d53; }
.policy-content h3 { margin: 20px 0 6px; font-size: 18px; font-weight: 600; color: #1d2939; }
.policy-content p { margin: 0 0 12px !important; line-height: 1.8 !important; color: #344054; }
.policy-content ul { margin: 0 0 12px; padding-left: 22px; }
.policy-content li { margin-bottom: 4px; }
.policy-content .policy-meta { color: #667085; font-size: 14px; }
.policy-content table { width: 100%; margin: 8px 0 16px; border-collapse: collapse; font-size: 15px; }
.policy-content th, .policy-content td { padding: 10px 12px; border: 1px solid #e4e7ec; vertical-align: top; text-align: left; }
.policy-content th { background: #f2f4f7; font-weight: 600; }
.policy-table-wrap { overflow-x: auto; }

/* มือถือ: แบนเนอร์เต็มความกว้าง อยู่เหนือแถบปุ่มติดต่อ (breakpoint เดียวกับ css/fab.css) */
@media (max-width: 767.98px) {
	.cc-banner {
		left: 12px;
		right: 12px;
		bottom: calc(var(--cfab-h, 0px) + env(safe-area-inset-bottom) + 12px);
		width: auto;
		padding: 16px;
	}
}
@media (max-width: 575.98px) {
	.cc-actions .cc-btn { flex: 1 1 auto; }
	.cc-btn-link { flex-basis: 100% !important; order: 3; margin: 0; }
	.cc-modal { padding: 0; place-items: end stretch; }
	.cc-modal-box { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
	.cc-modal-foot .cc-btn { flex: 1 1 auto; }
}

@keyframes cc-in {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}
@keyframes cc-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.cc-banner, .cc-modal-box, .cc-modal-backdrop { animation: none; }
}
