/*
 * Wejha Store — the consent sheet and the QA badge (includes/measurement/class-page.php prints them only when a
 * measurement destination is configured). Theme tokens with fallbacks, logical properties only (RTL and LTR).
 * Accept and Reject are the same size and weight on purpose: neither answer is nudged.
 */
.wejha-consent {
	position: fixed;
	inset-block-end: 16px;
	inset-inline-start: 16px;
	z-index: 99990;
	box-sizing: border-box;
	inline-size: min( 400px, calc( 100vw - 32px ) );
	padding: 18px 18px 16px;
	border: 1px solid rgba( 5, 48, 90, 0.14 );
	border-radius: 14px;
	background: var( --wejha-cream, #fffdfc );
	box-shadow: 0 12px 32px rgba( 5, 48, 90, 0.12 );
	color: var( --wejha-navy, #05305a );
	font-family: var( --wejha-font, system-ui, sans-serif );
	font-size: 0.9375rem;
	line-height: 1.6;
}

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

.wejha-consent__head {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	justify-content: space-between;
	margin-block-end: 6px;
}

.wejha-consent__title {
	margin: 0;
	padding-block-start: 2px;
	color: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
}

/* Focused by script when the settings are reopened (not a control: no ring). */
.wejha-consent__title:focus {
	outline: none;
}

/* Close — only once a choice exists (the first-visit banner waits for one). 44px target, pulled into the corner. */
.wejha-consent__close {
	display: grid;
	flex: none;
	place-items: center;
	inline-size: 44px;
	block-size: 44px;
	margin-block-start: -12px;
	margin-inline-end: -12px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var( --wejha-navy, #05305a );
	cursor: pointer;
}

.wejha-consent__close:hover {
	background: rgba( 5, 48, 90, 0.08 );
}

.wejha-consent__text {
	margin: 0 0 14px;
	color: rgba( 5, 48, 90, 0.82 );
}

.wejha-consent__text a,
.wejha-consent__link {
	color: var( --wejha-navy, #05305a );
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wejha-consent__choices {
	display: grid;
	gap: 10px;
	margin-block-end: 14px;
}

.wejha-consent__choice {
	display: flex;
	gap: 10px;
	align-items: center;
	cursor: pointer;
}

.wejha-consent__choice input {
	inline-size: 18px;
	block-size: 18px;
	margin: 0;
	accent-color: var( --wejha-navy, #05305a );
}

/* Necessary: shown so the three categories read as one list; locked on. */
.wejha-consent__choice--locked {
	cursor: default;
}

.wejha-consent__always {
	margin-inline-start: auto;
	color: rgba( 5, 48, 90, 0.72 );
	font-size: 0.8125rem;
}

.wejha-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.wejha-consent__button {
	flex: 1 1 0;
	min-block-size: 44px;
	padding-inline: 16px;
	border: 1.5px solid var( --wejha-navy, #05305a );
	border-radius: 999px;
	background: transparent;
	color: var( --wejha-navy, #05305a );
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.wejha-consent__button[data-wejha-consent="save"] {
	flex-basis: 100%;
}

.wejha-consent__button:hover {
	background: var( --wejha-navy, #05305a );
	color: var( --wejha-cream, #fffdfc );
}

.wejha-consent__link {
	flex-basis: 100%;
	padding: 4px 0 0;
	border: 0;
	background: none;
	font: inherit;
	text-align: start;
	cursor: pointer;
}

/* Focus: a navy ring on the cream sheet (≈13:1; the site's teal ring is ≈2.8:1 here), offset so a cream gap separates it
   from a filled (hovered) button. */
.wejha-consent button:focus-visible,
.wejha-consent a:focus-visible,
.wejha-consent input:focus-visible {
	outline: 2px solid var( --wejha-navy, #05305a );
	outline-offset: 2px;
}

/* The Cookie settings control (a button: it opens the sheet, it goes nowhere), dressed as the text around it. */
.wejha-consent-open {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var( --theme-link-initial-color, var( --wejha-navy, #05305a ) );
	font: inherit;
	text-align: start;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	cursor: pointer;
}

/* …in the footer's Help column: exactly the footer links (theme footer.css .wejha-footer__list a). */
.ct-footer .wejha-footer__list .wejha-consent-open {
	display: inline-block;
	padding-block: 0.5em;
	color: rgba( 255, 255, 255, 0.8 );
	font-size: 0.9375rem;
	line-height: 1.7;
	text-decoration: none;
	transition: color 0.18s ease;
}

.ct-footer .wejha-footer__list .wejha-consent-open:hover,
.ct-footer .wejha-footer__list .wejha-consent-open:focus-visible {
	color: #fff;
	text-decoration: underline;
	text-decoration-color: var( --wejha-yellow, #fdb01a );
	text-decoration-thickness: 2px;
	text-underline-offset: 0.28em;
}

@media ( max-width: 600px ) {
	.wejha-consent {
		inset-block-end: 0;
		inset-inline-start: 0;
		inline-size: 100%;
		padding-block-end: calc( 16px + env( safe-area-inset-bottom, 0px ) );
		border-radius: 16px 16px 0 0;
		border-block-end: 0;
	}
}

.wejha-qa-badge {
	position: fixed;
	inset-block-end: 8px;
	inset-inline-end: 8px;
	z-index: 99989; /* under the consent sheet, clear of the header's icons */
	padding: 3px 8px;
	border-radius: 6px;
	background: var( --wejha-yellow, #fdb01a );
	color: var( --wejha-navy, #05305a );
	font: 600 12px/1.4 system-ui, sans-serif;
	pointer-events: none;
}

@media print {
	.wejha-consent,
	.wejha-qa-badge {
		display: none !important;
	}
}
