/**
 * WDC Cookie Consent — banner, modal, and switch styles.
 *
 * Colours are driven by CSS variables set inline from the admin settings.
 * Accept All and Reject All share a single button class (.wdc-cc-btn--primary)
 * so they are guaranteed equal prominence (anti-dark-pattern).
 */

:root {
	--wdc-cc-banner-bg: #2c3e50;
	--wdc-cc-text: #ecf0f1;
	--wdc-cc-link: #8bc4ff;
	--wdc-cc-btn-bg: #ffffff;
	--wdc-cc-btn-text: #1a2530;
	--wdc-cc-radius: 6px;
	--wdc-cc-gap: 12px;
	--wdc-cc-maxw: 1200px;
}

/* ===== Banner ===== */
.wdc-cc-banner {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99999;
	background: var(--wdc-cc-banner-bg);
	color: var(--wdc-cc-text);
	padding: 18px 20px;
	box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.25);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}
.wdc-cc-banner[hidden] { display: none; }
.wdc-cc-banner--bottom { bottom: 0; }
.wdc-cc-banner--top { top: 0; box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25); }

.wdc-cc-banner__inner {
	max-width: var(--wdc-cc-maxw);
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}
.wdc-cc-banner__text { flex: 1 1 340px; }
.wdc-cc-banner__text p { margin: 0 0 6px; color: var(--wdc-cc-text); }
.wdc-cc-banner__text p:last-child { margin-bottom: 0; }
.wdc-cc-banner__text a { color: var(--wdc-cc-link); text-decoration: underline; }
.wdc-cc-banner__privacy { font-size: 13px; }
.wdc-cc-banner__privacy a { color: rgba(255, 255, 255, 0.8) !important; }

.wdc-cc-banner__buttons {
	display: flex;
	align-items: center;
	gap: var(--wdc-cc-gap);
	flex-wrap: wrap;
}

/* ===== Buttons ===== */
.wdc-cc-btn {
	font: inherit;
	cursor: pointer;
	border-radius: var(--wdc-cc-radius);
	transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}
.wdc-cc-btn:focus-visible {
	outline: 3px solid var(--wdc-cc-link);
	outline-offset: 2px;
}

/* Both primary buttons are identical: same size, padding, radius, weight,
   background and contrast. Do not diverge these two. */
.wdc-cc-btn--primary {
	background: var(--wdc-cc-btn-bg);
	color: var(--wdc-cc-btn-text);
	border: 2px solid var(--wdc-cc-btn-bg);
	padding: 11px 22px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
}
.wdc-cc-btn--primary:hover { transform: translateY(-1px); opacity: 0.92; }

/* Clearly secondary — a link-style control, never competing with the pair. */
.wdc-cc-btn--secondary {
	background: transparent;
	color: var(--wdc-cc-text);
	border: none;
	padding: 11px 10px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: underline;
}
.wdc-cc-btn--secondary:hover { opacity: 0.85; }

/* Legibility guard — force the plugin's button colours to win over a theme's
   global button styles (e.g. an Elementor Global Kit painting every <button>).
   Scoped + !important so text can never end up illegible on a themed site.
   Operator colours still flow through via the CSS variables. */
.wdc-cc-banner .wdc-cc-btn--primary,
.wdc-cc-modal .wdc-cc-btn--primary {
	background: var(--wdc-cc-btn-bg) !important;
	color: var(--wdc-cc-btn-text) !important;
	border: 2px solid var(--wdc-cc-btn-bg) !important;
}
.wdc-cc-modal__footer .wdc-cc-btn--primary {
	background: var(--wdc-cc-banner-bg) !important;
	color: #ffffff !important;
	border-color: var(--wdc-cc-banner-bg) !important;
}
.wdc-cc-banner .wdc-cc-btn--secondary {
	background: transparent !important;
	color: var(--wdc-cc-text) !important;
	border: none !important;
}
.wdc-cc-modal .wdc-cc-btn--secondary {
	background: transparent !important;
	color: var(--wdc-cc-btn-text) !important;
	border: none !important;
}
.wdc-cc-switch { background: none !important; }

/* Re-open link rendered inside site content. */
.wdc-cc-reopen-link {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	color: inherit;
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
}

/* ===== Modal ===== */
.wdc-cc-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.55);
}
.wdc-cc-modal-overlay[hidden] { display: none; }

.wdc-cc-modal {
	position: fixed;
	z-index: 100001;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(560px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	overflow: auto;
	background: #ffffff;
	color: #1a2530;
	border-radius: 10px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wdc-cc-modal[hidden] { display: none; }
.wdc-cc-modal__inner { padding: 24px; }

.wdc-cc-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 8px;
}
.wdc-cc-modal__title { margin: 0; font-size: 20px; line-height: 1.3; }
.wdc-cc-modal__close {
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #667;
	padding: 0 4px;
}
.wdc-cc-modal__close:focus-visible { outline: 3px solid var(--wdc-cc-link); outline-offset: 2px; }

.wdc-cc-modal__body { margin: 12px 0 20px; }
.wdc-cc-modal__footer {
	display: flex;
	gap: var(--wdc-cc-gap);
	flex-wrap: wrap;
	border-top: 1px solid #e6e6e6;
	padding-top: 16px;
}
/* In the modal the secondary buttons sit on a light background. */
.wdc-cc-modal__footer .wdc-cc-btn--secondary { color: var(--wdc-cc-btn-text); }
.wdc-cc-modal__footer .wdc-cc-btn--primary { background: var(--wdc-cc-banner-bg); color: #fff; border-color: var(--wdc-cc-banner-bg); }

/* ===== Category rows + switches ===== */
.wdc-cc-category { padding: 14px 0; border-bottom: 1px solid #eee; }
.wdc-cc-category:last-child { border-bottom: none; }
.wdc-cc-category__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.wdc-cc-category__title { font-weight: 600; font-size: 15px; }
.wdc-cc-category__desc { margin: 6px 0 0; font-size: 13px; color: #4a5568; line-height: 1.5; }

.wdc-cc-switch {
	position: relative;
	flex: 0 0 auto;
	box-sizing: border-box !important;
	width: 46px !important;
	min-width: 46px !important;
	max-width: 46px !important;
	height: 26px !important;
	min-height: 26px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	background: none !important;
	box-shadow: none !important;
	line-height: 1 !important;
	font-size: 0 !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	cursor: pointer;
}
.wdc-cc-switch[disabled] { cursor: not-allowed; opacity: 0.65; }
.wdc-cc-switch__track {
	position: absolute;
	inset: 0;
	box-sizing: border-box !important;
	display: block;
	width: 46px;
	height: 26px;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 999px;
	background: #c2c8d0;
	transition: background-color 0.18s ease;
}
.wdc-cc-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	box-sizing: border-box !important;
	width: 20px;
	height: 20px;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.18s ease;
}
.wdc-cc-switch[aria-checked="true"] .wdc-cc-switch__track { background: #2e7d32; }
.wdc-cc-switch[aria-checked="true"] .wdc-cc-switch__thumb { transform: translateX(20px); }
.wdc-cc-switch:focus-visible { outline: 3px solid var(--wdc-cc-link); outline-offset: 3px; border-radius: 999px; }

/* Screen-reader-only helper (in case the theme lacks it). */
.wdc-cc-banner .screen-reader-text,
.wdc-cc-modal .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* ===== Responsive ===== */
@media (max-width: 782px) {
	.wdc-cc-banner__inner { flex-direction: column; align-items: stretch; }
	/* Reset the desktop 340px flex-basis: in a column it would become a vertical
	   height and inflate the text block, leaving a large empty gap above the buttons. */
	/* Higher specificity than the base rule so aggressive CSS minifiers/optimisers
	   (e.g. SiteGround) don't treat it as a duplicate selector and drop it. */
	.wdc-cc-banner .wdc-cc-banner__text { flex: 0 0 auto; }
	.wdc-cc-banner__buttons { width: 100%; }
	.wdc-cc-btn--primary { flex: 1 1 auto; }
	.wdc-cc-btn--secondary { flex: 1 1 100%; text-align: center; }
}

/* ===== Motion ===== */
@media (prefers-reduced-motion: reduce) {
	.wdc-cc-btn,
	.wdc-cc-switch__track,
	.wdc-cc-switch__thumb { transition: none; }
}

@media print {
	.wdc-cc-banner,
	.wdc-cc-modal,
	.wdc-cc-modal-overlay { display: none !important; }
}
