.wchn-notice {
	margin: 1em 0;
}

.wchn-notice button.wchn-open,
.wchn-dialog .wchn-dialog__link a.wchn-ext,
.wchn-dialog button.wchn-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	white-space: normal;
	text-align: center;
}

.wchn-icon {
	flex-shrink: 0;
}

.wchn-notice--cart .wchn-open.button,
.wchn-notice--checkout .wchn-open.button {
	width: 100%;
}

/* "Link" style: underlined text instead of theme buttons. */
.wchn-notice button.wchn-link {
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.wchn-dialog a.wchn-link {
	text-decoration: underline;
}

.wchn-notice button.wchn-link:hover,
.wchn-dialog a.wchn-link:hover {
	text-decoration-thickness: 2px;
}

html:has(.wchn-dialog[open]) {
	overflow: hidden;
}

.wchn-dialog {
	width: min(48rem, calc(100% - 2rem));
	max-height: calc(100% - 2rem);
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: #fff;
	color: #1e1e1e;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

/* The inner wrapper scrolls, so the close button stays visible. */
.wchn-dialog[open] {
	display: flex;
	flex-direction: column;
}

.wchn-dialog::backdrop {
	background: rgba(0, 0, 0, 0.6);
}

.wchn-dialog__inner {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 1rem 1.25rem;
}

.wchn-dialog__title {
	min-height: 44px;
	margin: 0;
	padding-right: 56px; /* Room for the close button. */
	font-size: 1.25rem;
	line-height: 1.3;
}

.wchn-dialog__title:focus {
	outline: none;
}

.wchn-dialog button.wchn-close {
	position: absolute;
	top: 1rem;
	right: 1.25rem;
	margin: 0;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.5em;
	font-size: 1.25rem;
	line-height: 1;
}

.wchn-dialog__link {
	margin: 1rem 0;
	text-align: center;
}

.wchn-dialog__image {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid #888;
}

.wchn-dialog :focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Fallback in case the theme does not define it. */
.wchn-dialog .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
