/* Vestra Cookies: banner y panel. Todo va dentro de .vck para no chocar con el tema. */

.vck {
	--vck-primary: #1863dc;
	--vck-on-primary: #fff;
	--vck-bg: #fff;
	--vck-text: #1f2328;
	--vck-muted: #57606a;
	--vck-border: #d8dee4;
	--vck-soft: #f6f8fa;
	--vck-radius: 10px;
	--vck-btn-radius: 6px;
	--vck-floating-radius: 12px;
	--vck-shadow: 0 8px 32px rgba(0, 0, 0, .18);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--vck-text);
}

/* Textos secundarios, bordes y fondos suaves salen del fondo y el texto elegidos,
   para que se lean bien también con un fondo oscuro. */
@supports (color: color-mix(in srgb, red, blue)) {
	.vck {
		--vck-muted: color-mix(in srgb, var(--vck-text) 78%, var(--vck-bg));
		--vck-border: color-mix(in srgb, var(--vck-text) 16%, var(--vck-bg));
		--vck-soft: color-mix(in srgb, var(--vck-text) 5%, var(--vck-bg));
	}
}

.vck [hidden],
.vck[hidden] {
	display: none !important;
}

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

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

.vck-banner {
	position: fixed;
	z-index: 2147483000;
	background: var(--vck-bg);
	color: var(--vck-text);
	box-shadow: var(--vck-shadow);
	padding: 20px 24px;
	display: flex;
	gap: 16px 32px;
	align-items: center;
	animation: vck-in .25s ease-out;
}

.vck--bar .vck-banner {
	left: 0;
	right: 0;
	bottom: 0;
	border-top: 1px solid var(--vck-border);
	justify-content: center;
}

.vck--bar .vck-banner__text {
	max-width: 760px;
}

.vck--box-left .vck-banner,
.vck--box-right .vck-banner {
	bottom: 20px;
	width: 420px;
	max-width: calc(100vw - 32px);
	flex-direction: column;
	align-items: stretch;
	border-radius: var(--vck-radius);
	border: 1px solid var(--vck-border);
}

.vck--box-left .vck-banner { left: 20px; }
.vck--box-right .vck-banner { right: 20px; }

.vck-banner__title {
	margin: 0 0 4px;
	font-weight: 700;
	font-size: 17px;
}

.vck-banner__message {
	margin: 0;
	color: var(--vck-muted);
}

.vck a {
	color: var(--vck-primary);
	text-decoration: underline;
}

/* ---------- Botones ---------- */

.vck-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex-shrink: 0;
}

.vck-btn {
	appearance: none;
	margin: 0;
	padding: 10px 18px;
	min-height: 42px;
	border: 2px solid var(--vck-primary);
	border-radius: var(--vck-btn-radius);
	background: var(--vck-primary);
	color: var(--vck-on-primary);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
	transition: filter .15s;
}

.vck-btn:hover { filter: brightness(1.1); }

.vck-btn--ghost {
	background: transparent;
	color: var(--vck-primary);
}

.vck-btn:focus-visible,
.vck-close:focus-visible,
.vck-cat__toggle:focus-visible,
.vck-floating:focus-visible,
.vck-switch input:focus-visible + .vck-switch__ui {
	outline: 3px solid var(--vck-primary);
	outline-offset: 2px;
}

.vck--box-left .vck-actions .vck-btn,
.vck--box-right .vck-actions .vck-btn {
	flex: 1 1 auto;
}

/* ---------- Panel ---------- */

.vck-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	background: rgba(0, 0, 0, .5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	animation: vck-fade .2s ease-out;
}

.vck-panel {
	background: var(--vck-bg);
	color: var(--vck-text);
	width: 640px;
	max-width: 100%;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	display: flex;
	flex-direction: column;
	border-radius: var(--vck-radius);
	box-shadow: var(--vck-shadow);
	outline: none;
}

.vck-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 24px;
	border-bottom: 1px solid var(--vck-border);
}

.vck-panel__title {
	margin: 0;
	font-size: 19px;
	line-height: 1.3;
	color: inherit;
}

.vck-close {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--vck-muted);
	font-size: 28px;
	line-height: 1;
	width: 40px;
	height: 40px;
	border-radius: 6px;
	cursor: pointer;
	padding: 0;
}

.vck-close:hover { background: var(--vck-soft); }

.vck-panel__body {
	padding: 16px 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.vck-panel__intro {
	margin: 0 0 16px;
	color: var(--vck-muted);
}

.vck-panel__foot {
	padding: 16px 24px;
	border-top: 1px solid var(--vck-border);
	justify-content: flex-end;
}

/* ---------- Categorías ---------- */

.vck-cat {
	border: 1px solid var(--vck-border);
	border-radius: 8px;
	margin-bottom: 10px;
}

.vck-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 14px 6px 6px;
}

.vck-cat__toggle {
	appearance: none;
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
	text-align: left;
	padding: 8px;
	cursor: pointer;
	border-radius: 6px;
	text-transform: none;
}

.vck-cat__chevron {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform .15s;
	flex-shrink: 0;
}

.vck-cat__toggle[aria-expanded="true"] .vck-cat__chevron {
	transform: rotate(45deg);
}

.vck-cat__body {
	padding: 0 16px 14px;
	font-size: 14px;
}

.vck-cat__body > p {
	margin: 0 0 10px;
	color: var(--vck-muted);
}

.vck-always {
	font-size: 13px;
	font-weight: 600;
	color: #1a7f37;
	white-space: nowrap;
}

/* Interruptor */
.vck-switch {
	position: relative;
	display: inline-flex;
	cursor: pointer;
	margin: 0;
}

.vck-switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.vck-switch__ui {
	width: 44px;
	height: 24px;
	border-radius: 24px;
	background: #afb8c1;
	position: relative;
	transition: background .15s;
}

.vck-switch__ui::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform .15s;
}

.vck-switch input:checked + .vck-switch__ui { background: var(--vck-primary); }
.vck-switch input:checked + .vck-switch__ui::after { transform: translateX(20px); }

.vck-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Tabla de cookies (panel y shortcode) ---------- */

.vck-table-wrap {
	overflow-x: auto;
	margin: 0 0 1em;
}

.vck-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	line-height: 1.45;
}

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

.vck-table th {
	background: var(--vck-soft, #f6f8fa);
	font-weight: 600;
}

.vck-table code {
	font-size: 13px;
	word-break: break-word;
	background: none;
	padding: 0;
}

/* ---------- Botón flotante ---------- */

.vck-floating {
	position: fixed;
	z-index: 2147482999;
	width: var(--vck-floating-size, 52px);
	height: var(--vck-floating-size, 52px);
	border-radius: var(--vck-floating-radius);
	border: 0;
	background: var(--vck-floating-bg, var(--vck-primary));
	color: var(--vck-floating-icon, var(--vck-on-primary));
	box-shadow: var(--vck-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: transform .15s ease, box-shadow .15s ease;
}

.vck-floating svg {
	width: 55%;
	height: 55%;
	display: block;
}

.vck-floating:hover {
	transform: scale(1.06);
	box-shadow: 0 10px 36px rgba(0, 0, 0, .24);
}

.vck-floating--bottom-right { bottom: 20px; right: 20px; }
.vck-floating--bottom-left { bottom: 20px; left: 20px; }
.vck-floating--top-right { top: 20px; right: 20px; }
.vck-floating--top-left { top: 20px; left: 20px; }

/* Debajo de la barra de administración de WordPress cuando se está conectado. */
.admin-bar .vck-floating--top-right,
.admin-bar .vck-floating--top-left { top: 52px; }

@media (max-width: 782px) {
	.admin-bar .vck-floating--top-right,
	.admin-bar .vck-floating--top-left { top: 66px; }
}

@media (prefers-reduced-motion: reduce) {
	.vck-floating { transition: none; }
	.vck-floating:hover { transform: none; }
}

html.vck-locked { overflow: hidden; }

/* ---------- Móvil ---------- */

@media (max-width: 782px) {
	.vck--bar .vck-banner {
		flex-direction: column;
		align-items: stretch;
		padding: 16px;
		max-height: 80vh;
		overflow-y: auto;
	}

	.vck-actions .vck-btn {
		flex: 1 1 auto;
	}

	.vck--box-left .vck-banner,
	.vck--box-right .vck-banner {
		left: 16px;
		right: 16px;
		bottom: 16px;
		width: auto;
	}

	.vck-panel__head,
	.vck-panel__body,
	.vck-panel__foot {
		padding-left: 16px;
		padding-right: 16px;
	}

	/* La tabla se convierte en fichas apiladas. */
	.vck-table thead { display: none; }
	.vck-table,
	.vck-table tbody,
	.vck-table tr,
	.vck-table td { display: block; width: 100%; }
	.vck-table tr {
		border: 1px solid var(--vck-border, #d8dee4);
		border-radius: 6px;
		margin-bottom: 8px;
	}
	.vck-table td { border: 0; padding: 4px 10px; }
	.vck-table td::before {
		content: attr(data-label) ": ";
		font-weight: 600;
	}
}

@keyframes vck-in {
	from { transform: translateY(16px); opacity: 0; }
	to { transform: none; opacity: 1; }
}

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

@media (prefers-reduced-motion: reduce) {
	.vck-banner,
	.vck-overlay { animation: none; }
}
