/* ═══════════════════════════════════════════════════════════
   BizContact – PWA Install Popup & Action Sheet
   Designed for Mobile & Responsive Experience
   ═══════════════════════════════════════════════════════════ */

.pwa-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 78, 59, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pwa-popup-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.pwa-popup {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 99999;
  background: #FFFFFF;
  border: 1px solid #D1FAE5;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(6, 78, 59, 0.18), 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  pointer-events: none;
}

/* If app has bottom nav, lift popup above it */
body.has-bottom-nav .pwa-popup {
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

.pwa-popup.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.pwa-popup[hidden] {
  display: none !important;
}

.pwa-popup__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  position: relative;
}

.pwa-popup__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
  flex-shrink: 0;
  object-fit: cover;
  background: #0D9488;
}

.pwa-popup__header-content {
  flex: 1;
  min-width: 0;
}

.pwa-popup__title {
  font-size: 15px;
  font-weight: 700;
  color: #064E3B;
  margin: 0 0 2px 0;
  line-height: 1.3;
}

.pwa-popup__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #0D9488;
  background: #ECFDF5;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid #A7F3D0;
}

.pwa-popup__close-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.pwa-popup__close-btn:hover,
.pwa-popup__close-btn:active {
  background: #F3F4F6;
  color: #374151;
}

.pwa-popup__body {
  font-size: 13px;
  color: #4B5563;
  line-height: 1.45;
  margin-bottom: 14px;
}

/* iOS Instruction Steps */
.pwa-popup__steps {
  background: #F0FDF9;
  border: 1px solid #CCFBF1;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pwa-popup__step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #0F766E;
  font-weight: 500;
}

.pwa-popup__step-num {
  width: 20px;
  height: 20px;
  background: #0D9488;
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-popup__step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  padding: 2px 4px;
  background: #FFFFFF;
  border-radius: 4px;
  border: 1px solid #99F6E4;
  margin: 0 2px;
  color: #0D9488;
}

.pwa-popup__step-icon svg {
  width: 14px;
  height: 14px;
}

.pwa-popup__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-btn {
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.pwa-btn:active {
  transform: scale(0.97);
}

.pwa-btn--primary {
  background: linear-gradient(135deg, #0D9488, #059669);
  color: #FFFFFF;
  flex: 1;
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.28);
}

.pwa-btn--primary:hover {
  background: linear-gradient(135deg, #0F766E, #047857);
}

.pwa-btn--ghost {
  background: #F3F4F6;
  color: #4B5563;
  padding: 10px 14px;
}

.pwa-btn--ghost:hover {
  background: #E5E7EB;
  color: #1F2937;
}

@media (min-width: 768px) {
  /* On tablets / desktops if manually triggered */
  .pwa-popup {
    left: auto;
    right: 24px;
    width: 380px;
    bottom: 24px;
  }
}
