/* ProCarte PWA shell — safe areas, standalone tweaks */
:root {
  --pwa-theme: #3b82f6;
  --pwa-bg: #0f172a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html.pwa-standalone body {
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* Bandeau d'installation */
.pwa-install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 10050;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(59, 130, 246, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.pwa-install-banner.is-visible {
  display: flex;
}

.pwa-install-banner__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.pwa-install-banner__text {
  flex: 1;
  min-width: 0;
}

.pwa-install-banner__text strong {
  display: block;
  font-size: 0.95rem;
  color: #f8fafc;
}

.pwa-install-banner__text span {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

.pwa-install-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install-banner button {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.pwa-install-banner__install {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

.pwa-install-banner__dismiss {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.pwa-ios-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 10050;
  display: none;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.pwa-ios-hint.is-visible {
  display: block;
}

.pwa-ios-hint strong {
  color: #93c5fd;
}

.pwa-open-app-bar {
  position: fixed;
  top: calc(8px + var(--safe-top));
  left: 12px;
  right: 12px;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #e2e8f0;
  font-size: 0.88rem;
}

.pwa-open-app-bar.is-visible {
  display: flex;
}

.pwa-open-app-bar a {
  color: #93c5fd;
  font-weight: 700;
  text-decoration: none;
}

@media (min-width: 768px) {
  .pwa-install-banner {
    left: auto;
    right: 24px;
    bottom: 24px;
    max-width: 420px;
  }
}
