/* Dar Al-Waqar PWA install prompt — non-invasive, RTL, theme-aware */
.waqar-pwa-layer,
.waqar-pwa-layer * {
  box-sizing: border-box;
}

.waqar-pwa-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  direction: rtl;
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  pointer-events: none;
}

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

.waqar-pwa-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.18);
  opacity: 0;
  transition: opacity .22s ease;
}

.waqar-pwa-card {
  width: min(100%, 440px);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  background: var(--surface, #ffffff);
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 24px 24px 20px 20px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 16px;
  transform: translateY(16px);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
  pointer-events: auto;
}

.waqar-pwa-layer.is-visible .waqar-pwa-backdrop {
  opacity: 1;
}

.waqar-pwa-layer.is-visible .waqar-pwa-card {
  transform: translateY(0);
  opacity: 1;
}

.waqar-pwa-icon {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  object-fit: cover;
  background: var(--surface-soft, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.waqar-pwa-content {
  min-width: 0;
}

.waqar-pwa-title {
  margin: 0 0 5px;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 900;
  color: var(--text, #0f172a);
}

.waqar-pwa-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text-muted, #64748b);
}

.waqar-pwa-ios-steps {
  margin: 8px 0 0;
  padding: 0 18px 0 0;
  color: var(--text-muted, #64748b);
  font-size: 12.5px;
  line-height: 1.9;
}

.waqar-pwa-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 2px;
}

.waqar-pwa-btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  min-height: 42px;
  padding: 10px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.waqar-pwa-btn:active {
  transform: translateY(1px);
}

.waqar-pwa-btn-primary {
  background: var(--primary, #0f4c3a);
  color: var(--primary-contrast, #ffffff);
  box-shadow: 0 12px 28px rgba(var(--primary-rgb, 15, 76, 58), .22);
}

.waqar-pwa-btn-secondary {
  background: var(--surface-soft, #f1f5f9);
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #e2e8f0);
}

.waqar-pwa-close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-soft, #f1f5f9);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

@media (min-width: 768px) {
  .waqar-pwa-layer {
    align-items: center;
    padding: 24px;
  }

  .waqar-pwa-card {
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .waqar-pwa-backdrop,
  .waqar-pwa-card,
  .waqar-pwa-btn {
    transition: none;
  }
}

html[data-theme="dark"] .waqar-pwa-backdrop,
html.dark .waqar-pwa-backdrop {
  background: rgba(2, 6, 23, 0.46);
}

/* Required update prompt */
.waqar-pwa-update-layer {
  z-index: 2147483600;
}

.waqar-pwa-update-card {
  border-color: rgba(var(--primary-rgb, 15, 76, 58), .28);
}

.waqar-pwa-update-card .waqar-pwa-title {
  color: var(--primary, #0f4c3a);
}

.waqar-pwa-version {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-soft, #f1f5f9);
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border, #e2e8f0);
  font-size: 10px;
  font-weight: 800;
}

.waqar-pwa-btn:disabled {
  opacity: .72;
  cursor: wait;
  transform: none;
}
