/* =========================================================
   CyberSource BGFI — Photo-based mockups (premium hero/solutions)
   Charge APRÈS styles.css + responsive.css + solutions.css
   ========================================================= */

/* -------- Container des illustrations photo+overlay -------- */
.mockup-with-photo {
  position: relative;
  width: 100%;
  max-width: 580px;
}

/* -------- Photo frame avec aspect-ratio (anti layout shift) -------- */
.photo-frame {
  position: relative;
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: #e2eaf1;
  box-shadow:
    0 30px 60px -20px rgba(0, 53, 101, .35),
    0 18px 32px -16px rgba(0, 53, 101, .25);
}
.photo-frame picture { display: contents; }
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}

/* Subtle hover */
.photo-frame {
  transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s;
}
.product-block:hover .photo-frame,
.backoffice-grid-new:hover .photo-frame {
  transform: translateY(-4px);
  box-shadow:
    0 40px 80px -20px rgba(0, 53, 101, .45),
    0 22px 38px -18px rgba(0, 53, 101, .3);
}

/* Vignette douce pour faire ressortir les overlays */
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 33, 64, 0) 35%, rgba(0, 33, 64, .25) 100%);
  pointer-events: none;
  z-index: 1;
}

/* -------- Overlay card flottante (montant, formulaire, statut) -------- */
.overlay-card {
  position: absolute;
  z-index: 3;
  width: min(72%, 290px);
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 18px 40px -12px rgba(0, 30, 60, .35),
    0 8px 16px -8px rgba(0, 30, 60, .25);
  font-family: Inter, system-ui, sans-serif;
  animation: overlayPop .6s cubic-bezier(.2, .9, .25, 1.15) both;
}
.overlay-card--wide    { width: min(80%, 320px); }
.overlay-card--compact { width: min(60%, 240px); }

.overlay-bottom-left  { bottom: 18px; left: 18px; }
.overlay-bottom-right { bottom: 18px; right: 18px; }
.overlay-top-left     { top: 18px; left: 18px; }
.overlay-top-right    { top: 18px; right: 18px; }

@keyframes overlayPop {
  0%   { opacity: 0; transform: translateY(12px) scale(.96); }
  100% { opacity: 1; transform: none; }
}

.overlay-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 9px 14px;
  letter-spacing: .2px;
}
.overlay-card-head svg { flex-shrink: 0; }

.overlay-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.overlay-card-body small {
  color: #6A7D91;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.overlay-card-body code {
  font-family: ui-monospace, Menlo, monospace;
  color: #003565;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
}
.overlay-card-body strong {
  color: #003565;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.overlay-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.overlay-row > div small { display: block; }

.overlay-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: #31465F;
  padding: 4px 0;
  border-bottom: 1px solid #eef2f6;
}
.overlay-line:last-child { border-bottom: 0; }
.overlay-line b { color: #003565; font-weight: 700; }
.overlay-line.overlay-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1.5px solid #e2eaf1;
  border-bottom: 0;
  font-size: 11px;
  color: #6A7D91;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.overlay-line.overlay-total strong {
  font-size: 1.05rem;
  color: #003565;
}

.overlay-logos {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}
.overlay-logos .logo-pill {
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
}
.overlay-logos .logo-visa { background: #1A1F71; color: #F7B600; }
.overlay-logos .logo-gimac { background: white; color: #003565; border: 1px solid #dde7ef; }
.overlay-logos .logo-mc {
  display: inline-block;
  width: 22px;
  height: 14px;
  background:
    radial-gradient(circle at 30% 50%, #EB001B 0 6px, transparent 7px),
    radial-gradient(circle at 70% 50%, #F79E1B 0 6px, transparent 7px);
}

.overlay-btn {
  margin-top: 10px;
  width: 100%;
  background: linear-gradient(135deg, #003565, #0B477A);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .2px;
  box-shadow: 0 6px 14px -4px rgba(0, 53, 101, .4);
  transition: transform .15s, box-shadow .15s;
}
.overlay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -4px rgba(0, 53, 101, .5);
}

/* KPI grid for dashboard overlay */
.overlay-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.overlay-kpi-grid > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* NFC pulse ring */
.nfc-ring {
  margin: 10px auto 0;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2.5px dashed rgba(58, 162, 171, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: nfcPulse 2s ease-in-out infinite;
}
@keyframes nfcPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58, 162, 171, .35); }
  50%      { box-shadow: 0 0 0 14px rgba(58, 162, 171, 0); }
}

/* -------- Overlay badge (chip flottant : statut / live) -------- */
.overlay-badge {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  color: white;
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
  box-shadow:
    0 8px 22px -6px rgba(0, 30, 60, .35),
    0 4px 8px -4px rgba(0, 30, 60, .2);
  animation: overlayPop .8s cubic-bezier(.2, .9, .25, 1.15) .15s both;
}
.overlay-badge svg { flex-shrink: 0; }

/* -------- Responsive -------- */
@media (max-width: 1099px) {
  .overlay-card { width: min(72%, 270px); }
  .overlay-badge { font-size: 11px; padding: 7px 12px; }
}

@media (max-width: 880px) {
  .mockup-with-photo { max-width: 100%; margin: 0 auto; }
  .photo-frame { border-radius: 18px; }
  .overlay-card {
    width: min(70%, 260px);
    border-radius: 14px;
    bottom: 14px; left: 14px; right: auto; top: auto;
  }
  .overlay-bottom-right { right: 14px; left: auto; }
  .overlay-top-left     { top: 14px; left: 14px; bottom: auto; }
  .overlay-top-right    { top: 14px; right: 14px; bottom: auto; left: auto; }
  .overlay-card-head { font-size: 10px; padding: 8px 12px; }
  .overlay-card-body strong { font-size: 1.1rem; }
  .overlay-btn { font-size: 11px; padding: 8px 10px; }
  .overlay-badge { font-size: 10px; padding: 6px 11px; gap: 5px; }
}

@media (max-width: 620px) {
  .photo-frame { border-radius: 14px; }
  .overlay-card {
    width: min(78%, 230px);
    bottom: 10px; left: 10px;
  }
  .overlay-bottom-right { right: 10px; left: auto; }
  .overlay-top-left     { top: 10px; left: 10px; }
  .overlay-top-right    { top: 10px; right: 10px; left: auto; }
  .overlay-card-body strong { font-size: 1rem; }
  .overlay-card-body code { font-size: 11px; }
  .overlay-card-head { font-size: 9.5px; }
  .overlay-card-head svg { width: 12px; height: 12px; }
  .overlay-badge {
    font-size: 9.5px;
    padding: 5px 9px;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .overlay-row { gap: 8px; }
  .nfc-ring { width: 54px; height: 54px; }
  .nfc-ring svg { width: 28px; height: 28px; }
}

@media (max-width: 380px) {
  .overlay-card { width: 82%; }
}

/* -------- HERO HOME REDESIGN (photo-based) -------- */
.hero-photo-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin-left: auto;
}
.hero-photo-wrap .photo-frame { aspect-ratio: 5 / 4; border-radius: 24px; }
.hero-photo-wrap .overlay-card { animation-delay: .2s; }
.hero-photo-wrap .overlay-badge { animation-delay: .4s; }

@media (max-width: 880px) {
  .hero-photo-wrap { max-width: 100%; }
}

/* Override hero-visual : on cache l'ancien payment-lab si présent dans la page home */
body[data-page="home"] .hero-photo-wrap .payment-lab,
body[data-page="home"] .hero-photo-wrap .dashboard-window,
body[data-page="home"] .hero-photo-wrap .checkout-card,
body[data-page="home"] .hero-photo-wrap .phone-card {
  display: none !important;
}

/* -------- Trust strip avec petite illustration en bas de hero -------- */
.hero-clients {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.hero-clients-text {
  color: rgba(255, 255, 255, .65);
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.hero-clients-logos {
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: .85;
}
.hero-clients-logos span {
  color: white;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .6px;
}

/* -------- Section contact : photo de support -------- */
.contact-photo {
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 18px;
  aspect-ratio: 4 / 3;
}
.contact-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* -------- Performance: disable animations on reduced motion + low-end -------- */
@media (prefers-reduced-motion: reduce) {
  .photo-frame, .overlay-card, .overlay-badge, .nfc-ring, .mockup svg {
    animation: none !important;
    transition: none !important;
  }
}

/* -------- Fix overall : pas d'overflow horizontal nulle part -------- */
.products-section, .backoffice-section, .hero { max-width: 100vw; overflow: hidden; }
.product-block, .backoffice-grid-new { max-width: 100%; }
.mockup-with-photo, .photo-frame { max-width: 100%; }

/* Réduire animation float du SVG existant si présent */
.mockup-with-photo svg { animation: none !important; }
