/* Auto Tire accessibility overlay - legacy 2all NG menu parity */

.at-a11y .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.at-a11y {
	/* Physical right edge - matches legacy 2all NG button; stays clear of RTL cookie CTA. */
	position: fixed;
	z-index: 2147483001;
	right: 0;
	left: auto;
	bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-family: Arial, Helvetica, sans-serif;
	pointer-events: none;
}

.at-a11y > * {
	pointer-events: auto;
}

.at-a11y__launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	min-height: 3.25rem;
	padding: 0.65rem 0.4rem 0.65rem 0.5rem;
	margin: 0;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-right: none;
	border-radius: 12px 0 0 12px;
	background: #1c1c1e;
	color: #e8e8e8;
	cursor: pointer;
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.45);
	transition: background 0.2s ease, padding 0.2s ease;
}

.at-a11y__launcher:hover,
.at-a11y__launcher:focus-visible {
	background: #2a2a2e;
	outline: 2px solid #1ebde3;
	outline-offset: 2px;
}

.at-a11y__launcher-icon {
	display: flex;
	line-height: 0;
}

.at-a11y__panel {
	position: relative;
	width: min(20rem, calc(100vw - 1.25rem));
	max-height: min(70vh, 32rem);
	overflow: auto;
	margin-bottom: 0.5rem;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-right: none;
	border-radius: 12px 0 0 12px;
	background: #1c1c1e;
	color: #e8e8e8;
	box-shadow: -8px 0 40px rgba(0, 0, 0, 0.65);
}

.at-a11y__header {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 1rem 0.875rem 0.875rem;
	background: #141416;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	position: sticky;
	top: 0;
	z-index: 1;
}

.at-a11y__header-icon {
	display: flex;
	color: #e8e8e8;
	line-height: 0;
}

.at-a11y__title {
	flex: 1;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.at-a11y__close {
	width: 2rem;
	height: 2rem;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #e8e8e8;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.55;
}

.at-a11y__close:hover,
.at-a11y__close:focus-visible {
	opacity: 1;
	background: rgba(255, 255, 255, 0.08);
	outline: none;
}

.at-a11y__body {
	padding: 0.75rem 0.875rem 1rem;
}

.at-a11y__section {
	margin-bottom: 0.875rem;
}

.at-a11y__section-label {
	margin-bottom: 0.5rem;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
}

.at-a11y__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

.at-a11y__tile,
.at-a11y__font-btn,
.at-a11y__reset {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-height: 4.25rem;
	padding: 0.55rem 0.4rem;
	margin: 0;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	background: #2a2a2e;
	color: #f2f2f2;
	font: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.at-a11y__tile:hover,
.at-a11y__font-btn:hover,
.at-a11y__tile:focus-visible,
.at-a11y__font-btn:focus-visible {
	background: #35353a;
	border-color: rgba(30, 189, 227, 0.55);
	outline: none;
}

.at-a11y__tile[aria-pressed="true"] {
	background: #0d3a4a;
	border-color: #1ebde3;
	box-shadow: inset 0 0 0 1px rgba(30, 189, 227, 0.35);
}

.at-a11y__tile-icon,
.at-a11y__font-icon {
	font-size: 1.15rem;
	line-height: 1;
}

.at-a11y__tile-label {
	display: block;
}

.at-a11y__font-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

.at-a11y__font-btn {
	flex-direction: row;
	min-height: 3rem;
	gap: 0.45rem;
}

.at-a11y__font-icon sup {
	font-size: 0.65em;
}

.at-a11y__footer {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 0.25rem;
	padding-top: 0.75rem;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.at-a11y__reset {
	min-height: 2.75rem;
	flex-direction: row;
	gap: 0.4rem;
	background: #3a3a40;
}

.at-a11y__declare {
	display: block;
	padding: 0.55rem;
	border-radius: 8px;
	color: #8fdff3 !important;
	font-size: 0.8125rem;
	font-weight: 700;
	text-align: center;
	text-decoration: underline !important;
}

.at-a11y__declare:hover,
.at-a11y__declare:focus-visible {
	color: #c6f2ff !important;
}

body.at-a11y--dark #at-a11y,
body.at-a11y--bright #at-a11y {
	background: transparent !important;
}

/* ===== Page effects (applied to body) ===== */

body.at-a11y--dark,
body.at-a11y--dark *:not(#at-a11y):not(#at-a11y *) {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #666 !important;
}

body.at-a11y--dark a:not(#at-a11y a) {
	outline: 1px dotted #fff !important;
}

body.at-a11y--bright,
body.at-a11y--bright *:not(#at-a11y):not(#at-a11y *) {
	background-color: #fff !important;
	color: #000 !important;
	border-color: #333 !important;
}

body.at-a11y--bright a:not(#at-a11y a) {
	outline: 1px dotted #000 !important;
}

/*
 * Grayscale must NOT be on body/html itself: CSS filter on an ancestor
 * creates a containing block and breaks position:fixed for #at-a11y
 * (panel appears to vanish / becomes unreachable).
 */
body.at-a11y--grayscale > *:not(#at-a11y) {
	filter: grayscale(100%);
}

body.at-a11y--underline a:not(#at-a11y a) {
	text-decoration: underline !important;
}

body.at-a11y--readable *:not(#at-a11y):not(#at-a11y *) {
	font-family: Arial, Helvetica, sans-serif !important;
}

body.at-a11y--keyboard :focus:not(#at-a11y):not(#at-a11y *) {
	background-color: #ff0 !important;
	box-shadow: 0 0 3px 7px #eae61a !important;
	color: #000 !important;
	outline: 2px solid #000 !important;
}

/* Font scale via CSS variable (set by JS) */
html.at-a11y-font {
	font-size: calc(100% * var(--at-a11y-font-scale, 1)) !important;
}

@media (max-width: 640px) {
	.at-a11y {
		bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
	}

	.at-a11y__panel {
		width: min(18.5rem, calc(100vw - 0.75rem));
		max-height: min(62vh, 28rem);
	}
}
