/* Badges App Store / Google Play —
   Mobile : liens directs.
   Desktop : clic sur l’icône → modale QR. */

.mobile-app-badges {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mobile-app-store {
  display: block;
}

.mobile-app-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mobile-app-badge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 127px;
  width: 127px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  line-height: 0;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out, ease), opacity 0.2s ease;
}

.mobile-app-badge-link:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.mobile-app-badge-link:focus-visible {
  outline: 2px solid var(--accent, #61b1bc);
  outline-offset: 3px;
}

.mobile-app-badge-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.mobile-app-badge-link--android img {
  transform: scale(1.23);
  transform-origin: center center;
}

.mobile-app-badges-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2, rgba(244, 247, 250, 0.72));
}

.mobile-app-badges-hint--desktop {
  display: none;
}

@keyframes mobile-app-hint-pulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.015);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .mobile-app-badges-hint--desktop {
    color: var(--text, #f4f7fa);
    animation: mobile-app-hint-pulse 2.4s ease-in-out infinite;
    transform-origin: left center;
  }
}

.mobile-app-badges-hint--mobile {
  display: block;
}

.mobile-app-badge-qr-trigger {
  display: none;
}

.mobile-app-qr-popover {
  width: min(320px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid rgba(97, 177, 188, 0.42);
  border-radius: var(--r-md, 16px);
  background:
    linear-gradient(145deg, rgba(97, 177, 188, 0.12), transparent 55%),
    #07182b;
  color: var(--text, #f4f7fa);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
  text-align: center;
}

.mobile-app-qr-popover::backdrop {
  background: rgba(3, 15, 30, 0.66);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.mobile-app-qr {
  display: block;
  width: min(232px, 100%);
  height: auto;
  margin: 8px auto 16px;
  border-radius: 10px;
  background: #fff;
}

.mobile-app-qr-popover p {
  margin: 0 0 12px;
  color: var(--text-2, rgba(244, 247, 250, 0.78));
  font-size: 14px;
  line-height: 1.5;
}

.mobile-app-qr-popover > a {
  color: var(--accent-soft, #9ad4dc);
  font-size: 14px;
  font-weight: 600;
}

.mobile-app-qr-close {
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.mobile-app-qr-close:hover,
.mobile-app-qr-close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-app-badges--featured {
  margin-block: 0 clamp(16px, 4vw, 24px);
  padding: 14px 16px;
  border: 1px solid var(--hairline, rgba(255, 255, 255, 0.08));
  border-radius: var(--r-md, 16px);
  background:
    linear-gradient(135deg, rgba(97, 177, 188, 0.08), transparent 55%),
    rgba(4, 23, 48, 0.55);
}

.mobile-app-badges--inline {
  margin-top: 16px;
}

.mobile-app-badges--drawer {
  width: 100%;
  margin-bottom: 14px;
}

.mobile-app-badges--drawer .mobile-app-badges-row {
  justify-content: center;
}

.mobile-app-badges--footer {
  margin-top: 20px;
}

.mobile-app-badges--footer .mobile-app-badges-row {
  justify-content: flex-start;
}

@media (min-width: 720px) {
  .mobile-app-badges-hint--desktop {
    display: block;
  }

  .mobile-app-badges-hint--mobile,
  .mobile-app-badge-direct {
    display: none;
  }

  .mobile-app-badge-qr-trigger {
    display: inline-flex;
  }
}

@media (max-width: 719px) {
  /* Configurateur mobile : bandeau fixe avec liens directs au-dessus de l’iframe. */
  .page-configurator .mobile-app-badges--featured {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(4, 23, 48, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .page-configurator .mobile-app-badges--featured .mobile-app-badges-row {
    justify-content: center;
  }

  .page-configurator .cfg-page-stage {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}
