/* ═══════════════════════════════════════════════════════════
   Cookies CP v2.0 — Chile Privacidad
   Palette: #76b4de (banner bg), #111, #fff, #f7f7f7
   ═══════════════════════════════════════════════════════════ */

/* ── Reset scoping ─────────────────────────────────────────── */

#cp-cookies-root,
#cp-cookies-root *,
#cp-cookies-root *::before,
#cp-cookies-root *::after {
	box-sizing: border-box;
}

#cp-cookies-root {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.65;
	color: #111;
	-webkit-font-smoothing: antialiased;
}

#cp-cookies-root[aria-hidden="true"] .cpc-banner,
#cp-cookies-root[aria-hidden="true"] .cpc-overlay,
#cp-cookies-root[aria-hidden="true"] .cpc-modal {
	display: none;
}

/* ═══════════════════════════════════════════════════════════
   BANNER — Step 1
   Full-width bar at the bottom, blue Chile Privacidad bg
   ═══════════════════════════════════════════════════════════ */

.cpc-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99990;
	display: none;
	background: #76b4de;
	border-top: 1px solid #9dc8e7;
	box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.18);
	animation: cpcSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.cpc-banner.is-visible {
	display: block;
}

@keyframes cpcSlideUp {
	from { transform: translateY(100%); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

.cpc-banner__inner {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 28px;
	align-items: center;
	max-width: 1400px;
	margin: 0 auto;
	padding: 28px 48px;
}

.cpc-banner__content {
	min-width: 0;
}

.cpc-banner__title {
	margin: 0 0 10px;
	font-size: 1.6rem;
	font-weight: 300;
	line-height: 1.2;
	color: #fff;
}

.cpc-banner__text {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.7;
	color: #fff;
}

.cpc-banner__link {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cpc-banner__link:hover {
	opacity: 0.85;
}

.cpc-banner__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex-shrink: 0;
	min-width: 240px;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */

.cpc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 13px 22px;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	text-decoration: none;
	text-align: center;
	transition: all 0.18s ease;
}

.cpc-btn:hover {
	transform: translateY(-1px);
}

.cpc-btn:focus-visible {
	outline: 2px solid #76b4de;
	outline-offset: 2px;
}

.cpc-btn[disabled] {
	opacity: 0.5;
	cursor: wait;
	transform: none;
}

/* Outline light — banner "Aceptar solo esenciales" */
.cpc-btn--outline-light {
	background: transparent;
	border-color: #111;
	color: #111;
}
.cpc-btn--outline-light:hover {
	background: rgba(0,0,0,0.08);
}

/* Accept — green-ish button */
.cpc-btn--accept {
	background: #7fbf5f;
	border-color: #7fbf5f;
	color: #fff;
}
.cpc-btn--accept:hover {
	background: #6aad4a;
	border-color: #6aad4a;
}

/* Config — white/light button */
.cpc-btn--config {
	background: #fff;
	border-color: #ccc;
	color: #111;
}
.cpc-btn--config:hover {
	background: #f5f5f5;
}

/* Primary — dark filled */
.cpc-btn--primary {
	background: #111;
	border-color: #111;
	color: #fff;
}
.cpc-btn--primary:hover {
	background: #333;
	border-color: #333;
}

/* Outline — modal "Rechazar" */
.cpc-btn--outline {
	background: #fff;
	border-color: #ccc;
	color: #444;
}
.cpc-btn--outline:hover {
	background: #f5f5f5;
	border-color: #999;
}

/* Link style */
.cpc-btn--link {
	background: transparent;
	border: none;
	padding: 13px 8px;
	color: #111;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.cpc-btn--link:hover {
	color: #555;
}

/* Trigger (shortcode button) */
.cpc-trigger {
	appearance: none;
	border: none;
	background: none;
	padding: 0;
	color: #76b4de;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}
.cpc-trigger:hover {
	color: #4a94c0;
}

/* ═══════════════════════════════════════════════════════════
   OVERLAY + MODAL — Step 2
   ═══════════════════════════════════════════════════════════ */

.cpc-overlay {
	position: fixed;
	inset: 0;
	z-index: 99991;
	display: none;
	background: rgba(0, 0, 0, 0.50);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	animation: cpcFadeIn 0.25s ease both;
}

.cpc-overlay.is-visible {
	display: block;
}

@keyframes cpcFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.cpc-modal {
	position: fixed;
	inset: 0;
	z-index: 99992;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: cpcScaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.cpc-modal.is-visible {
	display: flex;
}

@keyframes cpcScaleIn {
	from { transform: scale(0.96); opacity: 0; }
	to   { transform: scale(1);    opacity: 1; }
}

html.cpc-lock,
body.cpc-lock {
	overflow: hidden !important;
}

/* ── Modal card ────────────────────────────────────────────── */

.cpc-modal__card {
	width: min(100%, 900px);
	max-height: min(92vh, 900px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
	overflow: hidden;
}

/* Header */
.cpc-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 28px 30px 22px;
	border-bottom: 1px solid #e8edf2;
}

.cpc-modal__eyebrow {
	display: block;
	margin-bottom: 6px;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #76b4de;
}

.cpc-modal__title {
	margin: 0;
	font-size: 1.8rem;
	font-weight: 700;
	line-height: 1.15;
	color: #76b4de;
}

.cpc-modal__close {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border: 1px solid #e0e0e0;
	border-radius: 50%;
	background: #fff;
	color: #888;
	cursor: pointer;
	transition: all 0.18s ease;
}

.cpc-modal__close:hover {
	background: #f5f5f5;
	color: #111;
	border-color: #bbb;
}

/* Body */
.cpc-modal__body {
	flex: 1;
	overflow-y: auto;
	padding: 0;
}

.cpc-modal__section {
	padding: 22px 30px;
}

.cpc-modal__section p {
	margin: 0 0 14px;
	font-size: 0.95rem;
	line-height: 1.65;
	color: #333;
}

.cpc-modal__section p:last-child {
	margin-bottom: 0;
}

.cpc-modal__subtitle {
	margin: 0 0 12px;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
	color: #111;
}

.cpc-modal__note {
	font-style: italic;
	color: #666 !important;
}

/* Lists */
.cpc-list {
	margin: 8px 0 14px 20px;
	padding: 0;
	color: #333;
	font-size: 0.93rem;
}

.cpc-list li {
	margin-bottom: 6px;
	line-height: 1.6;
}

.cpc-list--links li {
	margin-bottom: 4px;
}

.cpc-list a {
	color: #76b4de;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cpc-list a:hover {
	color: #4a94c0;
}

/* ═══════════════════════════════════════════════════════════
   COOKIE CATEGORIES
   ═══════════════════════════════════════════════════════════ */

.cpc-category {
	border-top: 1px solid #eaeef2;
}

.cpc-category:last-of-type {
	border-bottom: 1px solid #eaeef2;
}

.cpc-category__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 30px;
	background: #f7f8fa;
}

.cpc-category__info {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.cpc-category__name {
	font-size: 1.05rem;
	font-weight: 700;
	color: #111;
}

.cpc-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cpc-badge--locked {
	width: 28px;
	height: 28px;
	border-radius: 4px;
	background: #d9e9f5;
	color: #111;
}

.cpc-category__body {
	padding: 16px 30px 6px;
}

.cpc-category__body p {
	margin: 0 0 12px;
	font-size: 0.93rem;
	line-height: 1.65;
	color: #333;
}

/* ── Toggle switch ─────────────────────────────────────────── */

.cpc-toggle {
	position: relative;
	flex-shrink: 0;
}

.cpc-toggle input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.cpc-toggle label {
	display: block;
	width: 44px;
	height: 24px;
	border-radius: 12px;
	background: #ccc;
	cursor: pointer;
	transition: background 0.25s ease;
	position: relative;
}

.cpc-toggle label::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,0.18);
	transition: transform 0.25s ease;
}

.cpc-toggle input:checked + label {
	background: #76b4de;
}

.cpc-toggle input:checked + label::after {
	transform: translateX(20px);
}

/* ── Detail toggle / table ─────────────────────────────────── */

.cpc-detail-toggle {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin: 4px 0 10px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	color: #76b4de;
	transition: color 0.18s ease;
}

.cpc-detail-toggle:hover {
	color: #4a94c0;
}

.cpc-detail-toggle__icon {
	transition: transform 0.25s ease;
}

.cpc-detail-toggle.is-open .cpc-detail-toggle__icon {
	transform: rotate(180deg);
}

.cpc-detail {
	display: none;
	margin-bottom: 12px;
	overflow-x: auto;
}

.cpc-detail.is-visible {
	display: block;
}

.cpc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	border: 1px solid #dcdcdc;
}

.cpc-table th,
.cpc-table td {
	padding: 12px 14px;
	border: 1px solid #dcdcdc;
	text-align: left;
	vertical-align: top;
}

.cpc-table th {
	background: #111;
	color: #fff;
	font-size: 0.82rem;
	font-weight: 600;
}

.cpc-table td {
	background: #fff;
	color: #333;
}

/* ── Modal footer ──────────────────────────────────────────── */

.cpc-modal__footer {
	padding: 18px 30px 24px;
	border-top: 1px solid #e8edf2;
	background: #fafbfc;
}

.cpc-modal__status {
	margin: 0 0 12px;
	padding: 10px 14px;
	border-radius: 8px;
	background: #e8f4fb;
	font-size: 0.88rem;
	font-weight: 600;
	color: #135a82;
}

.cpc-modal__status:empty {
	display: none;
}

.cpc-modal__buttons {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.cpc-modal__buttons-right {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   FLOATING ACTION BUTTON (bottom-left)
   ═══════════════════════════════════════════════════════════ */

.cpc-fab {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 99989;
	display: none;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.20), 0 1px 6px rgba(0, 0, 0, 0.10);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	overflow: hidden;
}

.cpc-fab.is-visible {
	display: flex;
	animation: cpcFabIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.cpc-fab:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.cpc-fab:active {
	transform: scale(0.95);
}

@keyframes cpcFabIn {
	from { transform: scale(0); opacity: 0; }
	to   { transform: scale(1); opacity: 1; }
}

.cpc-fab__logo {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

/* ═══════════════════════════════════════════════════════════
   FIXED CONTACT BUTTONS (bottom-right)
   ═══════════════════════════════════════════════════════════ */

.cp-fixed-contact {
	position: fixed;
	right: clamp(12px, 2vw, 24px);
	bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
	z-index: 99988;
	display: flex;
	flex-direction: row;
	align-items: flex-end;
	gap: 12px;
	max-width: calc(100vw - 24px);
}

.cp-fixed-contact__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 1px solid #87cafa;
	border-radius: 50%;
	background: #87cafa;
	color: #ffffff !important;
	box-shadow: none !important;
	text-decoration: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.cp-fixed-contact__button:hover,
.cp-fixed-contact__button:focus,
.cp-fixed-contact__button:active,
.cp-fixed-contact__button:visited {
	color: #ffffff !important;
	text-decoration: none;
	box-shadow: none !important;
}

.cp-fixed-contact__button:hover,
.cp-fixed-contact__button:focus-visible {
	opacity: 0.92;
	transform: translateY(-1px);
	outline: none;
}

.cp-fixed-contact__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
}

.cp-fixed-contact__icon svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
	.cpc-banner__inner {
		grid-template-columns: 1fr;
		gap: 16px;
		padding: 22px 20px;
	}

	.cpc-banner__title {
		font-size: 1.3rem;
	}

	.cpc-banner__actions {
		min-width: 0;
	}

	.cpc-banner__actions .cpc-btn {
		width: 100%;
	}

	.cpc-modal {
		padding: 10px;
	}

	.cpc-modal__card {
		max-height: 95vh;
	}

	.cpc-modal__header {
		padding: 20px 18px 16px;
	}

	.cpc-modal__title {
		font-size: 1.4rem;
	}

	.cpc-modal__section {
		padding: 18px;
	}

	.cpc-category__header {
		padding: 14px 18px;
	}

	.cpc-category__body {
		padding: 14px 18px 6px;
	}

	.cpc-modal__footer {
		padding: 16px 18px 20px;
	}

	.cpc-modal__buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.cpc-modal__buttons-right {
		flex-direction: column;
		align-items: stretch;
	}

	.cpc-modal__buttons .cpc-btn,
	.cpc-modal__buttons-right .cpc-btn {
		width: 100%;
	}

	.cpc-modal__buttons .cpc-btn--link {
		text-align: center;
	}

	.cp-fixed-contact {
		flex-direction: column;
		right: 12px;
		bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
		gap: 10px;
		align-items: flex-end;
	}

	.cp-fixed-contact__button {
		width: 52px;
		min-width: 52px;
		max-width: 52px;
		height: 52px;
		min-height: 52px;
	}

	.cp-fixed-contact__icon {
		width: 22px;
		height: 22px;
		flex: 0 0 22px;
	}

	.cp-fixed-contact__icon svg {
		width: 22px;
		height: 22px;
	}
}
