@use '../../_global/styles/mixins' as *;
@use '../../_global/styles/vars' as *;

.global-message {
  position: sticky;
  display: flex;
  align-items: flex-end;
  top: var(--header-height);
  background-color: var(--color-background);
  box-shadow: 0 -1px 0 0 var(--color-background);
  font-size: var(--font-size-small);
  z-index: 99;
  transition: top 0.25s $easeOutQuad, max-height 0.4s $easeOutQuad;
  max-height: 0;
  overflow: hidden;
  margin-bottom: 10px;
  margin-top: 0;

  @media(max-width: 767px) {
    --font-size-small: 14px;

    &.light .close {
      //background-color: rgba(var(--swatches-primary-500-rgb), 0.1);
    }
  }

  &.bold {
    background-color: var(--color-button-primary-background);
    box-shadow: 0 -1px 0 0 var(--color-button-primary-background);
    color: var(--color-button-primary-text);
    a {
      color: var(--color-button-primary-text);
      &:hover {
        color: var(--color-decoration);
      }
    }
  }

  &.alarming {
    background-color: var(--feedback-error);
    box-shadow: 0 -1px 0 0 var(--feedback-error);
    color: var(--swatches-neutrals-white);
    a {
      color: var(--swatches-neutrals-white);
      &:hover {
        color: var(--swatches-neutrals-white);
      }
    }
  }

  &.open {
    max-height: none;
  }

  .inner {
    position: relative;
    display: flex;
    flex: 1 1 100%;
    align-items: center;
    min-height: 50px;
    padding: 0 40px;

    @media (max-width: 767px) {
      padding: 0 0 0 12px;
    }

    &::before {
      font-family: 'Icons', sans-serif;
      font-size: var(--icon-size);
      line-height: 1;
      margin-right: 0.3em;
      align-self: flex-start;
      margin-top: 10px;
    }
  }

  p, div {
    margin: 13px 20px 13px 0;
    line-height: 1.3;

    @media(max-width: 767px) {
      margin-right: 12px;
    }
  }

  .close {
    position: relative;
    display: block;
    width: var(--icon-size);
    border: 0;
    padding: 0;
    background-color: transparent;
    margin: 0 -0.2em 0 auto;
    font-family: 'Icons', sans-serif;
    font-size: var(--icon-size);
    line-height: 1;
    color: inherit;
    cursor: pointer;

    &::before {
      @include icon-schliessen;
    }

    @media(max-width: 767px) {
      min-width: calc(var(--icon-size) * 1.8);
      align-items: center;
      justify-content: center;
      margin-right: 0;
      background-color: rgba(#fff, 0.1);
      align-self: stretch;
    }
  }
}

.header-scrolled .global-message {
  @media(min-width: 1200px) {
    --header-height: 100px;
  }
}
