/**
 * Bunny's Consent Gate - styles.
 *
 * Palette + look pulled from Bunny's old Complianz banner:
 *   square corners, uppercase letter-spaced type, dark-on-coral accept,
 *   burgundy active toggles, subtle bottom-border links.
 *
 * Scoped under .bcg- to avoid theme collisions. Type inherits the theme font
 * (no third-party webfont request, which matters for a consent tool).
 */

.bcg-root {
	--bcg-bg: #faf9f3;
	--bcg-light-cream: #F7F2D2;
	--bcg-cream: #ECE7CD;
	--bcg-burgundy: #5A0D15;
	--bcg-link-red: #B51D34;
	--bcg-coral: #DF4562;
	--bcg-border: #B7A889;
	--bcg-muted: #8B8070;
	--bcg-accept-text: #1B0006;
}
.bcg-root,
.bcg-root * {
	box-sizing: border-box;
}

/* ============================================================== banner === */

.bcg-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 18px;
	margin: 0 auto;
	width: 90%;
	max-width: 1080px;
	z-index: 99999;
	background: var(--bcg-bg);
	border: 1px solid var(--bcg-border);
	border-radius: 0;
	color: var(--bcg-burgundy);
	box-shadow: 0 10px 30px rgba(90, 13, 21, 0.18);
	font-size: 13px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;

	/* Slide animation: tucked below the viewport until shown. */
	transform: translateY(calc(100% + 28px));
	transition: transform 0.46s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}
.bcg-banner.is-visible {
	transform: translateY(0);
}

.bcg-banner__inner {
	position: relative;
	padding: 18px 50px 18px 24px;
	display: flex;
	align-items: center;
	gap: 30px;
}

.bcg-banner__text {
	flex: 1 1 auto;
	min-width: 0;
}

.bcg-banner__title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--bcg-burgundy);
}

.bcg-banner__msg {
	margin: 0;
	font-size: 13px;
	line-height: 1.55;
	max-width: 78ch;
	color: var(--bcg-burgundy);
}

.bcg-banner__links {
	margin-top: 9px;
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
}

.bcg-banner__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

/* Close (X) top-right. */
.bcg-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--bcg-burgundy);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.15s ease;
}
.bcg-close:hover {
	opacity: 1;
}

/* ============================================================= buttons === */

.bcg-btn {
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	line-height: 1;
	cursor: pointer;
	border-radius: 0;
	padding: 13px 26px;
	border: 1px solid transparent;
	box-shadow: none;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
	white-space: nowrap;
}

.bcg-btn--accept,
.bcg-btn--save {
	background: var(--bcg-coral);
	border-color: var(--bcg-coral);
	color: var(--bcg-accept-text);
}

.bcg-btn--ghost {
	background: var(--bcg-bg);
	border-color: var(--bcg-border);
	color: var(--bcg-burgundy);
}

/* Shared hover: invert to burgundy, like the old banner. */
.bcg-btn:hover,
.bcg-btn:focus {
	background: var(--bcg-burgundy);
	border-color: var(--bcg-burgundy);
	color: var(--bcg-light-cream);
}
.bcg-btn:focus-visible {
	outline: 2px solid var(--bcg-coral);
	outline-offset: 2px;
}

/* Subtle text link (e.g. "Privacy choices" / "Reject optional"). */
.bcg-link {
	font: inherit;
	font-size: 12.5px;
	letter-spacing: 0.02em;
	background: none;
	border: 0;
	border-bottom: 1px solid rgba(181, 29, 52, 0.35);
	padding: 0 0 1px;
	color: var(--bcg-link-red);
	text-decoration: none;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.bcg-link:hover {
	color: var(--bcg-burgundy);
	border-bottom-color: var(--bcg-burgundy);
}

/* ============================================================== modal === */

.bcg-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.24s ease, visibility 0.24s ease;
}
.bcg-modal.is-visible {
	opacity: 1;
	visibility: visible;
}

.bcg-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(90, 13, 21, 0.42);
}

.bcg-modal__panel {
	position: relative;
	width: min(480px, 100%);
	max-height: 88vh;
	overflow: auto;
	background: var(--bcg-bg);
	color: var(--bcg-burgundy);
	border: 1px solid var(--bcg-border);
	border-radius: 0;
	padding: 24px 26px;
	box-shadow: 0 20px 60px rgba(90, 13, 21, 0.30);
	transform: translateY(10px) scale(0.985);
	transition: transform 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.bcg-modal.is-visible .bcg-modal__panel {
	transform: none;
}

.bcg-modal__title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.bcg-modal__sub {
	margin: 0 0 16px;
	font-size: 12.5px;
	line-height: 1.55;
	opacity: 0.85;
}

.bcg-modal__actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 20px;
}

/* ================================================================ rows === */

.bcg-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid rgba(90, 13, 21, 0.18);
}
.bcg-row:last-child {
	border-bottom: 0;
}
.bcg-row__text h3 {
	margin: 0 0 2px;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.bcg-row__text p {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--bcg-burgundy);
	opacity: 0.8;
}

/* ============================================================== switch === */

.bcg-switch {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 25px;
	margin-top: 2px;
}
.bcg-switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.bcg-switch__track {
	position: absolute;
	inset: 0;
	background: var(--bcg-muted);
	border-radius: 999px;
	transition: background 0.18s ease;
}
.bcg-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 19px;
	height: 19px;
	background: var(--bcg-light-cream);
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(90, 13, 21, 0.25);
	transition: transform 0.18s ease;
}
/* Active track is burgundy, matching the old banner. */
.bcg-switch input:checked ~ .bcg-switch__track {
	background: var(--bcg-burgundy);
}
.bcg-switch input:checked ~ .bcg-switch__thumb {
	transform: translateX(19px);
}
.bcg-switch input:disabled {
	cursor: not-allowed;
}
.bcg-switch input:disabled ~ .bcg-switch__track {
	background: var(--bcg-burgundy);
	opacity: 0.4;
}
.bcg-switch input:focus-visible ~ .bcg-switch__track {
	outline: 2px solid var(--bcg-coral);
	outline-offset: 2px;
}

/* ============================================================ GPC note === */

.bcg-gpc-note {
	font-size: 12px;
	line-height: 1.5;
	background: var(--bcg-light-cream);
	border: 1px dashed var(--bcg-border);
	border-radius: 0;
	padding: 10px 12px;
	margin-bottom: 14px;
}

/* ========================================================== corner tab === */

.bcg-tab {
	position: fixed;
	right: 0;
	bottom: 26px;
	z-index: 99998;
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 10px 15px 10px 12px;
	background: var(--bcg-bg);
	color: var(--bcg-burgundy);
	border: 1px solid var(--bcg-border);
	border-right: 0;
	border-radius: 4px 0 0 4px;
	box-shadow: -3px 3px 16px rgba(90, 13, 21, 0.16);
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	/* Tucked so only the icon peeks; label slides in on hover/focus. */
	transform: translateX(calc(100% - 42px));
	transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.bcg-tab:hover,
.bcg-tab:focus-visible,
.bcg-tab.is-open {
	transform: translateX(0);
	outline: none;
}
.bcg-tab__icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	display: block;
}
.bcg-tab__label {
	white-space: nowrap;
}
body.bcg-banner-open .bcg-tab {
	opacity: 0;
	pointer-events: none;
}

/* Shortcode inline reopen button (rendered outside .bcg-root, so literal colors). */
.bcg-reopen-link {
	background: none;
	border: 0;
	border-bottom: 1px solid rgba(181, 29, 52, 0.35);
	padding: 0 0 1px;
	font: inherit;
	color: #B51D34;
	cursor: pointer;
}
.bcg-reopen-link:hover {
	color: #5A0D15;
	border-bottom-color: #5A0D15;
}

/* ============================================================ responsive === */

@media (max-width: 768px) {
	.bcg-banner {
		width: calc(100% - 24px);
		bottom: 12px;
	}
	.bcg-banner__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		padding: 18px;
	}
	.bcg-banner__actions {
		width: 100%;
	}
	.bcg-banner__actions .bcg-btn {
		width: 100%;
	}
	.bcg-modal__actions {
		flex-wrap: wrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bcg-banner,
	.bcg-modal,
	.bcg-modal__panel,
	.bcg-tab {
		transition: none;
	}
}
