/* ═══════════════════════════════════════════════════════════════
   Yape & Plin – Styles v1.3.0
   Modales son hijos directos del <body> — sin stacking-context roto.
   ═══════════════════════════════════════════════════════════════ */

/* ── Botones flotantes ───────────────────────────────────────── */
.ypb-wrap.ypb-floating {
  position: fixed !important;
  z-index: 99990 !important;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none; /* sólo los hijos capturan clicks */
}
.ypb-wrap.ypb-floating > * { pointer-events: auto; }

.ypb-wrap.ypb-floating.ypb-pos-bottom-right  { bottom:24px; right:24px; align-items:flex-end; }
.ypb-wrap.ypb-floating.ypb-pos-bottom-left   { bottom:24px; left:24px;  align-items:flex-start; }
.ypb-wrap.ypb-floating.ypb-pos-bottom-center { bottom:24px; left:50%; transform:translateX(-50%); align-items:center; }

/* Inline */
.ypb-wrap.ypb-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}

/* ── Trigger button ──────────────────────────────────────────── */
.ypb-trigger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  border: none !important;
  outline: none !important;
  border-radius: 50px !important;
  padding: 10px 20px 10px 10px !important;
  cursor: pointer !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #fff !important;
  line-height: 1 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.30) !important;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease !important;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none !important;
}
.ypb-trigger:hover  { transform: translateY(-2px) !important; box-shadow: 0 6px 24px rgba(0,0,0,.35) !important; color:#fff !important; }
.ypb-trigger:active { transform: scale(.96) !important; }
.ypb-trigger--yape  { background: linear-gradient(135deg,#7c3aed,#5b21b6) !important; }
.ypb-trigger--plin  { background: linear-gradient(135deg,#0ea5e9,#0369a1) !important; }

.ypb-icon {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.15);
  border-radius: 9px;
  padding: 3px;
}
.ypb-label { white-space: nowrap; }

/* pulse */
.ypb-pulse {
  position: absolute;
  top: -2px; right: -2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  pointer-events: none;
}
.ypb-pulse--yape { background: #c4b5fd; }
.ypb-pulse--plin { background: #7dd3fc; }
.ypb-pulse::before {
  content:'';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ypbPulse 2.2s infinite ease-out;
}
@keyframes ypbPulse {
  0%   { transform:scale(1);   opacity:.8; }
  70%  { transform:scale(3);   opacity:0; }
  100% { transform:scale(3);   opacity:0; }
}

/* ── Overlay (hijo directo del body) ─────────────────────────── */
#ypb-overlay {
  display: none;
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,.55) !important;
  z-index: 99991 !important;
  cursor: pointer;
}
#ypb-overlay.ypb-is-visible { display: block !important; }

/* ── Modal (hijo directo del body) ───────────────────────────── */
.ypb-modal {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 99992 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}
.ypb-modal.ypb-is-open {
  display: flex !important;
}

/* ── Modal inner — forzar fondo blanco siempre ───────────────── */
.ypb-modal__inner {
  color-scheme: light !important;
  background: #ffffff !important;
  color: #111111 !important;
  border-radius: 18px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.40) !important;
  width: 100% !important;
  max-width: 310px !important;
  padding: 26px 22px 18px !important;
  position: relative !important;
  text-align: center !important;
  animation: ypbSlideUp .25s cubic-bezier(.4,0,.2,1) both !important;
  /* Reset cualquier herencia del tema */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}
.ypb-modal--yape { border-top: 5px solid #7c3aed !important; }
.ypb-modal--plin { border-top: 5px solid #0ea5e9 !important; }

@keyframes ypbSlideUp {
  from { opacity:0; transform:translateY(24px) scale(.95); }
  to   { opacity:1; transform:none; }
}

/* ── Header ──────────────────────────────────────────────────── */
.ypb-modal__header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  margin-bottom: 14px !important;
}
.ypb-modal__logo-wrap {
  width: 44px !important; height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: 0 3px 10px rgba(0,0,0,.2) !important;
}
.ypb-modal__title {
  font-size: 24px !important;
  font-weight: 900 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  border: none !important;
  background: none !important;
}

/* ── Bloque producto ─────────────────────────────────────────── */
.ypb-modal__product {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  background: #f5f3ff !important;
  border-left: 3px solid #7c3aed !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  margin-bottom: 14px !important;
  text-align: left !important;
}
.ypb-modal__product--plin {
  background: #f0f9ff !important;
  border-left-color: #0ea5e9 !important;
}
.ypb-modal__product-icon {
  font-size: 22px !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  margin-top: 3px !important;
}
.ypb-modal__product-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex: 1 !important;
  min-width: 0 !important;
}
.ypb-modal__product-name {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #777 !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  text-transform: uppercase !important;
  letter-spacing: .4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Fila "Monto a pagar  S/ 115" */
.ypb-modal__monto-row {
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}
.ypb-modal__monto-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #555 !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}
.ypb-modal__monto-val {
  font-size: 22px !important;
  font-weight: 900 !important;
  color: #111 !important;
  line-height: 1 !important;
  letter-spacing: -.5px !important;
}

/* "🎉 Ahorras S/ 5 con el descuento" */
.ypb-modal__saving {
  font-size: 12px !important;
  color: #16a34a !important;
  font-weight: 600 !important;
  background: #dcfce7 !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  margin-top: 2px !important;
  line-height: 1.4 !important;
  display: inline-block !important;
}
.ypb-modal__saving strong {
  color: #15803d !important;
  font-weight: 800 !important;
}

/* ── QR ──────────────────────────────────────────────────────── */
.ypb-modal__qr {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
  margin-bottom: 14px !important;
}
.ypb-modal__qr img {
  width: 200px !important; height: 200px !important;
  object-fit: contain !important;
  border-radius: 10px !important;
  border: 2px solid #eee !important;
  padding: 6px !important;
  background: #fff !important;
  display: block !important;
}
.ypb-modal__qr-label {
  font-size: 11px !important;
  color: #999 !important;
  font-style: italic !important;
  margin: 0 !important;
}
.ypb-modal__noqr {
  background: #fef3c7 !important;
  border-radius: 8px !important;
  padding: 12px !important;
  color: #92400e !important;
  font-size: 13px !important;
  margin-bottom: 14px !important;
}

/* ── Info ────────────────────────────────────────────────────── */
.ypb-modal__info {
  background: #f9f9fb !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  margin-bottom: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  text-align: left !important;
}
.ypb-modal__row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.ypb-modal__icon { font-size: 16px !important; flex-shrink: 0 !important; }
.ypb-modal__val  {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #111 !important;
  flex: 1 !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}
.ypb-copy {
  background: rgba(0,0,0,.06) !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  padding: 3px 6px !important;
  color: inherit !important;
  line-height: 1 !important;
  transition: background .15s !important;
  flex-shrink: 0 !important;
}
.ypb-copy:hover { background: rgba(0,0,0,.12) !important; }

/* ── Hint ────────────────────────────────────────────────────── */
.ypb-modal__hint {
  font-size: 12px !important;
  color: #bbb !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
  border: none !important;
  background: none !important;
}

/* ── Close ───────────────────────────────────────────────────── */
.ypb-modal__close {
  position: absolute !important;
  top: 10px !important; right: 12px !important;
  background: #f0f0f0 !important;
  border: none !important;
  border-radius: 50% !important;
  width: 28px !important; height: 28px !important;
  font-size: 12px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #666 !important;
  line-height: 1 !important;
  padding: 0 !important;
  transition: background .15s, color .15s !important;
}
.ypb-modal__close:hover { background: #ddd !important; color: #111 !important; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 420px) {
  .ypb-wrap.ypb-floating.ypb-pos-bottom-right { right:14px; bottom:16px; }
  .ypb-wrap.ypb-floating.ypb-pos-bottom-left  { left:14px;  bottom:16px; }
  .ypb-label { display:none !important; }
  .ypb-trigger {
    width: 52px !important; height: 52px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
  }
  .ypb-modal__inner  { padding: 20px 14px 14px !important; }
  .ypb-modal__qr img { width:170px !important; height:170px !important; }
}

/* ── Reducción de movimiento ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ypb-modal__inner { animation: none !important; }
  .ypb-pulse::before { animation: none !important; }
  .ypb-trigger { transition: none !important; }
}

/* ── WooCommerce inline wrapper ──────────────────────────────── */
.ypb-wc-wrapper {
  margin: 12px 0 4px;
  padding: 12px 14px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
}
.ypb-wc-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin: 0 0 8px;
}
.ypb-wc-product .ypb-wrap.ypb-inline { margin: 0; }
.ypb-wc-checkout { margin-bottom: 16px; text-align: center; }
.ypb-wc-checkout .ypb-wrap.ypb-inline { justify-content: center; margin: 0; }
