@keyframes modal-fade-in {
	0% {
		opacity: 0;
	}

	100% {
		opacity: 1;
	}
}

@keyframes modal-fade-out {
	0% {
		opacity: 1;
	}

	100% {
		opacity: 0;
	}
}

@keyframes modal-pop {
	0% {
		transform: translateY(100%);
	}

	100% {
		transform: translateY(0);
	}
}

@keyframes modal-popout {
	0% {
		transform: translateY(0);
	}

	100% {
		transform: translateY(100%);
	}
}

@keyframes modal-full-slide-in {
	0% {
		transform: translateX(100%);
	}

	100% {
		transform: translateX(0);
	}
}

@keyframes modal-full-slide-out {
	0% {
		transform: translateX(0);
	}

	100% {
		transform: translateX(100%);
	}
}

.modal {
	top: unset;
	bottom: -10em;
	left: 0;
	right: 0;
	width: 100%;
	--animation-delay: 0.5s;
	--border-radius: 24px;
	border-top-left-radius: var(--border-radius);
	border-top-right-radius: var(--border-radius);
	border: none;
	box-shadow: none;
	background-color: var(--color-white);
	margin: 0;
	max-width: 100%;
	padding: 0;
	overflow: hidden;
	padding-bottom: 10em;
}


.modal[open] {
	opacity: 1;
	animation: modal-pop var(--animation-delay) forwards;
}

.modal[closing] {
	animation: modal-popout var(--animation-delay) forwards;
}

.modal::backdrop {
	background-color: rgba(0 0 0 / 0.5);
	animation: modal-fade-in var(--animation-delay) forwards;
}

.modal[closing]::backdrop {
	animation: modal-fade-out var(--animation-delay) forwards;
}

.modal__content {
	padding: 24px;
	min-height: 25vh;
	display: grid;
	grid-template-rows: auto 1fr auto;
	max-height: 80vh;
	gap: 16px;
}

.modal__content>* {
	padding: 0 1rem;
}

.modal__content__header {
	display: flex;
	justify-content: space-between;
}

.modal__content__header__title {
	font-weight: 700;
	font-size: 1.1rem;
	padding-right: 20px;
}


.modal__content__header__close {
	position: relative;
	cursor: pointer;
}

.modal__content__header__close-button {
	position: absolute;
	width: 24px;
	height: 24px;
	transform: translate(-16px, -4px);
}

.modal__content__header__close-button:before,
.modal__content__header__close-button:after {
	--close-color: #333;
	position: absolute;
	left: 11px;
	content: ' ';
	height: 24px;
	width: 2px;
	background-color: var(--close-color);
}

.modal__content__header__close-button:before {
	transform: rotate(45deg);
}

.modal__content__body {
	overflow-x: hidden;
	overflow-y: auto;
	flex-grow: 1;
	.modal__content__body__title {
		margin: 0;
	}
}

.modal__content__header__close-button:after {
	transform: rotate(-45deg);
}

.modal__content__footer {
	display: flex;
	justify-content: space-around;
	gap: 4px;
}

.modal-full {
	--padding-lr: 20px;
	transform: none;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	max-height: none;
	max-width: none;
	--border-radius: 0;
	padding: 0;
	height: var(--modal-height, 100vh);
	overflow: auto;
}

.modal-full .modal__content__body {
	overflow: auto;
}

.modal-full .modal__content {
	padding: 0;
	max-height: none;
	overflow: auto;
}

.modal-full .modal__content__header {
	position: relative;
	padding: 0;
	flex-direction: column;
	gap: 24px;
}

.modal-full .modal__content__header__video {
	width: 100%;
	mask: url("../../images/components/mask/charity-image-mask-ZbMguW-.svg") no-repeat;
	mask-size: auto 100%;
	mask-position: center;
	mask-repeat: no-repeat;
	aspect-ratio: 6/4;
}

.modal-full .modal__content__header__title {
	padding: 0 var(--padding-lr);
	font-family: var(--display-xxs-ff);
	font-weight: var(--display-xxs-fw);
	line-height: var(--display-xxs-lh);
	text-rendering: var(--display-xxs-tr);
	letter-spacing: var(--display-xxs-ls);
	font-size: var(--display-xxs-fs);
	text-transform: uppercase;
}

.modal-full .modal__content__header__close {
	position: fixed;
	top: 12px;
	right: 12px;

	mask: url("../../images/components/button/brush-button-bg-33YqsP-.svg");
	mask-size: auto 100%;
	mask-position: center;
	mask-repeat: no-repeat;
	background-color: var(--color-eggshell);
	height: 40px;
	width: 40px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.modal-full .modal__content__header__close-button {
	--close-color: var(--color-white);
	transform: none;
}

.modal-full[open] {
	animation: modal-fade-in var(--animation-delay) forwards;
}

.modal-full[closing] {
	animation: modal-fade-out var(--animation-delay) forwards;
}

.modal-error .modal__content__body {
	position: relative;
	background: var(--color-eggshell);
	border-radius: 16px;
	padding: 24px 16px;
	display: grid;
	grid-template: 'icon text';
	gap: 0 16px;
	color: var(--color-carbon);
}


.modal-error .modal__content__body>*:first-child {
	grid-area: icon;
	font-family: auto;
	font-size: 24px;
	line-height: 32px;
	text-transform: uppercase;
}

.modal-error .modal__content__body>*:last-child {
	grid-area: text;
	font-family: var(--body-regular-m-ff);
	font-weight: var(--body-regular-m-fw);
	line-height: var(--body-regular-m-lh);
	text-rendering: var(--body-regular-m-tr);
	letter-spacing: var(--body-regular-m-ls);
	font-size: var(--body-regular-m-fs);
}

@media screen and (min-width: 720px) {
	.modal {
		border-radius: var(--border-radius);
		width: 400px;
		margin: 0 auto;
		top: 40vh;
		position: fixed;
		transform: translateY(-50%);
		bottom: unset;
		padding-bottom: unset;
		overflow: scroll;

		&:not(.modal-full) {
			.modal__content__header {
				padding-left: 0;
			}

			.modal__content__footer>*:first-child:last-child {
				justify-content: center;
			}

			.modal__content__footer:only-child {
				justify-content: center;
			}

			.modal__content__body,
			.modal__content__footer {
				padding-left: 0;
				padding-right: 0;
			}
		}
	}

	.modal[open] {
		opacity: 1;
		animation: modal-fade-in var(--animation-delay) forwards;
	}

	.modal[closing] {
		animation: modal-fade-out var(--animation-delay) forwards;
	}

	.modal__content {
		max-height: 60vh;
		min-height: unset;
		padding: 24px;
	}

	.modal__content__header__title {
		font-weight: 700;
		font-size: 1.2rem;
	}

	.modal-full {
		top: 0;
		right: 0;
		transform: none;
		margin-left: auto;
		margin-right: 0;
		height: 100vh;
		width: 40vw;
	}

	.modal-full[open] {
		opacity: 1;
		animation: modal-full-slide-in var(--animation-delay) forwards;
	}

	.modal-full[closing] {
		animation: modal-full-slide-out var(--animation-delay) forwards;
	}

	.modal__content__header {
		padding-bottom: 0;
	}
}
