$arrow-size: rem(14px);
$visible-portion-of-arrow: rem(5px);
$content-max-height: rem(295px);
$content-max-width: rem(400px);

.p_qb {
  max-width: calc(100vw - #{2 * spacing()});
  margin: $visible-portion-of-arrow spacing(tight) spacing();
  opacity: 1;
  box-shadow: shadow(deep);
  border-radius: border-radius();
  will-change: opacity, left, top;
  transition: opacity duration() easing(in);
}

.p_vs {
  margin: 0;
  margin-top: $visible-portion-of-arrow;

  .p_fu {
    max-width: none;
  }
}

.p_cl:not(.p_us),
.p_us {
  opacity: 0;
}

.p_cl {
  .p_fu {
    display: block;
  }
}

.p_us {
  transition-timing-function: easing(out);
}

.p_i3 {
  margin: spacing() spacing() $visible-portion-of-arrow;

  &.p_vs {
    margin: 0 0 $visible-portion-of-arrow;
  }

  .p_yc {
    top: inherit;
    bottom: 0;
    border-top-left-radius: 0;
    border-bottom-right-radius: border-radius();
  }
}

.p_mf {
  position: relative;
  overflow: hidden;
  background-color: color('white');
  border-radius: border-radius(large);

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid transparent;
    border-radius: border-radius(large);
  }
}

.p_fu {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: border-radius(large);
  max-width: $content-max-width;
  max-height: $content-max-height;

  &:focus {
    outline: none;
  }
}

.p_qd {
  max-height: none;
}

.p_yc {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  height: $arrow-size;
  width: $arrow-size;
  background: color('white');
  border-top-left-radius: border-radius();
  box-shadow: shadow(deep);
}

.p_d0 {
  flex: 1 1 0%;
  max-width: 100%;

  + .p_d0 {
    border-top: border();
  }
}

.p_nf {
  overflow: visible;
  flex: 0 0 auto;
}

.p_bh {
  padding: spacing();

  + .p_bh {
    border-top: border();
  }
}

.p_y9 {
  @include visually-hidden;
}
