/**
 * Kyzoe Cookie Consent - front-end styling.
 * Colours/radius are driven by CSS variables set from the admin settings.
 */

.kcc-root {
	--kcc-primary: #2563eb;
	--kcc-bg: #ffffff;
	--kcc-text: #1f2937;
	--kcc-btn-text: #ffffff;
	--kcc-radius: 12px;
	--kcc-border: rgba(0, 0, 0, 0.12);
	--kcc-muted: rgba(0, 0, 0, 0.55);
	font-family: inherit;
	line-height: 1.5;
	box-sizing: border-box;
}

.kcc-root *,
.kcc-root *::before,
.kcc-root *::after {
	box-sizing: border-box;
}

.kcc-hidden {
	display: none !important;
}

/* ---------- Banner ---------- */
.kcc-banner {
	position: fixed;
	z-index: 2147483000;
	background: var(--kcc-bg);
	color: var(--kcc-text);
	box-shadow: 0 -2px 24px rgba(0, 0, 0, 0.14);
	padding: 20px 24px;
	animation: kcc-fade 0.25s ease-out;
}

@keyframes kcc-fade {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Bar layout (full width). */
.kcc-banner--bar {
	left: 0;
	right: 0;
}
.kcc-banner--bar.kcc-pos-bottom { bottom: 0; }
.kcc-banner--bar.kcc-pos-top { top: 0; box-shadow: 0 2px 24px rgba(0, 0, 0, 0.14); }

.kcc-banner--bar .kcc-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	gap: 24px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}
.kcc-banner--bar .kcc-copy { flex: 1 1 420px; min-width: 260px; }

/* Box layout (card). */
.kcc-banner--box {
	width: 400px;
	max-width: calc(100vw - 32px);
	border-radius: var(--kcc-radius);
}
.kcc-banner--box.kcc-pos-bottom-right { right: 16px; bottom: 16px; }
.kcc-banner--box.kcc-pos-bottom-left { left: 16px; bottom: 16px; }

.kcc-title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
}
.kcc-message {
	margin: 0;
	font-size: 14px;
	color: var(--kcc-text);
}
.kcc-message a { color: var(--kcc-primary); }

.kcc-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}
.kcc-banner--box .kcc-actions { margin-top: 16px; }

/* ---------- Buttons (reject is kept as prominent as accept) ---------- */
.kcc-btn {
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	border-radius: calc(var(--kcc-radius) - 4px);
	padding: 11px 18px;
	cursor: pointer;
	border: 2px solid var(--kcc-primary);
	transition: filter 0.15s ease, background 0.15s ease;
	line-height: 1.2;
}
.kcc-btn:hover { filter: brightness(0.95); }
.kcc-btn:focus-visible { outline: 3px solid var(--kcc-primary); outline-offset: 2px; }

.kcc-btn--primary {
	background: var(--kcc-primary);
	color: var(--kcc-btn-text);
}
.kcc-btn--secondary {
	background: transparent;
	color: var(--kcc-primary);
}
.kcc-btn--link {
	border-color: transparent;
	background: transparent;
	color: var(--kcc-muted);
	padding: 11px 10px;
	text-decoration: underline;
}

/* ---------- Preferences modal ---------- */
.kcc-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	animation: kcc-fade 0.2s ease-out;
}
.kcc-modal {
	background: var(--kcc-bg);
	color: var(--kcc-text);
	border-radius: var(--kcc-radius);
	width: 560px;
	max-width: 100%;
	max-height: 90vh;
	overflow: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.kcc-modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 8px;
}
.kcc-modal-head h2 { margin: 0; font-size: 19px; }
.kcc-modal-intro { padding: 0 24px; margin: 0 0 8px; font-size: 14px; color: var(--kcc-muted); }
.kcc-close {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--kcc-muted);
	padding: 0 4px;
}
.kcc-cats { padding: 8px 24px 4px; }

.kcc-cat {
	border: 1px solid var(--kcc-border);
	border-radius: calc(var(--kcc-radius) - 2px);
	padding: 14px 16px;
	margin-bottom: 12px;
}
.kcc-cat-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.kcc-cat-label { font-weight: 600; font-size: 15px; }
.kcc-cat-desc { margin: 8px 0 0; font-size: 13px; color: var(--kcc-muted); }

.kcc-modal-foot {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
	padding: 12px 24px 22px;
	position: sticky;
	bottom: 0;
	background: var(--kcc-bg);
}

/* ---------- Toggle switch ---------- */
.kcc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.kcc-switch input { opacity: 0; width: 0; height: 0; }
.kcc-slider {
	position: absolute;
	inset: 0;
	background: #cbd5e1;
	border-radius: 999px;
	transition: background 0.2s ease;
	cursor: pointer;
}
.kcc-slider::before {
	content: "";
	position: absolute;
	height: 20px;
	width: 20px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
}
.kcc-switch input:checked + .kcc-slider { background: var(--kcc-primary); }
.kcc-switch input:checked + .kcc-slider::before { transform: translateX(20px); }
.kcc-switch input:disabled + .kcc-slider { opacity: 0.6; cursor: not-allowed; }

/* ---------- Floating revoke button ---------- */
.kcc-revoke {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 2147482000;
	background: var(--kcc-primary);
	color: var(--kcc-btn-text);
	border: none;
	border-radius: 999px;
	padding: 10px 14px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.kcc-revoke svg { width: 18px; height: 18px; }

/* ---------- Blocked iframe placeholder ---------- */
.kcc-iframe-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
	padding: 24px;
	background: #f1f5f9;
	color: #334155;
	border: 1px dashed #94a3b8;
	border-radius: 8px;
	min-height: 180px;
	font-size: 14px;
}
.kcc-iframe-placeholder .kcc-btn { font-size: 13px; }

/* ---------- Cookie policy table (shortcode) ---------- */
.kcc-policy h3 { margin: 28px 0 10px; }
.kcc-policy table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 8px;
	font-size: 14px;
}
.kcc-policy th,
.kcc-policy td {
	border: 1px solid var(--kcc-border, rgba(0, 0, 0, 0.12));
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
}
.kcc-policy th { background: rgba(0, 0, 0, 0.04); }

@media (max-width: 600px) {
	.kcc-banner--bar .kcc-actions { width: 100%; }
	.kcc-banner--bar .kcc-btn { flex: 1 1 auto; }
	.kcc-policy table, .kcc-policy thead, .kcc-policy tbody, .kcc-policy th, .kcc-policy td, .kcc-policy tr { display: block; }
	.kcc-policy thead { display: none; }
	.kcc-policy td { border: none; border-bottom: 1px solid var(--kcc-border, rgba(0,0,0,0.12)); }
	.kcc-policy td::before { content: attr(data-label); font-weight: 600; display: block; }
}
