/*******************************
 * Buttons
 ******************************/
/*
 * Applies the complete set of button styles with all desired style variations.
 * This mixin is normally applied to form buttons or links with
 * the desired button classes eg. .button.style-xxx.
 */
/*
 * Contains styles that all of the buttons have in common.
 * Some button styles might opt out or override some of these styles.
 * One benefit of this approach is that all of the buttons will be consistently
 * configurable with the CSS variables defined below.
 */
/*******************************
 * Button Styles
 *
 * Styles should define the way the buttons look. Depending on the project,
 * you may need to optimize each style based on the section / element that
 * a button is used in. For that purpose you can use the predefined CSS
 * variables to easily overwrite the desired colors based on your need.
 ******************************/
/*******************************
 * Inputs
 ******************************/
.popup-wrap {
  --transparent-actions-offset: 0.5rem;
  --popup-sides-offset: /* grow(16, 32, $to: md) */ clamp(1rem, 0.4102564103rem + 2.5641025641vw, 2rem);
  --popup-top-additional-offset: 0px;
  --popup-padding-x: /* grow(15, 152) */ clamp(0.9375rem, -2.1157945736rem + 13.2751937984vw, 9.5rem);
  --popup-padding-y: /* grow(15, 128) */ clamp(0.9375rem, -1.5809108527rem + 10.9496124031vw, 8rem);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--overlay-color);
  backdrop-filter: blur(var(--overlay-blur, 0px));
  /*
   * Prevent styles being overwritten e.g. wehen placing a popup inside a grid.
   * The popup should always overlay whole screen.
   */
  width: var(--100vw) !important;
  max-width: var(--100vw) !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
}
.popup-wrap.transparent {
  --popup-top-additional-offset: 3rem;
}

.popup-window {
  --close-button-base-color: var(--white);
  background-color: var(--white);
  box-shadow: 0 1rem 1.5rem rgba(0, 0, 0, 0.29);
  width: var(--popup-width, auto);
  max-width: var(--popup-max-width, 800px);
  max-height: calc(100vh - 2 * var(--popup-sides-offset) - var(--popup-top-additional-offset));
  margin: calc(var(--popup-sides-offset) + var(--popup-top-additional-offset)) var(--popup-sides-offset);
  display: flex;
  flex-flow: column;
  justify-content: stretch;
  border-radius: var(--rounded);
}
.popup-window:is(.popup-wrap.transparent *) {
  flex-flow: row;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  box-shadow: none;
  max-width: none;
  width: 100%;
  height: 100%;
}
.popup-window .popup-title {
  margin: 0 0 2rem;
}
@media (width < 768px /* sm */) {
  .popup-window .popup-title {
    font-size: /* grow(24, 32) */ clamp(1.5rem, 1.3217054264rem + 0.7751937984vw, 2rem);
    font-weight: 700;
    line-height: 1.35;
    line-height: 1;
    margin-bottom: 1.5rem;
  }
}
.popup-window .popup-content {
  overflow: auto;
  flex-grow: 1;
  padding: var(--popup-padding-y) var(--popup-padding-x);
  overscroll-behavior: contain;
}
.popup-window .popup-content:is(.popup-wrap.transparent *) {
  position: relative;
  padding: 0;
  overflow: initial;
  max-height: calc(100vh - 2 * var(--popup-sides-offset) - var(--popup-top-additional-offset) - var(--transparent-actions-offset));
}
.popup-window .transparent-header {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  color: var(--white);
}
.popup-window .close-button {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  font: inherit;
  line-height: 1;
  letter-spacing: inherit;
  word-spacing: inherit;
  white-space: nowrap;
  background: none;
  color: inherit;
  text-align: left;
  --button-background: var(--primary-color);
  --button-color: var(--primary-contrast, var(--text-color-inverted));
  --button-border-color: var(--button-background);
  --button-hover-background: var(--primary-color-darker);
  --button-hover-color: var(--button-color);
  --button-hover-border-color: var(--button-hover-background);
  --button-active-background: var(--primary-color-darker-2);
  --button-active-color: var(--button-color);
  --button-active-border-color: var(--button-active-background);
}
@container style(--theme: dark) {
  .popup-window .close-button {
    --button-background: var(--white);
    --button-color: var(--primary-color);
    --button-hover-background: var(--primary-100);
    --button-active-background: var(--primary-200);
    --button-active-color: var(--primary-800);
  }
}
.popup-window .close-button {
  ---background: var(--button-background);
  ---color: var(--button-color);
  ---border-color: var(--button-border-color);
  border: 1px solid var(---border-color);
  background-color: var(---background);
  color: var(---color);
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9375rem;
  line-height: 1.333;
  letter-spacing: -0.005em;
  border-radius: var(--rounded);
  transition: background-color 150ms, border-color 150ms, color 150ms;
}
.popup-window .close-button:focus:not(:focus-visible) {
  outline: none;
}
.popup-window .close-button:focus-visible {
  outline: 2px solid var(--focus-color, var(--primary-color));
  outline-offset: var(--focus-offset, 3px);
}
@media (hover: hover) and (pointer: fine) {
  .popup-window .close-button:where(:not(:disabled):not(.disabled):not([aria-disabled=true]):not(.inert):not([inert]):not(.inert *):not([inert] *)):hover {
    ---background: var(--button-hover-background);
    ---color: var(--button-hover-color);
    ---border-color: var(--button-hover-border-color);
  }
}
.popup-window .close-button:where(:not(:disabled):not(.disabled):not([aria-disabled=true]):not(.inert):not([inert]):not(.inert *):not([inert] *)):active {
  ---background: var(--button-active-background);
  ---color: var(--button-active-color);
  ---border-color: var(--button-active-border-color);
}
.popup-window .close-button:where(:disabled, .disabled, [aria-disabled=true], .inert, [inert], .inert *, [inert] *) {
  pointer-events: none;
  cursor: default;
  opacity: 0.5;
}
.popup-window .close-button {
  --button-background: transparent;
  --button-color: var(--primary-color);
  --button-border-color: var(--border-color);
  --button-hover-background: transparent;
  --button-hover-color: var(--primary-color-darker);
  --button-hover-border-color: color-mix(in srgb, var(--black), transparent 80%);
  --button-active-background: var(--primary-50);
  --button-active-color: var(--primary-color-dark);
  --button-active-border-color: color-mix(in srgb, var(--primary-950), transparent 80%);
}
@container style(--theme: dark) {
  .popup-window .close-button {
    --button-color: var(--primary-50);
    --button-border-color: color-mix(in srgb, var(--white), transparent 85%);
    --button-hover-color: var(--primary-100);
    --button-hover-border-color: color-mix(in srgb, var(--white), transparent 60%);
    --button-active-background: color-mix(in srgb, var(--white), transparent 90%);
    --button-active-color: var(--white);
    --button-active-border-color: transparent;
  }
}
.popup-window .close-button {
  padding: 1rem 1.5rem;
  line-height: 1.25;
  border: 1px solid var(---border-color);
}
.popup-window .close-button:where(:disabled, .disabled, [aria-disabled=true], .inert, [inert], .inert *, [inert] *) {
  pointer-events: none;
  opacity: 0.5;
}
.popup-window .close-button {
  padding: 1rem;
  border-radius: 100vmax;
  width: 0.75rem;
  height: 0.75rem;
  box-sizing: content-box;
  justify-content: center;
  --button-background: var(--white);
}
.popup-window .close-button :is(svg, img) {
  width: auto;
  height: 1rem;
}
.popup-window .close-button:is(.floating-close-button *) {
  margin-left: auto;
  position: absolute;
  right: /* grow(-12, -16, $to: md) */ clamp(-1rem, -0.6025641026rem + -0.641025641vw, -0.75rem);
  top: /* grow(-12, -16, $to: md) */ clamp(-1rem, -0.6025641026rem + -0.641025641vw, -0.75rem);
}
@media (width >= 992px /* md */) {
  .popup-window .close-button:is(.floating-close-button *) {
    right: /* grow(16, 28) */ clamp(1rem, 0.7325581395rem + 1.1627906977vw, 1.75rem);
    top: /* grow(16, 28) */ clamp(1rem, 0.7325581395rem + 1.1627906977vw, 1.75rem);
  }
}
.popup-window .close-button:is(.transparent-header *) {
  align-self: center;
  text-shadow: 0 0.05em 0.125em rgba(0, 0, 0, 0.2);
}

.popup-window {
  position: relative;
  max-height: calc(100vh - 2 * var(--popup-sides-offset));
}
