/**
 * Administrador de consentimiento Segurihost.
 * Tokens alineados al sistema visual: texto #0F172A, acento #3F6FE0, superficies blancas.
 */

:root {
	--sh-cc-text: #0f172a;
	--sh-cc-muted: #64748b;
	--sh-cc-primary: #3f6fe0;
	--sh-cc-primary-hover: #355fc4;
	--sh-cc-border: #d6dde8;
	--sh-cc-border-strong: #3f6fe0;
	--sh-cc-bg: #ffffff;
	--sh-cc-row: #f8fafc;
	--sh-cc-shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
	--sh-cc-radius: 12px;
	--sh-cc-banner-space: 0px;
	--sh-cc-z-float: 1050;
	--sh-cc-z-banner: 1100;
	--sh-cc-z-overlay: 10020;
	--sh-cc-z-dialog: 10021;
}

.sh-cc-banner,
.sh-cc-dialog,
.sh-cc-launcher {
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--sh-cc-text);
}

.sh-cc-banner[hidden],
.sh-cc-overlay[hidden],
.sh-cc-launcher[hidden] {
	display: none !important;
}

/* Banner inferior ancho */
.sh-cc-banner {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: var(--sh-cc-z-banner);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 20px 24px;
	background: var(--sh-cc-bg);
	border-radius: var(--sh-cc-radius);
	box-shadow: var(--sh-cc-shadow);
	border: 1px solid rgba(15, 23, 42, 0.06);
	max-width: 1280px;
	margin-left: auto;
	margin-right: auto;
	width: auto;
}

.sh-cc-banner__copy {
	flex: 1 1 auto;
	min-width: 0;
}

.sh-cc-banner__title {
	margin: 0 0 6px;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--sh-cc-text);
}

.sh-cc-banner__text {
	margin: 0 0 8px;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--sh-cc-text);
}

.sh-cc-banner__link {
	color: var(--sh-cc-primary);
	text-decoration: underline;
	font-weight: 600;
	font-size: 0.9375rem;
}

.sh-cc-banner__link:hover,
.sh-cc-banner__link:focus-visible {
	color: var(--sh-cc-primary-hover);
}

.sh-cc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	flex: 0 0 auto;
}

.sh-cc-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 132px;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sh-cc-btn:focus-visible,
.sh-cc-switch:focus-visible,
.sh-cc-dialog__close:focus-visible,
.sh-cc-launcher:focus-visible,
.sh-cc-open-prefs:focus-visible {
	outline: 2px solid var(--sh-cc-primary);
	outline-offset: 2px;
}

.sh-cc-btn--primary {
	background: var(--sh-cc-primary);
	border: 2px solid var(--sh-cc-primary);
	color: #fff;
}

.sh-cc-btn--primary:hover {
	background: var(--sh-cc-primary-hover);
	border-color: var(--sh-cc-primary-hover);
	color: #fff;
}

.sh-cc-btn--reject {
	background: #fff;
	border: 2px solid var(--sh-cc-border-strong);
	color: var(--sh-cc-text);
}

.sh-cc-btn--reject:hover {
	background: #f1f5fd;
	color: var(--sh-cc-text);
}

.sh-cc-btn--secondary {
	background: #fff;
	border: 2px solid var(--sh-cc-border);
	color: var(--sh-cc-text);
}

.sh-cc-btn--secondary:hover {
	border-color: #94a3b8;
	background: #f8fafc;
}

/* Overlay + modal */
.sh-cc-overlay {
	position: fixed;
	inset: 0;
	z-index: var(--sh-cc-z-overlay);
	background: rgba(15, 23, 42, 0.55);
}

.sh-cc-dialog {
	position: fixed;
	z-index: var(--sh-cc-z-dialog);
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(560px, calc(100vw - 32px));
	max-height: min(90vh, 720px);
	display: flex;
	flex-direction: column;
	background: var(--sh-cc-bg);
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
	padding: 28px 28px 20px;
}

.sh-cc-dialog[hidden] {
	display: none !important;
}

.sh-cc-dialog__header {
	position: relative;
	padding-right: 44px;
	margin-bottom: 20px;
	flex: 0 0 auto;
}

.sh-cc-dialog__title {
	margin: 0 0 6px;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--sh-cc-text);
}

.sh-cc-dialog__intro {
	margin: 0;
	font-size: 0.975rem;
	color: var(--sh-cc-muted);
	line-height: 1.45;
}

.sh-cc-dialog__close {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 44px;
	height: 44px;
	border: 0;
	background: transparent;
	color: var(--sh-cc-text);
	cursor: pointer;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.sh-cc-dialog__close:hover {
	background: var(--sh-cc-row);
}

.sh-cc-dialog__body {
	overflow-y: auto;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-right: 4px;
	margin-right: -4px;
}

.sh-cc-category {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--sh-cc-border);
	border-radius: 12px;
	background: #fff;
}

.sh-cc-category__icon {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: #e8eefc;
	color: var(--sh-cc-primary);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.sh-cc-category__icon svg {
	width: 20px;
	height: 20px;
	display: block;
}

.sh-cc-category__copy {
	flex: 1 1 auto;
	min-width: 0;
}

.sh-cc-category__title {
	margin: 0 0 4px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--sh-cc-text);
}

.sh-cc-category__desc {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--sh-cc-muted);
}

.sh-cc-category__control {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 10px;
}

.sh-cc-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: #e8eefc;
	color: var(--sh-cc-primary);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
}

.sh-cc-switch {
	position: relative;
	width: 48px;
	height: 28px;
	border-radius: 999px;
	border: 0;
	padding: 0;
	background: #cbd5e1;
	cursor: pointer;
	flex: 0 0 48px;
}

.sh-cc-switch[aria-checked="true"] {
	background: var(--sh-cc-primary);
}

.sh-cc-switch[aria-disabled="true"],
.sh-cc-switch:disabled {
	cursor: not-allowed;
	background: var(--sh-cc-primary);
	opacity: 1;
}

.sh-cc-switch__knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.16s ease;
}

.sh-cc-switch[aria-checked="true"] .sh-cc-switch__knob,
.sh-cc-switch:disabled .sh-cc-switch__knob {
	transform: translateX(20px);
}

.sh-cc-switch__knob svg {
	width: 11px;
	height: 11px;
	color: var(--sh-cc-primary);
}

.sh-cc-dialog__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
	padding-top: 16px;
	flex: 0 0 auto;
}

.sh-cc-dialog__actions .sh-cc-btn {
	flex: 1 1 auto;
}

/* Botón minimizado inferior izquierdo */
.sh-cc-launcher {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: var(--sh-cc-z-float);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid var(--sh-cc-border);
	border-radius: 999px;
	background: var(--sh-cc-bg);
	color: var(--sh-cc-text);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 600;
}

.sh-cc-launcher:hover {
	border-color: var(--sh-cc-primary);
	color: var(--sh-cc-primary);
}

.sh-cc-launcher svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

.sh-cc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Footer: el botón debe verse como el resto de enlaces */
footer .sh-cc-open-prefs {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: var(--aluminium-gray, rgba(255, 255, 255, 0.7));
	cursor: pointer;
	text-align: inherit;
	text-decoration: none;
}

footer .sh-cc-open-prefs:hover,
footer .sh-cc-open-prefs:focus-visible {
	color: var(--base-color, #3f6fe0);
	text-decoration: none;
}

/* WhatsApp permanece a la derecha; el banner lo eleva si está visible */
.contactar_whatsapp {
	left: auto !important;
	right: 16px;
}

body.sh-cc-banner-visible .contactar_whatsapp {
	bottom: calc(var(--sh-cc-banner-space, 0px) + 16px) !important;
	left: auto !important;
	right: 16px !important;
	z-index: 1101;
}

body.sh-cc-modal-open {
	overflow: hidden;
}

body.sh-cc-modal-open .contactar_whatsapp,
body.sh-cc-modal-open .sh-cc-launcher {
	visibility: hidden;
	pointer-events: none;
}

@media (max-width: 991px) {
	.sh-cc-banner {
		flex-direction: column;
		align-items: stretch;
		left: 12px;
		right: 12px;
		bottom: 12px;
		padding: 18px 16px;
		gap: 16px;
	}

	.sh-cc-banner__actions {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.sh-cc-banner__actions .sh-cc-btn {
		width: 100%;
		min-width: 0;
	}

	.sh-cc-dialog {
		padding: 22px 18px 16px;
		width: calc(100vw - 24px);
	}

	.sh-cc-category {
		flex-wrap: wrap;
	}

	.sh-cc-category__control {
		width: 100%;
		justify-content: flex-end;
		margin-top: 4px;
	}

	.sh-cc-dialog__actions {
		flex-direction: column;
	}

	.sh-cc-dialog__actions .sh-cc-btn {
		width: 100%;
	}

	.sh-cc-launcher {
		left: 12px;
		bottom: 12px;
		padding: 10px 12px;
	}

	.sh-cc-launcher__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sh-cc-btn,
	.sh-cc-switch__knob,
	.sh-cc-launcher {
		transition: none;
	}
}
