/**
 * Consent - layout only.
 *
 * Enough for the banner to be usable on a site whose theme knows nothing
 * about it: where it sits, what is hidden, how the modal is stacked. The
 * looks (colours, radii, typography) belong to the theme, which styles the
 * same px-consent-* classes with its own tokens - every rule here is a
 * single class, so overriding it needs no !important.
 *
 * The three buttons of the first layer deliberately share one appearance:
 * refusing must not look harder than accepting.
 *
 * @package PxShopCore
 */

.px-consent[hidden],
.px-consent-modal[hidden],
.px-consent-group__body[hidden],
.px-consent-service__detail[hidden] {
	display: none !important;
}

/* -------------------------------- Banner -------------------------------- */

.px-consent {
	position: fixed;
	z-index: 99999;
	right: 0;
	bottom: 0;
	left: 0;
	box-sizing: border-box;
	max-height: 80vh;
	overflow-y: auto;
	padding: 1rem;
	background: #fff;
	color: #111;
	box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.18);
}

.px-consent__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	max-width: 76rem;
	margin: 0 auto;
}

.px-consent__body {
	flex: 1 1 20rem;
}

.px-consent__title {
	margin: 0 0 0.25rem;
	font-size: 1.125rem;
	line-height: 1.3;
}

.px-consent__text {
	margin: 0;
	line-height: 1.5;
}

.px-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.px-consent__btn {
	flex: 1 1 auto;
	min-height: 2.75rem;
	padding: 0.625rem 1.25rem;
	border: 1px solid #111;
	background: #fff;
	color: #111;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
}

.px-consent__btn:hover {
	background: #f2f2f2;
}

.px-consent :focus-visible,
.px-consent-modal :focus-visible,
.px-consent-embed :focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* -------------------------------- Modal --------------------------------- */

.px-consent-open {
	overflow: hidden;
}

.px-consent-modal {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.px-consent-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.px-consent-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: 100%;
	max-width: 44rem;
	max-height: 90vh;
	background: #fff;
	color: #111;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.px-consent-modal__head,
.px-consent-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	padding: 1rem;
}

.px-consent-modal__head {
	justify-content: space-between;
	border-bottom: 1px solid #ddd;
}

.px-consent-modal__title {
	margin: 0;
	font-size: 1.125rem;
}

.px-consent-modal__close {
	min-width: 2.75rem;
	min-height: 2.75rem;
	border: 0;
	background: none;
	color: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.px-consent-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 1rem;
}

.px-consent-modal__actions {
	border-top: 1px solid #ddd;
}

.px-consent-modal__actions .px-consent__btn {
	flex: 1 1 12rem;
}

/* ------------------------------- Categories ------------------------------ */

.px-consent-group {
	border-top: 1px solid #ddd;
	padding: 0.75rem 0;
}

.px-consent-group__head,
.px-consent-service__head {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
}

.px-consent-group__toggle,
.px-consent-service__more {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: baseline;
	min-height: 2.75rem;
	padding: 0.25rem 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.px-consent-group__name {
	font-weight: 700;
}

.px-consent-group__count,
.px-consent-service__more {
	font-size: 0.875rem;
	text-decoration: underline;
}

.px-consent-group__body {
	padding: 0.5rem 0 0;
}

.px-consent-group__desc {
	margin: 0 0 0.75rem;
}

.px-consent-services {
	margin: 0;
	padding: 0;
	list-style: none;
}

.px-consent-service {
	border-top: 1px solid #eee;
	padding: 0.5rem 0;
}

.px-consent-service__detail {
	padding: 0 0 0.5rem;
	font-size: 0.9375rem;
}

.px-consent-service__provider {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 0.5rem;
}

/* The switch is a plain checkbox until the theme draws its own; the empty
   span is here so the theme has something to paint without touching markup. */
.px-consent-switch {
	display: inline-flex;
	gap: 0.5rem;
	align-items: center;
	cursor: pointer;
}

.px-consent-switch__ui {
	display: none;
}

.px-consent-switch__input {
	width: 1.25rem;
	height: 1.25rem;
	margin: 0;
	flex: 0 0 auto;
}

.px-consent-switch__state {
	font-size: 0.8125rem;
}

/* -------------------------------- Tables -------------------------------- */

.px-consent-cookies,
.px-cookie-policy__table {
	width: 100%;
	margin: 0.5rem 0;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.px-consent-cookies th,
.px-consent-cookies td,
.px-cookie-policy__table th,
.px-cookie-policy__table td {
	border: 1px solid #ddd;
	padding: 0.375rem 0.5rem;
	text-align: left;
	vertical-align: top;
}

/* -------------------------------- Embeds -------------------------------- */

.px-consent-embed {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 12rem;
	padding: 1.5rem;
	border: 1px dashed #999;
	text-align: center;
}

.px-consent-embed__inner {
	max-width: 32rem;
}

.px-consent-embed__title {
	margin: 0 0 0.5rem;
	font-weight: 700;
}

.px-consent-embed__actions {
	margin: 0.75rem 0 0.25rem;
}

.px-consent-embed__btn {
	min-height: 2.75rem;
	padding: 0.625rem 1.25rem;
	border: 1px solid currentColor;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.px-consent-embed__fallback {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
	margin: 0;
	font-size: 0.875rem;
}

.px-consent-embed__settings {
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.px-consent-embed-frame iframe {
	max-width: 100%;
}

/* ------------------------------- Utilities ------------------------------- */

.px-consent-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media print {

	.px-consent,
	.px-consent-modal {
		display: none !important;
	}
}
