/**
 * WP Cookie Consent — front-end styles.
 * Colors are driven by CSS variables printed in <head> (see WPCC_Banner).
 */

.wpcc-banner,
.wpcc-modal {
	--wpcc-primary: #2563eb;
	--wpcc-text: #1f2937;
	--wpcc-bg: #ffffff;
	--wpcc-btn-text: #ffffff;
	--wpcc-radius: 8px;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

.wpcc-banner *,
.wpcc-modal * {
	box-sizing: border-box;
}

/* ------------------------------- Banner -------------------------------- */

.wpcc-banner {
	position: fixed;
	z-index: 999999;
	background: var(--wpcc-bg);
	color: var(--wpcc-text);
	border-radius: var(--wpcc-radius);
	box-shadow: 0 8px 30px rgba( 0, 0, 0, 0.18 );
	padding: 20px 22px;
	max-width: 440px;
	width: calc( 100% - 40px );
}

.wpcc-banner[hidden],
.wpcc-modal[hidden] {
	display: none;
}

/* Layout: full-width bar */
.wpcc-banner.wpcc-layout-bar {
	max-width: none;
	width: 100%;
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

/* Positions */
.wpcc-pos-bottom-left { bottom: 20px; left: 20px; }
.wpcc-pos-bottom-right { bottom: 20px; right: 20px; }
.wpcc-pos-bottom { bottom: 0; left: 0; }
.wpcc-pos-top { top: 0; left: 0; }
.wpcc-layout-bar.wpcc-pos-bottom-left,
.wpcc-layout-bar.wpcc-pos-bottom-right { left: 0; right: 0; bottom: 0; }

.wpcc-banner__title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 600;
	color: var(--wpcc-text);
}

.wpcc-banner__message {
	margin: 0;
	color: var(--wpcc-text);
	opacity: 0.9;
}

.wpcc-layout-bar .wpcc-banner__body { flex: 1 1 320px; }

.wpcc-policy-link {
	color: var(--wpcc-primary);
	text-decoration: underline;
}

.wpcc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

.wpcc-layout-bar .wpcc-banner__actions { margin-top: 0; }

/* ------------------------------- Buttons ------------------------------- */

.wpcc-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: var(--wpcc-radius);
	padding: 9px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease, background 0.15s ease;
}

.wpcc-btn--primary {
	background: var(--wpcc-primary);
	color: var(--wpcc-btn-text);
}

.wpcc-btn--primary:hover { opacity: 0.9; }

.wpcc-btn--secondary {
	background: transparent;
	color: var(--wpcc-text);
	border-color: currentColor;
	opacity: 0.85;
}

.wpcc-btn--secondary:hover { opacity: 1; }

.wpcc-btn--link {
	background: none;
	border: none;
	color: var(--wpcc-primary);
	text-decoration: underline;
	padding: 9px 6px;
}

/* -------------------------------- Modal -------------------------------- */

.wpcc-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpcc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.5 );
}

.wpcc-modal__dialog {
	position: relative;
	background: var(--wpcc-bg);
	color: var(--wpcc-text);
	border-radius: var(--wpcc-radius);
	width: min( 560px, calc( 100% - 32px ) );
	max-height: calc( 100vh - 48px );
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.3 );
}

.wpcc-modal__header,
.wpcc-modal__footer {
	display: flex;
	align-items: center;
	padding: 18px 22px;
}

.wpcc-modal__header { justify-content: space-between; border-bottom: 1px solid rgba( 0, 0, 0, 0.08 ); }
.wpcc-modal__header h2 { margin: 0; font-size: 18px; }

.wpcc-modal__close {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: 0.6;
}
.wpcc-modal__close:hover { opacity: 1; }

.wpcc-modal__body {
	padding: 8px 22px;
	overflow-y: auto;
}

.wpcc-modal__footer {
	justify-content: flex-end;
	gap: 8px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	flex-wrap: wrap;
}

/* ----------------------------- Categories ------------------------------ */

.wpcc-cat {
	padding: 16px 0;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.06 );
}
.wpcc-cat:last-child { border-bottom: none; }

.wpcc-cat__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wpcc-cat__label {
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 8px;
}

.wpcc-cat__always {
	font-style: normal;
	font-size: 12px;
	font-weight: 500;
	color: var(--wpcc-primary);
}

.wpcc-cat__desc {
	margin: 8px 0 0 56px;
	opacity: 0.8;
	font-size: 13px;
}

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

.wpcc-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: 0 0 auto;
}

.wpcc-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.wpcc-switch__slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background: #cbd5e1;
	border-radius: 24px;
	transition: background 0.2s ease;
}

.wpcc-switch__slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
}

.wpcc-switch input:checked + .wpcc-switch__slider { background: var(--wpcc-primary); }
.wpcc-switch input:checked + .wpcc-switch__slider::before { transform: translateX( 20px ); }
.wpcc-switch input:disabled + .wpcc-switch__slider { opacity: 0.6; cursor: not-allowed; }

/* ------------------------------- Themes -------------------------------- */

.wpcc-theme-dark {
	--wpcc-bg: #1f2937;
	--wpcc-text: #f3f4f6;
}
.wpcc-theme-dark .wpcc-modal__header,
.wpcc-theme-dark .wpcc-modal__footer { border-color: rgba( 255, 255, 255, 0.1 ); }
.wpcc-theme-dark .wpcc-cat { border-color: rgba( 255, 255, 255, 0.08 ); }

body.wpcc-modal-open { overflow: hidden; }

/* --------------------------- Declaration table ------------------------- */

.wpcc-declaration__table {
	width: 100%;
	border-collapse: collapse;
	margin: 12px 0 24px;
}
.wpcc-declaration__table th,
.wpcc-declaration__table td {
	text-align: left;
	padding: 8px 10px;
	border: 1px solid rgba( 0, 0, 0, 0.1 );
	font-size: 13px;
}
.wpcc-declaration__table th { background: rgba( 0, 0, 0, 0.04 ); }

/* ------------------------------- Compact ------------------------------- */

/* Condensed banner: wider box, smaller text/buttons, single-line actions. */
.wpcc-banner.wpcc-compact {
	max-width: 560px;
	padding: 14px 16px;
}

.wpcc-compact .wpcc-banner__title {
	font-size: 15px;
	margin-bottom: 4px;
}

.wpcc-compact .wpcc-banner__message {
	font-size: 13px;
}

.wpcc-compact .wpcc-banner__actions {
	flex-wrap: nowrap;
	gap: 6px;
	margin-top: 12px;
}

.wpcc-compact .wpcc-banner__actions .wpcc-btn {
	padding: 7px 11px;
	font-size: 13px;
	white-space: nowrap;
	flex: 0 1 auto;
}

/* Drop the CCPA opt-out link onto its own row so the three main buttons keep
   a single line even in compact mode. */
.wpcc-compact .wpcc-btn--link {
	flex-basis: 100%;
	text-align: left;
	padding: 2px 0;
}

/* ----------------------------- Responsive ------------------------------ */

@media ( max-width: 600px ) {
	.wpcc-banner {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: none;
		border-radius: 0;
	}
	.wpcc-banner__actions .wpcc-btn { flex: 1 1 auto; }
}
