/* "Get the app" strip and sheet. See appPromo.js. */

/* A floating pill at the bottom, not a bar across the top: the top of this
   site is its header — search, title and menu — and a first version sat right
   on top of all three. It steps aside for anything the visitor opens. */
.app-strip {
  position: fixed;
  left: 12px;
  right: 12px;
  /* Clear of the map attribution line along the bottom edge. */
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 2px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  font-family: -apple-system, BlinkMacSystemFont, 'Poppins', sans-serif;
  color: #111827;
}
body:has(#sticky-bottom-card.active) .app-strip,
body:has(#fullscreen-detail.active) .app-strip,
body:has(.welcome-modal) .app-strip,
body:has(.modal) .app-strip {
  display: none;
}
.app-strip-close {
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #6b7280;
  min-width: 44px;
  min-height: 44px;
}
.app-strip-text { flex: 1; min-width: 0; }
.app-strip-title { font-weight: 600; font-size: 15px; }
.app-strip-sub { font-size: 12px; color: #4b5563; text-wrap: balance; }
.app-strip-open {
  background: #087a8a;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 999px;
  text-decoration: none;
}
@media (max-width: 359px) {
  .app-strip-sub { display: none; }
}

.app-store-link {
  display: block;
  margin: 12px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #087a8a;
  text-decoration: none;
}

.app-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.app-sheet-backdrop.visible { opacity: 1; }

.app-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9600;
  /* dvh, not vh: Safari's toolbars are counted, so the buttons stay on screen. */
  max-height: 86dvh;
  overflow-y: auto;
  padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
  background: #fff;
  color: #111827;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
  font-family: -apple-system, BlinkMacSystemFont, 'Poppins', sans-serif;
  transform: translateY(105%);
  transition: transform 0.3s ease;
}
.app-sheet.visible { transform: translateY(0); }
.app-sheet-title { margin: 0 0 14px; font-size: 20px; font-weight: 700; }
.app-sheet-perks { list-style: none; margin: 0 0 18px; padding: 0; }
.app-sheet-perk { padding: 9px 0; border-top: 1px solid #e5e7eb; }
.app-sheet-perk:first-child { border-top: 0; }
.perk-title { font-weight: 600; font-size: 15px; }
.perk-desc { font-size: 13px; color: #4b5563; margin-top: 2px; }
.app-sheet-get {
  display: block;
  text-align: center;
  background: #087a8a;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  padding: 14px;
  border-radius: 14px;
  text-decoration: none;
}
.app-sheet-later {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 0;
  background: none;
  font-size: 16px;
  color: #4b5563;
}

/* Short screens. These MUST stay below the rules they override: placed above,
   they lose to the base rules and never apply — on an iPhone SE that cut off
   "Get the App" and pushed "Not now" below the fold (the same bug shipped on
   sunsetscore.com). check_app_promo.js fails the build if they move. */
@media (max-height: 700px) {
  .app-sheet { padding-top: 16px; }
  .app-sheet-title { font-size: 18px; margin-bottom: 8px; }
  .app-sheet-perk { padding: 6px 0; }
  .app-sheet-perks { margin-bottom: 12px; }
  .app-sheet-get { padding: 12px; }
  .app-sheet-later { padding: 9px; }
}
@media (max-height: 580px) {
  .app-sheet .perk-desc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app-sheet, .app-sheet-backdrop { transition: none; }
}
