/**
 * PWA Install - Estilos do botão, bottom sheet e banner
 * Tema claro consistente com o CADU (fundo #F7F8FA, primária #00AB4E)
 */

/* ===== Botão Instalar no Mobile Navbar ===== */
.pwa-install-mobile {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
}
.pwa-install-mobile:hover {
  background: var(--gray-light, #F7F8FA);
  color: var(--primary-color, #00AB4E);
}
.pwa-install-mobile.show {
  display: flex;
}

/* ===== Bottom Sheet (Mobile Install Prompt) ===== */
.pwa-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
}
.pwa-sheet.open {
  display: block;
}
.pwa-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pwa-sheet.open .pwa-sheet__backdrop {
  opacity: 1;
}
.pwa-sheet__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 12px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
  max-width: 100%;
}
.pwa-sheet.open .pwa-sheet__panel {
  transform: translateY(0);
}
.pwa-sheet__handle {
  width: 36px;
  height: 4px;
  background: #D1D5DB;
  border-radius: 2px;
  margin: 0 auto 16px;
}
.pwa-sheet__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.pwa-sheet__logo {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}
.pwa-sheet__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color, #333842);
  margin: 0 0 2px;
}
.pwa-sheet__subtitle {
  font-size: 13px;
  color: #888;
  margin: 0;
}
.pwa-sheet__benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pwa-sheet__benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-color, #333842);
  font-weight: 500;
}
.pwa-sheet__benefits li i {
  width: 20px;
  text-align: center;
  font-size: 14px;
}
.pwa-sheet__btn-install {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--primary-color, #00AB4E);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
  margin-bottom: 12px;
}
.pwa-sheet__btn-install:hover {
  background: var(--primary-dark, #008F41);
}
.pwa-sheet__btn-close {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: var(--gray-light, #F7F8FA);
  color: #888;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.pwa-sheet__btn-close:hover {
  background: var(--border-color, #E1E4EB);
  color: var(--text-color, #333842);
}

/* iOS Steps */
.pwa-sheet__ios-steps {
  margin-bottom: 16px;
}
.pwa-sheet__ios-label {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
}
.pwa-sheet__ios-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-color, #333842);
  padding: 10px 12px;
  background: var(--gray-light, #F7F8FA);
  border-radius: 10px;
  margin-bottom: 8px;
  font-weight: 500;
}
.pwa-sheet__ios-step strong {
  color: var(--primary-color, #00AB4E);
}
.pwa-sheet__ios-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color, #00AB4E);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== Banner iOS Non-Safari (Chrome/Firefox/etc no iOS) ===== */
.ios-safari-banner {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100001;
}
.ios-safari-banner.open {
  display: block;
}
.ios-safari-banner__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ios-safari-banner.open .ios-safari-banner__backdrop {
  opacity: 1;
}
.ios-safari-banner__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 10px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  max-width: 100%;
}
.ios-safari-banner.open .ios-safari-banner__panel {
  transform: translateY(0);
}
.ios-safari-banner__handle {
  width: 32px;
  height: 4px;
  background: #D1D5DB;
  border-radius: 2px;
  margin: 0 auto 12px;
}
.ios-safari-banner__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ios-safari-banner__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0A84FF, #007AFF);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.2);
}
.ios-safari-banner__icon i {
  font-size: 18px;
  color: #fff;
}
.ios-safari-banner__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-color, #333842);
  margin: 0 0 1px;
}
.ios-safari-banner__subtitle {
  font-size: 12px;
  color: #999;
  margin: 0;
  line-height: 1.3;
}
.ios-safari-banner__btn-share {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--primary-color, #00AB4E);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
  margin-bottom: 10px;
}
.ios-safari-banner__btn-share:active {
  background: var(--primary-dark, #008F41);
}
.ios-safari-banner__link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-light, #F7F8FA);
  border: 1px solid var(--border-color, #E1E4EB);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.ios-safari-banner__link-url {
  flex: 1;
  font-size: 12px;
  color: #888;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
}
.ios-safari-banner__btn-copy {
  flex-shrink: 0;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: var(--text-color, #333842);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
  white-space: nowrap;
}
.ios-safari-banner__btn-copy:active {
  background: #555;
}
.ios-safari-banner__btn-copy.copied {
  background: #10b981;
}
.ios-safari-banner__btn-close {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #aaa;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}
.ios-safari-banner__btn-close:active {
  color: var(--text-color, #333842);
}

/* Desktop: esconder banners mobile */
@media (min-width: 1024px) {
  .pwa-sheet {
    display: none !important;
  }
  .ios-safari-banner {
    display: none !important;
  }
}
