html.modal-open,
body.modal-open {
    overscroll-behavior: none;
    touch-action: none;
	position: fixed;
    width: 100%;
	overflow: hidden !important;
}

body.modal-open {
  padding-right: var(--scrollbar-width, 0px) !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.15s ease-out;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-navigation {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-left: calc(-1*(var(--modal-content-padding)));
  margin-right: calc(-1*(var(--modal-content-padding)));
  width: calc(100% + 2 * var(--modal-content-padding));

}

.start-modal-navigation {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  width: 100%;
  margin-left: var(--padding-lg);
  margin-right: calc(-1*(var(--padding-lg)));
}

.modal-close-nav-button,
.modal-back-nav-button {
  position: relative;
  background: none;
  border: none;
  outline: none;
  height: 3rem;
  width: 3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SVG icon color changes on hover using CSS masks */
.modal-back-nav-button img,
.modal-close-nav-button img {
  transition: background-color 0.2s ease;
  /* Hide the original SVG and use it as a mask */
  opacity: 0;
  position: absolute;
}

.modal-close-nav-button img {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.modal-back-nav-button img {
  height: var(--icon-size-md);
  width: var(--icon-size-md);
}

.modal-back-nav-button::after,
.modal-close-nav-button::after {
  content: '';
  position: absolute;
  background-color: var(--icon-default-grey);
  border: none;
  outline: none;
  transition: background-color 0.2s ease;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.modal-close-nav-button::after {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  mask-image: url('../../icons/cancel_icon.svg');
  -webkit-mask-image: url('../../icons/cancel_icon.svg');
}

.modal-back-nav-button::after {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
  mask-image: url('../../icons/chevron_back_icon.svg');
  -webkit-mask-image: url('../../icons/chevron_back_icon.svg');
}

.modal-back-nav-button:hover::after,
.modal-close-nav-button:hover::after {
  background-color: var(--icon-hover);
}

.modal-content .header {
  position: sticky;  
}

.modal-content .header-scroll {
  position: sticky;
  box-shadow: none;
}

.modal-content,
.modal-content-no-nav,
.modal-content-wrapper-scroll {
  background: var(--modal-background);
  border-radius: var(--border-radius-lg);
  max-width: 25rem;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  text-align: center;
  padding-left: var(--modal-content-padding);
  padding-right: var(--modal-content-padding);
  padding-bottom: var(--modal-content-padding);
}

.modal-content-no-nav {
  padding-top: var(--modal-content-padding);
}

.modal-content-wrapper,
.modal-content-wrapper-no-nav,
.modal-content-wrapper-scroll {
  display: flex;
  flex-direction: column;
  padding-left: var(--screen-padding);
  padding-right: var(--screen-padding);
  padding-bottom: var(--screen-padding);
  min-width: var(--screen-min-width);
}

.modal-content-wrapper-no-nav {
  padding-top: var(--screen-padding);
}

.modal-content-wrapper-scroll {
  padding-bottom: var(--space-7-5);
  overflow-y: hidden;
}

.modal-header {
	display: inline-flex;
	flex-direction: column;
	width: 100%;
	gap: var(--gap-lg);
	margin-bottom: var(--margin-xxxxl);
	background: var(--modal-background);
	
}

.modal-footer {
	display: inline-flex;
	flex-direction: column;
	width: 100%;
	min-width: var(--screen-min-width);
	gap: var(--gap-lg);
	padding: var(--screen-padding);
	position: sticky;
	bottom: 0;
	z-index: 10;
	margin-top: auto;
	background: var(--modal-background);
}

.modal-title,
.modal-title-centered {
	display: inline-flex;
	width: 100%;
	font-size: var(--font-size-heading-h2);
	color: var(--text-header-neutral);
}

.modal-subtitle {
	display: inline-flex;
	font-size: var(--font-size-heading-h3);
	color: var(--text-subtitle);
	text-align: start;
}

.modal-title-centered,
.modal-subtitle-centered {
	justify-content: center;
	text-align: center;
}

.modal-body {
	display: inline-flex;
	flex-direction: column;
	font-size: var(--font-size-body);
	color: var(--text-body-neutral);
	gap: var(--gap-xl);
	line-height: 1.6;
	margin-bottom: var(--margin-xxxxl);
}