/**
 * TRD Cookie Consent — frontend styles.
 * Every color/radius/font comes from the --trd-cc-* variables printed by the
 * plugin so each client site can be branded from the admin without touching CSS.
 */

.trd-cc-banner,
.trd-cc-prefs,
.trd-cc-fab,
.trd-cc-iframe-placeholder {
	font-family: var(--trd-cc-font, inherit);
	color: var(--trd-cc-text, #1f2430);
	box-sizing: border-box;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.trd-cc-banner *,
.trd-cc-prefs * {
	box-sizing: border-box;
}

/* ------------------------------ banner ------------------------------ */

.trd-cc-banner {
	position: fixed;
	z-index: 999990;
	background: var(--trd-cc-bg, #fff);
	border: 1px solid var(--trd-cc-border, #e4e6ec);
	box-shadow: 0 12px 40px rgba(15, 20, 30, 0.16);
}

.trd-cc-banner-inner {
	padding: 20px;
}

.trd-cc-layout-card {
	width: min(380px, calc(100vw - 32px));
	border-radius: var(--trd-cc-radius, 14px);
	bottom: 16px;
	animation: trd-cc-rise 0.35s ease both;
}

.trd-cc-pos-bottom-left  { left: 16px; }
.trd-cc-pos-bottom-right { right: 16px; }

.trd-cc-layout-bar {
	left: 0;
	right: 0;
	width: 100%;
	border-left: 0;
	border-right: 0;
}

.trd-cc-bar-bottom { bottom: 0; border-bottom: 0; animation: trd-cc-rise 0.35s ease both; }
.trd-cc-bar-top    { top: 0; border-top: 0; }

.trd-cc-layout-bar .trd-cc-banner-inner {
	max-width: 1080px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 24px;
}

.trd-cc-layout-bar .trd-cc-title { flex-basis: 100%; margin-bottom: 0; }
.trd-cc-layout-bar .trd-cc-body  { flex: 1 1 320px; margin: 0; }
.trd-cc-layout-bar .trd-cc-actions { margin-top: 0; }

.trd-cc-layout-modal {
	position: relative;
	width: min(440px, calc(100vw - 32px));
	border-radius: var(--trd-cc-radius, 14px);
	margin: auto;
}

.trd-cc-title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: inherit;
}

.trd-cc-body {
	margin: 0 0 14px;
	font-size: 13.5px;
	opacity: 0.85;
}

.trd-cc-body a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.trd-cc-logo {
	max-height: 28px;
	width: auto;
	margin-bottom: 10px;
	display: block;
}

/* ------------------------------ buttons ----------------------------- */

.trd-cc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.trd-cc-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: calc(var(--trd-cc-radius, 14px) * 0.6);
	padding: 9px 16px;
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s ease, background 0.15s ease;
}

.trd-cc-btn:focus-visible,
.trd-cc-fab:focus-visible,
.trd-cc-close:focus-visible,
.trd-cc-switch input:focus-visible + .trd-cc-slider {
	outline: 2px solid var(--trd-cc-accent, #1f2430);
	outline-offset: 2px;
}

.trd-cc-btn-primary {
	background: var(--trd-cc-accent, #1f2430);
	color: var(--trd-cc-accent-text, #fff);
}

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

.trd-cc-btn-secondary {
	background: transparent;
	color: inherit;
	border-color: var(--trd-cc-border, #e4e6ec);
}

.trd-cc-btn-secondary:hover { background: rgba(127, 127, 127, 0.08); }

.trd-cc-btn-ghost {
	background: transparent;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	padding-left: 6px;
	padding-right: 6px;
}

/* ------------------------- overlay + preferences --------------------- */

.trd-cc-overlay {
	position: fixed;
	inset: 0;
	z-index: 999995;
	background: rgba(12, 16, 24, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	animation: trd-cc-fade 0.2s ease both;
	overflow-y: auto;
}

.trd-cc-prefs {
	background: var(--trd-cc-bg, #fff);
	border: 1px solid var(--trd-cc-border, #e4e6ec);
	border-radius: var(--trd-cc-radius, 14px);
	width: min(520px, 100%);
	max-height: min(86vh, 720px);
	overflow-y: auto;
	padding: 22px;
	margin: auto;
	box-shadow: 0 20px 60px rgba(10, 14, 22, 0.28);
}

.trd-cc-prefs-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.trd-cc-close {
	appearance: none;
	background: transparent;
	border: 0;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: 0.6;
	padding: 0 2px;
}

.trd-cc-close:hover { opacity: 1; }

.trd-cc-cat {
	border-top: 1px solid var(--trd-cc-border, #e4e6ec);
	padding: 14px 0;
}

.trd-cc-cat-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.trd-cc-cat-name {
	font-weight: 700;
	font-size: 14px;
	flex: 1;
}

.trd-cc-always {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
	opacity: 0.65;
}

.trd-cc-cat-desc {
	margin: 6px 0 0;
	font-size: 12.5px;
	opacity: 0.75;
}

.trd-cc-consent-id {
	margin: 14px 0 0;
	font-size: 11.5px;
	opacity: 0.65;
	word-break: break-all;
}

/* ------------------------------ switch ------------------------------ */

.trd-cc-switch {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	flex: 0 0 auto;
}

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

.trd-cc-slider {
	position: absolute;
	inset: 0;
	background: var(--trd-cc-border, #cfd3dd);
	border-radius: 24px;
	transition: background 0.18s ease;
	pointer-events: none;
}

.trd-cc-slider::before {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.18s ease;
}

.trd-cc-switch input:checked + .trd-cc-slider { background: var(--trd-cc-accent, #1f2430); }
.trd-cc-switch input:checked + .trd-cc-slider::before { transform: translateX(18px); }

/* ------------------------------- FAB --------------------------------- */

.trd-cc-fab {
	position: fixed;
	z-index: 999980;
	bottom: 16px;
	left: 16px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--trd-cc-border, #e4e6ec);
	background: var(--trd-cc-bg, #fff);
	color: var(--trd-cc-text, #1f2430);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(15, 20, 30, 0.18);
	transition: transform 0.15s ease;
}

.trd-cc-fab:hover { transform: scale(1.06); }

/* ------------------------ iframe placeholder ------------------------- */

.trd-cc-iframe-placeholder {
	background: var(--trd-cc-bg, #f4f5f8);
	border: 1px dashed var(--trd-cc-border, #cfd3dd);
	border-radius: var(--trd-cc-radius, 14px);
	padding: 28px 20px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	min-height: 180px;
	justify-content: center;
}

.trd-cc-iframe-placeholder p {
	margin: 0;
	font-size: 13.5px;
	opacity: 0.8;
	max-width: 420px;
}

/* --------------------------- policy tables --------------------------- */

.trd-cc-policy-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	margin: 0 0 28px;
}

.trd-cc-policy-table th,
.trd-cc-policy-table td {
	border: 1px solid var(--trd-cc-border, #e4e6ec);
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
}

.trd-cc-policy-table th {
	background: rgba(127, 127, 127, 0.07);
	font-weight: 700;
}

/* ---------------------------- animations ----------------------------- */

@keyframes trd-cc-rise {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes trd-cc-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.trd-cc-banner,
	.trd-cc-overlay,
	.trd-cc-fab,
	.trd-cc-slider,
	.trd-cc-slider::before,
	.trd-cc-btn {
		animation: none !important;
		transition: none !important;
	}
}

/* ----------------------------- mobile -------------------------------- */

@media (max-width: 480px) {
	.trd-cc-layout-card {
		width: calc(100vw - 24px);
		left: 12px;
		right: 12px;
		bottom: 12px;
	}

	.trd-cc-pos-bottom-right { left: 12px; }

	.trd-cc-actions .trd-cc-btn {
		flex: 1 1 auto;
		text-align: center;
	}

	.trd-cc-prefs { padding: 18px 16px; }

	.trd-cc-fab { bottom: 12px; left: 12px; width: 40px; height: 40px; }
}
