/* Ohio Exclusive PWA chrome. Hidden in the regular browser; shown only when installed. */

#oe-pwa-tabbar,
#oe-pwa-sheet,
#oe-pwa-install {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

#oe-pwa-tabbar *,
#oe-pwa-sheet *,
#oe-pwa-install * {
  box-sizing: border-box;
}

#oe-pwa-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483000;
  height: var(--oe-tabbar-height, 83px);
  padding: 6px 4px 0;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
  background: rgba(20, 20, 22, 0.94);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  border-top: 0.5px solid rgba(255, 255, 255, 0.1);
  align-items: flex-start;
  justify-content: space-around;
}

#oe-pwa-tabbar .oe-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #c7c7cc;
  background: none;
  border: 0;
  padding: 4px 0 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  font: inherit;
}

#oe-pwa-tabbar .oe-tab svg {
  width: 24px;
  height: 24px;
  display: block;
}

#oe-pwa-tabbar .oe-tab span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.1px;
  line-height: 1.15;
}

#oe-pwa-tabbar .oe-tab.oe-active {
  color: #c4121a;
}

#oe-pwa-tabbar .oe-home-pill {
  position: absolute;
  left: 50%;
  bottom: max(calc(env(safe-area-inset-bottom, 0px) / 3), 6px);
  transform: translateX(-50%);
  width: 128px;
  height: 5px;
  border-radius: 3px;
  background: #fff;
  pointer-events: none;
}

/* Installed / standalone only. Also honors a ?standalone=1 test hook via the html class. */
@media (display-mode: standalone), (display-mode: fullscreen) {
  #oe-pwa-tabbar {
    display: flex;
  }

  html.oe-pwa-standalone,
  html.oe-pwa-standalone body {
    background-color: #f3f1ec;
  }

  html.oe-pwa-standalone body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: var(--oe-tabbar-height, 83px);
  }
}

html.oe-pwa-standalone #oe-pwa-tabbar,
html.oe-pwa-standalone-test #oe-pwa-tabbar {
  display: flex;
}

html.oe-pwa-standalone-test,
html.oe-pwa-standalone-test body {
  background-color: #f3f1ec;
}

html.oe-pwa-standalone-test body {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: var(--oe-tabbar-height, 83px);
}

html.oe-pwa-standalone,
html.oe-pwa-standalone-test {
  --oe-tabbar-height: calc(52px + max(env(safe-area-inset-bottom, 0px), 22px));
}

/* Shop / book chooser sheet */
#oe-pwa-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483001;
}

#oe-pwa-sheet.oe-open {
  display: block;
}

#oe-pwa-sheet .oe-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

#oe-pwa-sheet .oe-sheet-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--oe-tabbar-height, 83px) + 8px);
  background: #1c1c1e;
  color: #f3f1ec;
  border-radius: 16px;
  padding: 8px 8px 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

#oe-pwa-sheet .oe-sheet-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a1a1a6;
  padding: 10px 12px 8px;
}

#oe-pwa-sheet a {
  display: block;
  color: #f3f1ec;
  text-decoration: none;
  padding: 14px 12px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 600;
}

#oe-pwa-sheet a:hover,
#oe-pwa-sheet a:focus {
  background: rgba(255, 255, 255, 0.08);
}

#oe-pwa-sheet a + a {
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 10px 10px;
}

/* Subtle install / add-to-home-screen tip. Browser only, never in standalone. */
#oe-pwa-install {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2147482990;
  background: #1c1c1e;
  color: #f3f1ec;
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  align-items: center;
  gap: 12px;
}

#oe-pwa-install.oe-show {
  display: flex;
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  #oe-pwa-install {
    display: none !important;
  }
}

html.oe-pwa-standalone #oe-pwa-install,
html.oe-pwa-standalone-test #oe-pwa-install {
  display: none !important;
}

#oe-pwa-install img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  flex-shrink: 0;
}

#oe-pwa-install .oe-install-copy {
  flex: 1;
  min-width: 0;
}

#oe-pwa-install .oe-install-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

#oe-pwa-install .oe-install-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #c7c7cc;
}

#oe-pwa-install .oe-install-btn {
  flex-shrink: 0;
  background: #c4121a;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#oe-pwa-install .oe-install-x {
  flex-shrink: 0;
  background: none;
  border: 0;
  color: #8e8e93;
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}
