<script setup lang="ts">
import AppHeader from "../AppHeader.vue";
import BottomNav from "../BottomNav.vue";
import { useAuthStore } from "@/stores/auth";

const authStore = useAuthStore();
</script>

<template>
  <div class="main-layout">
    <AppHeader />
    <main class="main-content" :class="{ 'has-bottom-nav': authStore.isPassenger }">
      <slot />
    </main>
    <BottomNav v-if="authStore.isPassenger" />
  </div>
</template>

<style scoped>
.main-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-primary);
}

.main-content {
  flex: 1;
  width: 100%;
  background: transparent;
  display: flex;
  flex-direction: column;
  /* El padding-top ya no es necesario porque el header es sticky */
}

.has-bottom-nav {
  padding-bottom: 70px;
}

@media (min-width: 900px) {
  .has-bottom-nav {
    padding-bottom: 0;
  }
}
</style>
