/**
 * ChaCha Home — DEV-18 Cookie / Consent Management v1.0
 */

body.chacha-consent-lock {
	overflow: hidden;
}

.chacha-consent [hidden] {
	display: none !important;
}

.chacha-consent__banner {
	position: fixed;
	left: 50%;
	bottom: 20px;
	z-index: 99980;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 28px;
	align-items: center;
	width: min(calc(100% - 40px), 1180px);
	padding: 22px 24px;
	transform: translateX(-50%);
	background: rgba(255, 253, 250, 0.985);
	border: 1px solid rgba(86, 69, 58, 0.18);
	border-radius: 8px;
	box-shadow: 0 18px 48px rgba(32, 26, 23, 0.16);
	backdrop-filter: blur(14px);
}

.chacha-consent__banner-copy {
	min-width: 0;
	max-width: 720px;
}

.chacha-consent__eyebrow,
.chacha-consent__title,
.chacha-consent__text,
.chacha-consent__dialog-title,
.chacha-consent__dialog-intro,
.chacha-consent__category p,
.chacha-consent__policy-link {
	margin: 0;
}

.chacha-consent__eyebrow {
	margin-bottom: 7px;
	font-family: var(--chacha-font-body, Arial, sans-serif);
	font-size: 10px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.16em;
	color: var(--chacha-brass, #B08D57);
}

.chacha-consent__title,
.chacha-consent__dialog-title {
	font-family: var(--chacha-font-heading, Georgia, serif);
	font-weight: 500;
	color: var(--chacha-espresso, #201A17);
}

.chacha-consent__title {
	font-size: clamp(21px, 2vw, 27px);
	line-height: 1.16;
}

.chacha-consent__text,
.chacha-consent__dialog-intro,
.chacha-consent__category p {
	font-family: var(--chacha-font-body, Arial, sans-serif);
	font-size: 13px;
	line-height: 1.65;
	color: var(--chacha-text, #5D514B);
}

.chacha-consent__text {
	margin-top: 8px;
}

.chacha-consent a {
	color: var(--chacha-espresso, #201A17);
	text-decoration: underline;
	text-decoration-color: rgba(176, 141, 87, 0.65);
	text-underline-offset: 3px;
}

.chacha-consent a:hover,
.chacha-consent a:focus-visible {
	color: var(--chacha-brass-dark, #8D6C3D);
}

.chacha-consent__banner-actions,
.chacha-consent__dialog-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 9px;
}

.chacha-consent__button,
.chacha-consent__reopen,
.chacha-consent__close {
	appearance: none;
	font-family: var(--chacha-font-body, Arial, sans-serif);
	cursor: pointer;
}

.chacha-consent__button {
	min-height: 42px;
	padding: 0 15px;
	border: 1px solid transparent;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.055em;
	white-space: nowrap;
	transition:
		background-color 160ms ease,
		border-color 160ms ease,
		color 160ms ease;
}

.chacha-consent__button--primary {
	background: var(--chacha-espresso, #201A17);
	border-color: var(--chacha-espresso, #201A17);
	color: #FFFDFC;
}

.chacha-consent__button--primary:hover {
	background: #352A25;
	border-color: #352A25;
}

.chacha-consent__button--secondary {
	background: transparent;
	border-color: rgba(32, 26, 23, 0.38);
	color: var(--chacha-espresso, #201A17);
}

.chacha-consent__button--secondary:hover {
	border-color: var(--chacha-espresso, #201A17);
	background: rgba(32, 26, 23, 0.045);
}

.chacha-consent__button--ghost {
	min-height: 36px;
	padding-inline: 9px;
	background: transparent;
	border-color: transparent;
	color: #65584F;
}

.chacha-consent__button--ghost:hover {
	color: var(--chacha-espresso, #201A17);
	background: rgba(176, 141, 87, 0.07);
}

.chacha-consent__button:focus-visible,
.chacha-consent__reopen:focus-visible,
.chacha-consent__close:focus-visible,
.chacha-consent__switch input:focus-visible + .chacha-consent__switch-track {
	outline: 2px solid var(--chacha-brass, #B08D57);
	outline-offset: 3px;
}

.chacha-consent__reopen {
	position: fixed;
	left: max(16px, env(safe-area-inset-left));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 9500;
	min-height: 36px;
	padding: 0 12px;
	background: rgba(255, 253, 250, 0.96);
	border: 1px solid rgba(86, 69, 58, 0.24);
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(32, 26, 23, 0.10);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--chacha-espresso, #201A17);
}

.chacha-consent__reopen:hover {
	border-color: rgba(176, 141, 87, 0.72);
}

.chacha-consent__overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(24, 19, 17, 0.54);
	backdrop-filter: blur(3px);
}

.chacha-consent__dialog {
	width: min(100%, 680px);
	max-height: min(86vh, 760px);
	overflow: auto;
	padding: 28px;
	background: #FFFDFC;
	border: 1px solid rgba(86, 69, 58, 0.18);
	border-radius: 8px;
	box-shadow: 0 24px 70px rgba(24, 19, 17, 0.24);
}

.chacha-consent__dialog-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
}

.chacha-consent__dialog-title {
	font-size: clamp(25px, 3vw, 34px);
	line-height: 1.12;
}

.chacha-consent__close {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	background: transparent;
	border: 1px solid rgba(86, 69, 58, 0.22);
	border-radius: 999px;
	font-size: 25px;
	font-weight: 300;
	line-height: 1;
	color: var(--chacha-espresso, #201A17);
}

.chacha-consent__close:hover {
	border-color: rgba(176, 141, 87, 0.72);
	background: rgba(176, 141, 87, 0.06);
}

.chacha-consent__dialog-intro {
	margin-top: 12px;
	max-width: 570px;
}

.chacha-consent__categories {
	margin-top: 24px;
	border-top: 1px solid rgba(86, 69, 58, 0.14);
}

.chacha-consent__category {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 24px;
	align-items: center;
	padding: 18px 0;
	border-bottom: 1px solid rgba(86, 69, 58, 0.14);
}

.chacha-consent__category-title {
	display: inline-block;
	font-family: var(--chacha-font-body, Arial, sans-serif);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: 0.035em;
	color: var(--chacha-espresso, #201A17);
}

.chacha-consent__category p {
	margin-top: 5px;
	max-width: 500px;
}

.chacha-consent__required {
	display: inline-block;
	margin-left: 8px;
	padding: 3px 7px;
	border-radius: 999px;
	background: rgba(176, 141, 87, 0.11);
	font-family: var(--chacha-font-body, Arial, sans-serif);
	font-size: 9px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.06em;
	color: #7B5E37;
	vertical-align: 1px;
}

.chacha-consent__switch {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.chacha-consent__switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.chacha-consent__switch-track {
	position: relative;
	display: block;
	width: 46px;
	height: 26px;
	border: 1px solid rgba(86, 69, 58, 0.30);
	border-radius: 999px;
	background: #E9E2DA;
	transition:
		background-color 160ms ease,
		border-color 160ms ease;
}

.chacha-consent__switch-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #FFFDFC;
	box-shadow: 0 1px 4px rgba(32, 26, 23, 0.20);
	transition: transform 160ms ease;
}

.chacha-consent__switch input:checked + .chacha-consent__switch-track {
	border-color: var(--chacha-espresso, #201A17);
	background: var(--chacha-espresso, #201A17);
}

.chacha-consent__switch input:checked + .chacha-consent__switch-track .chacha-consent__switch-thumb {
	transform: translateX(20px);
}

.chacha-consent__switch input:disabled + .chacha-consent__switch-track {
	cursor: not-allowed;
	border-color: rgba(176, 141, 87, 0.65);
	background: var(--chacha-brass, #B08D57);
}

.chacha-consent__dialog-actions {
	margin-top: 24px;
	flex-wrap: wrap;
}

.chacha-consent__policy-link {
	margin-top: 16px;
	text-align: right;
	font-family: var(--chacha-font-body, Arial, sans-serif);
	font-size: 11px;
}

@media (max-width: 900px) {
	.chacha-consent__banner {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.chacha-consent__banner-actions {
		justify-content: flex-start;
		flex-wrap: wrap;
	}
}

@media (max-width: 600px) {
	.chacha-consent__banner {
		bottom: max(10px, env(safe-area-inset-bottom));
		width: calc(100% - 20px);
		padding: 18px;
		border-radius: 6px;
	}

	.chacha-consent__title {
		font-size: 22px;
	}

	.chacha-consent__banner-actions,
	.chacha-consent__dialog-actions {
		display: grid;
		grid-template-columns: 1fr;
		width: 100%;
	}

	.chacha-consent__button {
		width: 100%;
		min-height: 44px;
	}

	.chacha-consent__button--ghost {
		order: 3;
	}

	.chacha-consent__overlay {
		align-items: end;
		padding: 10px;
	}

	.chacha-consent__dialog {
		width: 100%;
		max-height: calc(100dvh - 20px);
		padding: 22px 18px;
		border-radius: 8px 8px 4px 4px;
	}

	.chacha-consent__dialog-head {
		gap: 14px;
	}

	.chacha-consent__dialog-title {
		font-size: 26px;
	}

	.chacha-consent__category {
		gap: 16px;
	}

	.chacha-consent__reopen {
		left: max(10px, env(safe-area-inset-left));
		bottom: max(10px, env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	.chacha-consent__button,
	.chacha-consent__switch-track,
	.chacha-consent__switch-thumb {
		transition: none;
	}
}

@media print {
	.chacha-consent {
		display: none !important;
	}
}
