/* Campus Guide · UPP — © 2026 imsale91-cmyk. Todos los derechos reservados.
   Uso, copia o redistribución sin autorización prohibidos. Ver LICENSE. */
/* ==========================================================================
   LAYOUT
   Estructura de la app: header, main, páginas y navegación inferior.
   ========================================================================== */

/* ─── APP SHELL ─── */
#app { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }

/* ─── HEADER ─── */
.app-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--upp-white);
  border-bottom: 1px solid var(--upp-gray-border);
  height: var(--header-h);
  padding: 0 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  box-shadow: 0 1px 8px rgba(92,45,145,0.07);
}
.header-brand {
  display: flex; align-items: center; gap: 0.6rem; min-width: 0; flex: 1;
}
.header-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.hdr-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--upp-gray-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--upp-gray-dark); transition: background 0.15s, color 0.15s;
}
.hdr-btn:hover { background: var(--upp-purple-pale); color: var(--upp-purple); }
.hdr-btn svg { width: 18px; height: 18px; stroke-width: 2; }

/* ─── MAIN ─── */
main { flex: 1; position: relative; }
.page {
  display: none; padding: 1.25rem 1rem;
  min-height: calc(100dvh - var(--header-h) - var(--nav-h));
  animation: fadeIn 0.22s var(--ease-out);
}
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

#page-map { padding: 0; display: none; flex-direction: column; width: 100%; max-width: none; margin: 0; overflow: hidden; }
#page-map.active { display: flex; height: calc(100dvh - var(--header-h) - var(--nav-h)); min-height: 0; }

/* ─── BOTTOM NAV ─── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-nav);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  background: var(--upp-white);
  border-top: 1px solid var(--upp-gray-border);
  display: flex; align-items: stretch;
  box-shadow: 0 -4px 18px rgba(92,45,145,0.09);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 0.4rem 0.2rem;
  color: var(--upp-gray-mid); position: relative;
  transition: color 0.18s; min-width: 0;
}
.nav-item::after {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%); width: 0; height: 2.5px;
  background: var(--upp-purple); border-radius: 0 0 4px 4px;
  transition: width 0.25s var(--ease-spring);
}
.nav-item.active { color: var(--upp-purple); }
.nav-item.active::after { width: 28px; }
.nav-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  transition: transform 0.25s var(--ease-spring);
}
.nav-item.active .nav-icon { transform: scale(1.12) translateY(-1px); }
.nav-icon svg { width: 100%; height: 100%; stroke-width: 1.8; }
.nav-label {
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ─── SECTION TITLES ─── */
.sec-head { margin-bottom: 1rem; }
.sec-head h2 { color: var(--upp-oxford); }
.sec-head p { margin-top: 0.2rem; font-size: 0.8rem; }

/* ─── RESPONSIVE ─── */
@media (min-width: 480px) {
  .app-header { padding: 0 1.5rem; }
  .page { padding: 1.5rem 1.25rem; }
}
@media (min-width: 768px) {
  .page { padding: 2rem 2.5rem; max-width: 960px; margin: 0 auto; width: 100%; }
  .bottom-nav {
    width: min(540px, calc(100% - 2rem));
    max-width: 540px; left: 50%; right: auto;
    transform: translateX(-50%);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-left: 1px solid var(--upp-gray-border);
    border-right: 1px solid var(--upp-gray-border);
  }
  .app-header { padding: 0 2rem; }
}
@media (min-width: 1024px) {
  :root { --header-h: 62px; }
}
