/**
 * Simple Cookie Consent — estilos de frontend.
 * Las variables --scc-* se inyectan desde los ajustes del plugin.
 */

:root {
	--scc-accent: #054a91;
	--scc-accent-contrast: #ffffff;
	--scc-accent-hover: #0a6bd1;
	--scc-accent-hover-contrast: #ffffff;
	--scc-radius: 14px;
	--scc-font-size: 14px;
	--scc-font-family: inherit;
	--scc-surface: #ffffff;
	--scc-text: #1f2933;
	--scc-muted: #5b6673;
	--scc-hairline: rgba(15, 23, 42, 0.12);
	--scc-shadow: 0 8px 28px rgba(15, 23, 42, 0.14), 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* --- Tarjeta ------------------------------------------------------------ */

.scc-banner {
	position: fixed;
	z-index: 99998;
	display: none;
	box-sizing: border-box;
	width: 340px;
	max-width: calc(100vw - 32px);
	padding: 16px 18px;
	background: var(--scc-surface);
	border: 1px solid var(--scc-hairline);
	border-radius: var(--scc-radius);
	color: var(--scc-text);
	font-family: var(--scc-font-family);
	font-size: var(--scc-font-size);
	line-height: 1.5;
	text-align: left;
}

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

.scc-banner--shadow {
	box-shadow: var(--scc-shadow);
}

.scc-banner--bottom-right {
	right: 16px;
	bottom: 16px;
}

.scc-banner--bottom-left {
	left: 16px;
	bottom: 16px;
}

.scc-banner.is-visible {
	display: block;
	animation: scc-fade-in 0.24s ease both;
}

@keyframes scc-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* --- Contenido ---------------------------------------------------------- */

.scc-banner__title {
	margin: 0 0 6px;
	padding: 0;
	font-family: inherit;
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1.3;
	color: var(--scc-text);
}

.scc-banner__text {
	margin: 0 0 12px;
	padding: 0;
	font-size: 0.95em;
	color: var(--scc-muted);
}

.scc-banner__text a {
	color: var(--scc-accent);
}

.scc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0;
}

.scc-banner__link {
	display: inline-block;
	margin-top: 10px;
	font-size: 0.85em;
	color: var(--scc-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.scc-banner__link:hover,
.scc-banner__link:focus {
	color: var(--scc-accent-hover);
	text-decoration: underline;
}

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

/*
 * Se usa el id (#scc-banner) y !important en unas pocas propiedades porque muchos temas
 * y constructores aplican sus propios estilos de botón a cualquier <button> de la página.
 * Sin este blindaje, el botón secundario aparece con el color de marca del tema.
 */
#scc-banner .scc-btn {
	display: inline-block;
	margin: 0;
	padding: 9px 18px;
	border: 1px solid transparent;
	border-radius: 999px !important;
	font: inherit;
	font-size: 0.95em;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-shadow: none !important;
	background-image: none !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
	min-width: 0;
	min-height: 0;
	max-width: none;
	width: auto;
	height: auto;
	filter: none;
}

#scc-banner .scc-btn--accept {
	background-color: var(--scc-accent) !important;
	border-color: var(--scc-accent) !important;
	color: var(--scc-accent-contrast) !important;
}

#scc-banner .scc-btn--accept:hover,
#scc-banner .scc-btn--accept:focus {
	background-color: var(--scc-accent-hover) !important;
	border-color: var(--scc-accent-hover) !important;
	color: var(--scc-accent-hover-contrast) !important;
}

#scc-banner .scc-btn--reject {
	background-color: transparent !important;
	border-color: var(--scc-hairline) !important;
	color: var(--scc-muted) !important;
	font-weight: 500;
}

#scc-banner .scc-btn--reject:hover,
#scc-banner .scc-btn--reject:focus {
	background-color: transparent !important;
	border-color: var(--scc-accent-hover) !important;
	color: var(--scc-accent-hover) !important;
}

/* --- Foco visible ------------------------------------------------------- */

#scc-banner .scc-btn:focus-visible,
.scc-banner__link:focus-visible,
.scc-toggle:focus-visible,
.scc-settings-link:focus-visible {
	outline: 2px solid var(--scc-accent);
	outline-offset: 2px;
}

/* Reserva para navegadores sin :focus-visible. */
#scc-banner .scc-btn:focus,
.scc-toggle:focus,
.scc-settings-link:focus {
	outline: 2px solid var(--scc-accent);
	outline-offset: 2px;
}

#scc-banner .scc-btn:focus:not(:focus-visible),
.scc-toggle:focus:not(:focus-visible),
.scc-settings-link:focus:not(:focus-visible) {
	outline: none;
}

/* --- Enlace de reapertura (shortcode / función PHP) --------------------- */

.scc-settings-link {
	padding: 0;
	background: none;
	border: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.scc-settings-link:hover {
	color: var(--scc-accent-hover);
}

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

.scc-toggle {
	position: fixed;
	z-index: 99997;
	display: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: var(--scc-surface);
	border: 1px solid var(--scc-hairline);
	border-radius: 999px;
	color: var(--scc-muted);
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
	transition: color 0.15s ease, border-color 0.15s ease;
}

.scc-toggle.is-visible {
	display: inline-flex;
}

.scc-toggle:hover {
	color: var(--scc-accent-hover);
	border-color: var(--scc-accent-hover);
}

.scc-toggle--bottom-right {
	right: 16px;
	bottom: 16px;
}

.scc-toggle--bottom-left {
	left: 16px;
	bottom: 16px;
}

.scc-toggle__icon {
	display: inline-flex;
	line-height: 0;
}

.scc-screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

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

@media (max-width: 480px) {
	.scc-banner {
		width: auto;
		max-width: none;
		left: 12px;
		right: 12px;
		bottom: 12px;
		padding: 14px 16px;
	}

	#scc-banner .scc-btn {
		flex: 1 1 auto;
	}

	.scc-toggle--bottom-right {
		right: 12px;
		bottom: 12px;
	}

	.scc-toggle--bottom-left {
		left: 12px;
		bottom: 12px;
	}
}

/* --- Movimiento reducido ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.scc-banner.is-visible {
		animation: none;
	}

	#scc-banner .scc-btn,
	.scc-toggle {
		transition: none;
	}
}
