<script setup>

const props = defineProps({
  leftGrow: {
    type: Boolean,
    default: false
  },
  centerGrow: {
    type: Boolean,
    default: false
  },
  rightGrow: {
    type: Boolean,
    default: false
  },
  mobileCollapse: {
    type: Boolean,
    default: true
  }
});

</script>

<template>
  <div class="pankow-top-bar" :class="{ 'mobile-collapse': mobileCollapse }">
    <div class="pankow-top-bar-left" :class="{'pankow-top-bar-grow': leftGrow }">
      <slot name="left"/>
    </div>
    <div class="pankow-top-bar-center" :class="{'pankow-top-bar-grow': centerGrow }">
      <slot name="center"/>
    </div>
    <div class="pankow-top-bar-right" :class="{'pankow-top-bar-grow': rightGrow }">
      <slot name="right"/>
    </div>
  </div>
</template>

<style>

.pankow-top-bar {
  position: relative;
  z-index: 1;
  width: 100%;
  background-color: var(--pankow-color-background);
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
}

.pankow-top-bar-left {
  display: flex;
  margin: auto 0px;
  align-items: center;
}

.pankow-top-bar-center {
  display: flex;
  margin: auto 0px;
  align-items: center;
}

.pankow-top-bar-right {
  display: flex;
  margin: auto 0px;
  align-items: center;
}

.pankow-top-bar-grow {
  flex-grow: 1;
}

@media (max-width: 961px) {
  .pankow-top-bar.mobile-collapse {
    flex-direction: column;
  }

  .pankow-top-bar-left,
  .pankow-top-bar-center,
  .pankow-top-bar-right {
    justify-content: center;
  }

  .pankow-top-bar-center {
    margin-top: 6px;
    margin-bottom: 6px;
    justify-content: center;
  }
}

</style>