/* Modal de instalación PWA Mba'appo: diseño aislado y responsive. */
[data-pwa-install][hidden],
.mbaappo-pwa-hidden,
html.mbaappo-is-installed [data-pwa-install] {
  display: none !important;
}

@media (display-mode: standalone) {
  [data-pwa-install] { display: none !important; }
}

.mbaappo-pwa-nav-button {
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}

.mbaappo-pwa-pro-button { white-space: nowrap; }
.mbaappo-pwa-modal[hidden] { display: none !important; }

.mbaappo-pwa-modal,
.mbaappo-pwa-modal * {
  box-sizing: border-box;
}

.mbaappo-pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.mbaappo-pwa-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 23, 45, .72);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.mbaappo-pwa-dialog {
  position: relative;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #d8eaf5;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(5, 38, 75, .34);
  color: #08254a;
}

.mbaappo-pwa-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 42px;
  gap: 14px;
  align-items: center;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #eaf2f7;
  background: rgba(255,255,255,.97);
}

.mbaappo-pwa-brandmark {
  position: relative;
  isolation: isolate;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, #087faf, #16a9d8);
  color: #fff;
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(5, 86, 135, .14);
}

.mbaappo-pwa-brandmark::after {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 1;
  background: url('/icons/pwa-dialog-icon.png?v=20260721d') center / contain no-repeat;
}

.mbaappo-pwa-dialog-heading {
  min-width: 0;
}

.mbaappo-pwa-dialog-head h2 {
  margin: 0;
  max-width: 100%;
  color: #08254a;
  font-size: clamp(19px, 4.7vw, 24px);
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: -.02em;
  overflow-wrap: break-word;
}

.mbaappo-pwa-dialog-head p {
  margin: 5px 0 0;
  color: #61788f;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.mbaappo-pwa-close {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #d8e8f3;
  border-radius: 13px;
  background: #fff;
  color: #173a5d;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.mbaappo-pwa-close:active { transform: scale(.97); }

.mbaappo-pwa-content {
  padding: 19px 22px 22px;
}

.mbaappo-pwa-detected {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid #cfe7f7;
  border-radius: 16px;
  background: linear-gradient(135deg, #f4fbff, #edf8fd);
}

.mbaappo-pwa-detected > div { min-width: 0; }

.mbaappo-pwa-detected-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #087faf, #16a9d8);
  font-weight: 900;
}

.mbaappo-pwa-detected small {
  display: block;
  margin: 0;
  color: #6f8498;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.mbaappo-pwa-detected strong {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 3px 0 0 !important;
  color: #0b355b;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.mbaappo-pwa-intro {
  margin: 17px 2px 6px;
  color: #415e77;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.mbaappo-pwa-steps {
  display: grid;
  gap: 11px;
  margin: 14px 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: pwa-step;
}

.mbaappo-pwa-steps li {
  counter-increment: pwa-step;
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) !important;
  gap: 12px;
  align-items: start;
  width: 100% !important;
  min-width: 0;
  margin: 0 !important;
  padding: 13px 14px !important;
  border: 1px solid #dcecf7;
  border-radius: 15px;
  background: #f8fcff;
  color: #294b68;
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
  white-space: normal !important;
}

.mbaappo-pwa-steps li::before {
  content: counter(pwa-step);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 11px;
  background: #e4f5fd;
  color: #087faf;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.mbaappo-pwa-step-text {
  display: block !important;
  min-width: 0;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 4px 0 2px !important;
  color: inherit;
  font: inherit;
  line-height: inherit;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.mbaappo-pwa-step-text strong {
  display: inline !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #173d61;
  font: inherit;
  font-weight: 850;
  line-height: inherit;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.mbaappo-pwa-note {
  margin: 10px 0 0;
  padding: 11px 13px;
  border: 1px solid #f4dfad;
  border-radius: 13px;
  background: #fff8e8;
  color: #795c1c;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: break-word;
}

.mbaappo-pwa-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 17px;
}

.mbaappo-pwa-primary,
.mbaappo-pwa-secondary {
  min-height: 48px;
  width: 100%;
  margin: 0;
  padding: 13px 16px;
  border-radius: 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  cursor: pointer;
}

.mbaappo-pwa-primary {
  border: 0;
  background: linear-gradient(135deg, #064f86, #16a9d8);
  color: #fff;
}

.mbaappo-pwa-secondary {
  border: 1px solid #cfe2ef;
  background: #fff;
  color: #0a5e91;
}

.mbaappo-pwa-toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 2147483001;
  max-width: min(430px, calc(100vw - 28px));
  padding: 12px 16px;
  border-radius: 14px;
  background: #082f57;
  color: #fff;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .24);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  font-weight: 700;
  text-align: center;
}

.mbaappo-pwa-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 991.98px) {
  .mbaappo-pwa-pro-button { width: 100%; margin: .35rem 0; }
}

@media (max-width: 560px) {
  .mbaappo-pwa-modal { padding: 8px; }

  .mbaappo-pwa-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .mbaappo-pwa-dialog-head {
    grid-template-columns: 48px minmax(0, 1fr) 40px;
    gap: 10px;
    padding: 15px 14px 13px;
  }

  .mbaappo-pwa-brandmark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 23px;
  }

  .mbaappo-pwa-dialog-head h2 { font-size: 19px; }
  .mbaappo-pwa-dialog-head p { font-size: 12px; }

  .mbaappo-pwa-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 25px;
  }

  .mbaappo-pwa-content { padding: 15px 14px 17px; }
  .mbaappo-pwa-intro { font-size: 14px; }

  .mbaappo-pwa-steps li {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 10px;
    padding: 11px 12px !important;
    font-size: 14px;
  }

  .mbaappo-pwa-steps li::before {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 14px;
  }

  .mbaappo-pwa-step-text { padding-top: 3px !important; }
  .mbaappo-pwa-actions { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  .mbaappo-pwa-dialog-head {
    grid-template-columns: 42px minmax(0, 1fr) 38px;
    gap: 8px;
    padding-inline: 11px;
  }

  .mbaappo-pwa-brandmark { width: 42px; height: 42px; }
  .mbaappo-pwa-dialog-head h2 { font-size: 17px; }
  .mbaappo-pwa-dialog-head p { font-size: 11px; }
  .mbaappo-pwa-content { padding-inline: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .mbaappo-pwa-toast { transition: none; }
}
