/**
 * Liberium CMS - Styles du composant d'invitation à l'installation PWA
 */

.cms-pwa-prompt {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  z-index: 9998;
  animation: cmsPwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Décalage automatique au-dessus du lecteur Web Radio flottant si présent */
body.has-radio-bar .cms-pwa-prompt {
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

.cms-pwa-card {
  position: relative;
  background: #18181b;
  color: #f4f4f5;
  border: 1px solid #27272a;
  border-radius: 16px;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  padding: 16px;
  box-sizing: border-box;
}

.cms-pwa-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.cms-pwa-close:hover,
.cms-pwa-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  outline: none;
}

.cms-pwa-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 24px;
}

.cms-pwa-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #27272a;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cms-pwa-info {
  flex: 1;
  min-width: 0;
}

.cms-pwa-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fafafa;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cms-pwa-desc {
  margin: 3px 0 0 0;
  font-size: 12px;
  color: #a1a1aa;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cms-pwa-actions {
  margin-top: 14px;
}

.cms-pwa-btn-install {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.cms-pwa-btn-install:hover,
.cms-pwa-btn-install:focus-visible {
  background: #1d4ed8;
  outline: none;
}

.cms-pwa-btn-install:active {
  transform: scale(0.98);
}

.cms-pwa-btn-icon {
  font-size: 16px;
  line-height: 1;
}

.cms-pwa-ios-instructions {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(39, 39, 42, 0.6);
  border: 1px dashed #3f3f46;
  border-radius: 10px;
  font-size: 12px;
  color: #d4d4d8;
  line-height: 1.4;
}

.cms-pwa-ios-step {
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cms-pwa-ios-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: #3f3f46;
  color: #ffffff;
  font-weight: bold;
}

.cms-pwa-ios-strong {
  color: #60a5fa;
  font-weight: 600;
}

@keyframes cmsPwaSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (min-width: 768px) {
  /* Sur écran de bureau / large, le bandeau reste discret en bas à droite */
  .cms-pwa-prompt {
    left: auto;
    right: 20px;
    transform: none;
    width: 380px;
  }

  @keyframes cmsPwaSlideUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
