/**
 * ArgenTous — PWA Banner & Modal (08-pwa-banner.css)
 *
 * Components:
 *  .Agtcla-pwa-banner     — fixed install banner (bottom of screen)
 *  .Agtcla-pwa-modal      — instruction modal overlay
 *  .Agtcla-pwa-modal__box — the modal card
 *
 * Mobile-first; desktop overrides via min-width breakpoints.
 * Respects prefers-reduced-motion.
 *
 * @package ArgenTous
 * @version 4.0.0
 */

/* ── Install Banner ─────────────────────────────────────────────────────── */

.Agtcla-pwa-banner {
  /* Fixed at the bottom of the viewport, centered horizontally */
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  /* Layout */
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;

  /* Appearance */
  background: #ffffff;
  border-radius: 14px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, .18),
    0 2px 8px  rgba(0, 0, 0, .10);
  padding: 12px 16px;

  /* Sizing */
  max-width: calc(100vw - 32px);
  white-space: nowrap;

  /* Animation — slides up from 20px below */
  animation: pwa-banner-in 360ms cubic-bezier(.25, .46, .45, .94) both;
}

@keyframes pwa-banner-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.Agtcla-pwa-banner__icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}

.Agtcla-pwa-banner__text {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.Agtcla-pwa-banner__btn {
  flex-shrink: 0;
  background: #4F46E5;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, transform 100ms ease;
  white-space: nowrap;
}

.Agtcla-pwa-banner__btn:hover  { background: #4338CA; }
.Agtcla-pwa-banner__btn:active { transform: scale(.97); }

.Agtcla-pwa-banner__dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 140ms ease, background 140ms ease;
}

.Agtcla-pwa-banner__dismiss:hover {
  color: #374151;
  background: #F3F4F6;
}

/* Desktop: slightly larger banner */
@media (min-width: 640px) {
  .Agtcla-pwa-banner {
    max-width: 420px;
    padding: 14px 20px;
  }
  .Agtcla-pwa-banner__text { font-size: 15px; }
  .Agtcla-pwa-banner__btn  { padding: 9px 20px; font-size: 14px; }
}

/* ── PWA Install Modal ──────────────────────────────────────────────────── */

.Agtcla-pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;   /* Slide up from bottom on mobile */
  justify-content: center;
}

.Agtcla-pwa-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  cursor: pointer;
}

.Agtcla-pwa-modal__box {
  position: relative;
  background: #ffffff;
  border-radius: 20px 20px 0 0;  /* Rounded top only on mobile (sheet style) */
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0px); /* iOS safe area */

  /* Slide-up animation */
  animation: pwa-modal-slide-up 320ms cubic-bezier(.25, .46, .45, .94) both;
}

@keyframes pwa-modal-slide-up {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}

.Agtcla-pwa-modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #F3F4F6;
}

.Agtcla-pwa-modal__header img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.Agtcla-pwa-modal__title {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.Agtcla-pwa-modal__close {
  background: #F3F4F6;
  border: none;
  color: #6B7280;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 140ms ease, color 140ms ease;
}
.Agtcla-pwa-modal__close:hover { background: #E5E7EB; color: #111827; }

.Agtcla-pwa-modal__body {
  padding: 20px;
}

/* Instruction steps list */
.Agtcla-pwa-modal__steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.Agtcla-pwa-modal__step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  counter-increment: step-counter;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: #374151;
  line-height: 1.5;
}

.Agtcla-pwa-modal__step::before {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  background: #4F46E5;
  color: #ffffff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.Agtcla-pwa-modal__steps { counter-reset: step-counter; }

.Agtcla-pwa-modal__step strong { color: #111827; }

.Agtcla-pwa-modal__footer {
  padding: 0 20px 20px;
}

.Agtcla-pwa-modal__note {
  margin: 0;
  font-size: 12px;
  color: #9CA3AF;
  text-align: center;
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Desktop: centered modal instead of bottom sheet */
@media (min-width: 640px) {
  .Agtcla-pwa-modal {
    align-items: center;
  }
  .Agtcla-pwa-modal__box {
    border-radius: 16px;
    max-height: 80vh;
  }
  @keyframes pwa-modal-slide-up {
    from { opacity: 0; transform: scale(.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .Agtcla-pwa-banner,
  .Agtcla-pwa-modal__box {
    animation: none;
  }
}
