/**
 * Functional consent chrome for measurement — not a storefront redesign.
 */
.nirsha-consent {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 100000;
	padding: 0.75rem;
	pointer-events: none;
}

.nirsha-consent[hidden],
.nirsha-consent-manage[hidden] {
	display: none !important;
}

.nirsha-consent__panel {
	pointer-events: auto;
	max-width: 70rem;
	margin: 0 auto;
	padding: 0.9rem 1rem;
	background: rgba(43, 25, 19, 0.97);
	color: #FBF7EF;
	border: 1px solid rgba(184, 137, 59, 0.28);
	border-radius: 0.6rem;
	box-shadow: 0 12px 34px rgba(32, 23, 19, 0.28);
	display: grid;
	gap: 0.3rem 1rem;
	grid-template-columns: minmax(12rem, 1fr) auto;
}

.nirsha-consent__title {
	margin: 0;
	font-size: 0.86rem;
	font-weight: 600;
	line-height: 1.3;
	/* The panel is dark cocoa with ivory text; this <h2> must keep that ivory.
	   A global heading rule forces --secondary-color (#201713) on headings,
	   which rendered the title dark-on-dark (contrast 1.12). Pin it to ivory. */
	color: #FBF7EF !important;
}

.nirsha-consent__body {
	margin: 0;
	font-size: 0.72rem;
	line-height: 1.45;
	opacity: 0.78;
}

.nirsha-consent__choices {
	display: grid;
	gap: 0.4rem;
	grid-column: 1 / -1;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin: 0.6rem 0;
}

.nirsha-consent__choice {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.88rem;
}

.nirsha-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
	grid-column: 2;
	grid-row: 1 / 3;
	justify-content: flex-end;
}

.nirsha-consent__btn {
	appearance: none;
	border: 1px solid rgba(251, 247, 239, 0.42);
	background: transparent;
	color: inherit;
	border-radius: 1.2rem;
	min-height: 2.5rem;
	padding: 0.45rem 0.8rem;
	font: inherit;
	font-size: 0.72rem;
	cursor: pointer;
}

.nirsha-consent__btn--primary {
	background: #FBF7EF;
	color: #2B1913;
	border-color: #FBF7EF;
}

.nirsha-consent__btn--link {
	border: 0;
	text-decoration: underline;
	padding-left: 0.25rem;
	padding-right: 0.25rem;
}

.nirsha-consent__link {
	color: inherit;
	font-size: 0.7rem;
	margin-left: 0.25rem;
	opacity: 0.85;
}

.nirsha-consent-manage {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 99990;
	appearance: none;
	border: 1px solid rgb(184 137 59 / 42%);
	border-radius: 999px;
	background: rgb(43 25 19 / 95%);
	color: #FBF7EF;
	padding: 0.5rem 0.9rem;
	font: inherit;
	font-size: 0.74rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 8px 24px rgb(0 0 0 / 28%);
}

@media (max-width: 640px) {
	.nirsha-consent {
		padding: 0.5rem;
	}

	.nirsha-consent__panel {
		display: block;
		padding: 0.8rem 0.85rem;
		/* Keep the sheet from dominating small screens: never taller than ~70% of
		   the viewport, and scroll internally if the expanded choices grow it. */
		max-height: 70vh;
		overflow-y: auto;
	}

	.nirsha-consent__title {
		margin-bottom: 0.2rem;
	}

	.nirsha-consent__body {
		margin-bottom: 0.55rem;
	}

	.nirsha-consent__choices {
		grid-template-columns: 1fr 1fr;
		margin: 0.45rem 0;
	}

	.nirsha-consent__actions {
		justify-content: flex-start;
	}

	.nirsha-consent__btn {
		min-height: 2.75rem;
	}

	.nirsha-consent__link {
		margin-left: 0;
		width: 100%;
	}

	/* The consent sheet (z-index 100000) otherwise sits over the bottom-right
	   WhatsApp float. While the first-visit dialog is open, hide that float so it
	   cannot overlap the consent buttons; it returns the moment consent is set. */
	body:has( #nirsha-consent:not([hidden]) ) .nrs-wa-float {
		display: none;
	}
}
