@font-face {
  font-family: checkin;
  src: url('./bmw/Regular.otf') format('opentype');
}
@font-face {
  font-family: checkin;
  font-weight: bold;
  src: url('./bmw/Regular.otf') format('opentype');
}
@font-face {
  font-family: checkinlight;
  font-weight: 300;
  src: url('./bmw/Light.otf') format('opentype');
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
  color: #fff;
  font-family: checkin, Arial, sans-serif;
}

.app {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #111;
}

.header {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  min-height: 56px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #111;
  border-bottom: 1px solid #2e2e2e;
}

.title {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 2;
}

/* Hamburger button: 3 lines smoothly transform into an X */
.menu-toggle {
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #fff;
  background: #1b1b1b;
  border: 1px solid #444;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease, border-color .2s ease;
}

.menu-toggle:hover,
.menu-toggle.is-open {
  background: #292929;
  border-color: #777;
}

.menu-toggle:focus-visible,
.menu-item:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.hamburger {
  position: relative;
  display: block;
  width: 21px;
  height: 18px;
}

.hamburger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
  transition: transform .28s ease, opacity .18s ease;
}

.hamburger span:nth-child(1) { top: 2px; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 16px; }

.menu-toggle.is-open .hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.is-open .hamburger span:nth-child(2) {
  transform: scaleX(0);
  opacity: 0;
}
.menu-toggle.is-open .hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Floating brochure list, opened beneath the header */
.brochure-menu {
  position: absolute;
  top: 100%;
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: min(65dvh, 460px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #393939;
  border-radius: 0 0 12px 12px;
  background: #191919;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.brochure-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-heading {
  padding: 6px 10px 10px;
  font-size: 11px;
  font-weight: bold;
  color: #a9a9a9;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.menu-list { display: grid; gap: 3px; }

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 6px;
  color: #e8e8e8;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: background .18s ease;
}

.menu-item:hover { background: #303030; }
.menu-item.active { background: #303030; color: #fff; font-weight: bold; }
.menu-item.active::after {
  content: '✓';
  flex: 0 0 auto;
  font-size: 17px;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s;
}
.menu-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.viewer {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: #222;
}

iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #1b1b1b;
  color: #fff;
  font-size: 14px;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}
.loading.hidden { display: none; }

@media (max-width: 600px) {
  .header { min-height: 54px; line-height: 2; }
  .title {
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;

    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brochure-menu { right: 0; width: 100%; border-left: 0; border-right: 0; border-radius: 0 0 10px 10px; }
}


@media (prefers-reduced-motion: reduce) {
  .menu-toggle, .hamburger span, .brochure-menu, .menu-backdrop, .menu-item {
    transition-duration: .01ms;
  }
}
