/**
 * A heuristic that applies CSS to tablet
 * viewports.
 *
 * Usage:
 * @include tablet-viewport() {
 *   :host {
 *     background-color: green;
 *   }
 * }
 */
/**
 * A heuristic that applies CSS to mobile
 * viewports (i.e. phones, not tablets).
 *
 * Usage:
 * @include mobile-viewport() {
 *   :host {
 *     background-color: blue;
 *   }
 * }
 */
/**
 * Convert a pixels given value into rem
 * 
 * @param pixels - Value in pixels to be converted (i.e. px)
 * @param context (optional) - Baseline value
 */
/**
 * Convert a font size to a dynamic font size.
 * Fonts that participate in Dynamic Type should use
 * dynamic font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param unit (optional) - The unit to convert to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a maximum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a minimum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * maximum and minimum font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * A heuristic that applies CSS to tablet
 * viewports.
 *
 * Usage:
 * @include tablet-viewport() {
 *   :host {
 *     background-color: green;
 *   }
 * }
 */
/**
 * A heuristic that applies CSS to mobile
 * viewports (i.e. phones, not tablets).
 *
 * Usage:
 * @include mobile-viewport() {
 *   :host {
 *     background-color: blue;
 *   }
 * }
 */
:host {
  /**
   * @prop --background: Background of the modal content
   *
   * @prop --border-color: Border color of the modal content
   * @prop --border-radius: Border radius of the modal content
   * @prop --border-width: Border width of the modal content
   * @prop --border-style: Border style of the modal content
   *
   * @prop --min-width: Minimum width of the modal
   * @prop --width: Width of the modal
   * @prop --max-width: Maximum width of the modal
   *
   * @prop --min-height: Minimum height of the modal
   * @prop --height: Height of the modal
   * @prop --max-height: Maximum height of the modal
   *
   * @prop --backdrop-opacity: Opacity of the backdrop
   */
  --width: 100%;
  --min-width: auto;
  --max-width: auto;
  --height: 100%;
  --min-height: auto;
  --max-height: auto;
  --overflow: hidden;
  --border-width: 0;
  --border-style: none;
  --border-color: transparent;
  --box-shadow: none;
  right: 0;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  position: absolute;
  align-items: center;
  justify-content: center;
  outline: none;
  contain: strict;
}

.modal-wrapper,
ion-backdrop {
  pointer-events: auto;
}

:host(.overlay-hidden) {
  display: none;
}

.modal-wrapper,
.modal-shadow {
  border-radius: var(--border-radius);
  width: var(--width);
  min-width: var(--min-width);
  max-width: var(--max-width);
  height: var(--height);
  min-height: var(--min-height);
  max-height: var(--max-height);
  border-width: var(--border-width);
  border-style: var(--border-style);
  border-color: var(--border-color);
  background: var(--background);
  box-shadow: var(--box-shadow);
  overflow: var(--overflow);
  z-index: 10;
}

.modal-shadow {
  position: absolute;
  background: transparent;
}

.modal-handle {
  -webkit-margin-start: auto;
  margin-inline-start: auto;
  -webkit-margin-end: auto;
  margin-inline-end: auto;
  position: absolute;
  /**
   * This allows the handle to appear
   * on top of user content in WebKit.
   */
  transform: translateZ(0);
  border: 0;
  cursor: pointer;
  z-index: 11;
}
.modal-handle::before {
  position: absolute;
  transform: translate(-50%, -50%);
  content: "";
}

:host(.modal-sheet) .modal-wrapper,
:host(.modal-sheet) .modal-shadow {
  position: absolute;
  bottom: 0;
}

:host(.modal-sheet.modal-no-expand-scroll) ion-footer {
  position: absolute;
  bottom: 0;
  width: var(--width);
}

:host {
  --background: var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff));
  --box-shadow: var(--token-elevation-3, 0px 2px 7px 0px rgba(0, 0, 0, 0.05), 0px 6px 32px 0px rgba(0, 0, 0, 0.16));
  --backdrop-opacity: 1;
  color: var(--token-text-default, var(--token-primitives-neutral-1200, #242424));
}

:host(.modal-round) {
  --border-radius: var(--token-border-radius-1000, var(--token-scale-1000, 40px));
}

:host(.modal-soft) {
  --border-radius: var(--token-border-radius-400, var(--token-scale-400, 16px));
}

:host(.modal-rectangular) {
  --border-radius: var(--token-border-radius-0, var(--token-scale-0, 0px));
}

:host(.select-modal.modal-default) {
  --max-height: 45%;
  --max-width: calc(100% - (var(--token-space-400, var(--token-scale-400, 16px)) * 2));
  --min-height: 340px;
}

.modal-handle {
  right: 0px;
  left: 0px;
  top: var(--token-space-300, var(--token-scale-300, 12px));
  border-radius: var(--token-border-radius-100, var(--token-scale-100, 4px));
  width: var(--token-scale-1100, 44px);
  height: var(--token-scale-100, 4px);
  background-color: var(--token-primitives-neutral-300, #e0e0e0);
}
.modal-handle::before {
  -webkit-padding-start: var(--token-space-100, var(--token-scale-100, 4px));
  padding-inline-start: var(--token-space-100, var(--token-scale-100, 4px));
  -webkit-padding-end: var(--token-space-100, var(--token-scale-100, 4px));
  padding-inline-end: var(--token-space-100, var(--token-scale-100, 4px));
  padding-top: var(--token-space-100, var(--token-scale-100, 4px));
  padding-bottom: var(--token-space-100, var(--token-scale-100, 4px));
}

:host(.modal-sheet) .modal-wrapper {
  border-start-start-radius: var(--border-radius);
  border-start-end-radius: var(--border-radius);
  border-end-end-radius: 0;
  border-end-start-radius: 0;
}

/**
 * Ensure that the sheet modal does not
 * completely cover the content.
 */
:host(.modal-sheet) {
  --height: calc(100% - (var(--ion-safe-area-top) + var(--token-scale-250, 10px)));
}