/* ─── PWA Install Banner ───────────────────────────────────────── */
#pwa-install-banner,
#pwa-update-banner {
  position: fixed;
  bottom: -120px;
  left: 0; right: 0;
  z-index: 9990;
  padding: 10px 14px;
  background: #ffffff;
  box-shadow: 0 -4px 30px rgba(26,26,46,.18);
  border-top: 3px solid #e94560;
  transition: bottom .4s cubic-bezier(.4,0,.2,1);
}
#pwa-install-banner.visible,
#pwa-update-banner.visible  { bottom: 0; }

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 540px;
  margin: 0 auto;
}
.pwa-banner-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.pwa-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pwa-banner-text strong {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
}
.pwa-banner-text span {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-btn-install {
  flex-shrink: 0;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .2s;
  white-space: nowrap;
}
.pwa-btn-install:hover { background: #c73752; transform: translateY(-1px); }
.pwa-btn-install:active { transform: translateY(0); }

.pwa-btn-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  border-radius: 50%;
  transition: background .2s;
}
.pwa-btn-close:hover { background: #f3f4f6; color: #374151; }

/* ─── Online / Offline Bar ─────────────────────────────────────── */
#pwa-status-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  letter-spacing: .2px;
  animation: slideDown .3s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

.pwa-offline-bar {
  background: #1a1a2e;
  color: rgba(255,255,255,.85);
  border-bottom: 2px solid #e94560;
}
.pwa-online-bar {
  background: #16a34a;
  color: #fff;
}

/* ─── Push Notification Prompt ─────────────────────────────────── */
#pwa-push-prompt {
  position: fixed;
  inset: 0;
  z-index: 9995;
  display: flex;
  align-items: flex-end;
  background: rgba(26,26,46,.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s ease;
  padding: 16px;
}
#pwa-push-prompt.visible { opacity: 1; }

.push-prompt-card {
  background: #fff;
  border-radius: 20px 20px 16px 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transform: translateY(40px);
  transition: transform .35s cubic-bezier(.34,1.4,.64,1);
}
#pwa-push-prompt.visible .push-prompt-card { transform: translateY(0); }

.push-prompt-icon { font-size: 48px; margin-bottom: 12px; }
.push-prompt-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}
.push-prompt-card p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.55;
  margin-bottom: 20px;
}
.push-prompt-actions { display: flex; flex-direction: column; gap: 10px; }
.push-btn-allow {
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.push-btn-allow:hover { background: #c73752; }
.push-btn-deny {
  background: transparent;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all .2s;
}
.push-btn-deny:hover { border-color: #9ca3af; color: #374151; }

/* ─── Standalone Mode (installed app) ──────────────────────────── */
.pwa-standalone .site-header {
  /* Add safe area inset for notch devices */
  padding-top: env(safe-area-inset-top, 0);
  height: calc(60px + env(safe-area-inset-top, 0));
}
.pwa-standalone .category-bar {
  top: calc(60px + env(safe-area-inset-top, 0));
}
.pwa-standalone .filter-bar {
  top: calc(60px + env(safe-area-inset-top, 0) + 44px);
}
.pwa-standalone .card-counter {
  top: calc(60px + env(safe-area-inset-top, 0) + 92px);
}
.pwa-standalone .swipe-wrapper {
  top: calc(60px + env(safe-area-inset-top, 0) + 92px + 28px);
  /* account for home indicator on iPhones */
  bottom: env(safe-area-inset-bottom, 0);
}

/* ─── iOS Safari Install Hint (shown only on iOS non-standalone) ─ */
.ios-install-hint {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9991;
  background: #1a1a2e;
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 13px;
  text-align: center;
  max-width: 280px;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  line-height: 1.5;
  animation: pulse 2s infinite;
}
.ios-install-hint::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #1a1a2e;
  border-bottom: none;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 30px rgba(0,0,0,.4); }
  50%       { box-shadow: 0 8px 40px rgba(233,69,96,.5); }
}

/* Show on iOS Safari only */
.ios-safari .ios-install-hint { display: block; }
