/* ════════════════════════════════════════════════════════════════════
   PAYMENT SYSTEM — PREMIUM DESIGN
   Palettes per method, animated logos, full i18n
   ════════════════════════════════════════════════════════════════════ */

/* ══════ Global overlay base ══════ */
.pm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: pm-fade-in 0.3s ease-out;
}
@keyframes pm-fade-in { from { opacity: 0 } to { opacity: 1 } }

.pm-card {
  width: 100%;
  max-width: 460px;
  padding: 32px 26px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1a1a1a 0%, #141414 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.05);
  text-align: center;
  color: #fff;
  animation: pm-slide-up 0.4s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
  position: relative;
}
@keyframes pm-slide-up {
  from { transform: translateY(30px); opacity: 0 }
  to { transform: translateY(0); opacity: 1 }
}

/* Decorative top bar — color per method */
.pm-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--pm-color, #E65100);
  box-shadow: 0 0 20px var(--pm-color, #E65100);
}

/* ══════ Method badge ══════ */
.pm-badge {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  position: relative;
  background: linear-gradient(135deg, var(--pm-color-light, rgba(230,81,0,.15)), var(--pm-color-fade, rgba(230,81,0,.05)));
  border: 1.5px solid var(--pm-color-border, rgba(230,81,0,.3));
  box-shadow: 0 0 30px var(--pm-color-glow, rgba(230,81,0,.2)), inset 0 1px 0 rgba(255,255,255,.05);
}
.pm-badge i {
  font-size: 32px;
  color: var(--pm-color, #E65100);
  text-shadow: 0 0 20px var(--pm-color-glow, rgba(230,81,0,.5));
}
.pm-badge svg {
  width: 38px; height: 38px;
  fill: var(--pm-color, #E65100);
  filter: drop-shadow(0 0 10px var(--pm-color-glow, rgba(230,81,0,.4)));
}

/* ══════ Name + amount ══════ */
.pm-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--pm-color, #E65100);
  margin-bottom: 6px;
  text-shadow: 0 0 20px var(--pm-color-glow, rgba(230,81,0,.3));
}
.pm-amount {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.pm-amount small {
  font-size: 14px;
  opacity: 0.5;
  font-weight: 600;
  margin-left: 4px;
}
.pm-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  line-height: 1.55;
  margin-bottom: 20px;
  padding: 0 4px;
}

/* ══════ Code box ══════ */
.pm-code-wrap {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--pm-color-border, rgba(230,81,0,.2));
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  position: relative;
  overflow: hidden;
}
.pm-code-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pm-color, #E65100), transparent);
  animation: pm-shimmer 2s infinite;
}
@keyframes pm-shimmer {
  0% { left: -100% }
  100% { left: 100% }
}
.pm-code-label {
  font-size: 10px;
  color: var(--pm-color, #E65100);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pm-code-value {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 14px;
  word-break: break-all;
  color: #fff;
  user-select: all;
  padding: 10px 12px;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  line-height: 1.6;
  cursor: text;
  transition: background 0.2s;
}
.pm-code-value:hover { background: rgba(0,0,0,0.5) }

/* ══════ Buttons ══════ */
.pm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  margin: 8px 0;
  border: none;
}
.pm-btn:active:not(:disabled) { transform: scale(0.98) }

.pm-btn-primary {
  background: linear-gradient(135deg, var(--pm-color, #E65100), var(--pm-color-2, #FF8F00));
  color: #fff;
  box-shadow: 0 4px 20px var(--pm-color-glow, rgba(230,81,0,.3));
}
.pm-btn-primary:hover:not(:disabled) { 
  filter: brightness(1.08);
  box-shadow: 0 6px 28px var(--pm-color-glow, rgba(230,81,0,.45));
}

.pm-btn-copy {
  background: transparent;
  color: var(--pm-color, #E65100);
  border: 1.5px solid var(--pm-color, #E65100);
  margin-top: 10px;
}
.pm-btn-copy:hover { background: var(--pm-color-fade, rgba(230,81,0,.1)) }
.pm-btn-copy.copied {
  background: var(--pm-color, #E65100);
  color: #fff;
  border-color: transparent;
}

.pm-btn-confirm {
  background: linear-gradient(135deg, #E65100, #FF8F00);
  color: #fff;
  box-shadow: 0 4px 20px rgba(230,81,0,.3);
  font-size: 15px;
  padding: 15px;
}
.pm-btn-confirm:hover:not(:disabled) { filter: brightness(1.08) }
.pm-btn-confirm:disabled { opacity: 0.6; cursor: not-allowed }

.pm-btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  padding: 10px;
  font-weight: 600;
}
.pm-btn-ghost:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.2) }

/* ══════ Redirect link ══════ */
.pm-redirect-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 10px 0;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--pm-color, #E65100);
  text-decoration: none;
  border: 1px dashed var(--pm-color-border, rgba(230,81,0,.4));
  border-radius: 8px;
  transition: background 0.15s;
}
.pm-redirect-link:hover { background: var(--pm-color-fade, rgba(230,81,0,.1)) }

/* ══════ Footer info ══════ */
.pm-footer {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.5;
}
.pm-footer i {
  color: var(--pm-color, #E65100);
  margin-right: 4px;
}
.pm-expire {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 12px;
}
.pm-expire i {
  color: var(--pm-color, #E65100);
  margin-right: 4px;
}

/* ══════ Loading state ══════ */
.pm-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: pm-fade-in 0.2s;
}
.pm-loading-card {
  text-align: center;
  max-width: 340px;
  padding: 40px 24px;
}
.pm-loading-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 22px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulsating rings */
.pm-loading-logo::before,
.pm-loading-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--pm-color, #E65100);
  opacity: 0;
  animation: pm-pulse 2s cubic-bezier(0,0,.2,1) infinite;
}
.pm-loading-logo::after { animation-delay: 1s }
@keyframes pm-pulse {
  0% { transform: scale(0.6); opacity: 1 }
  80%, 100% { transform: scale(1.5); opacity: 0 }
}

/* Inner circle with icon */
.pm-loading-inner {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pm-color-light, rgba(230,81,0,.2)), var(--pm-color-fade, rgba(230,81,0,.05)));
  border: 2px solid var(--pm-color-border, rgba(230,81,0,.4));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 40px var(--pm-color-glow, rgba(230,81,0,.3)), inset 0 2px 0 rgba(255,255,255,.05);
}
.pm-loading-inner i {
  font-size: 32px;
  color: var(--pm-color, #E65100);
  animation: pm-bounce 1.4s ease-in-out infinite;
}
.pm-loading-inner svg {
  width: 40px; height: 40px;
  fill: var(--pm-color, #E65100);
  animation: pm-bounce 1.4s ease-in-out infinite;
}
@keyframes pm-bounce {
  0%, 100% { transform: scale(1) }
  50% { transform: scale(1.15) }
}

/* Rotating accent ring */
.pm-loading-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--pm-color, #E65100);
  border-right-color: var(--pm-color-2, #FF8F00);
  animation: pm-rotate 1s linear infinite;
  z-index: 2;
}
@keyframes pm-rotate {
  from { transform: rotate(0) }
  to { transform: rotate(360deg) }
}

.pm-loading-method {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--pm-color, #E65100);
  margin-bottom: 8px;
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--pm-color-glow, rgba(230,81,0,.4));
}
.pm-loading-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  min-height: 22px;
}
.pm-loading-dots::after {
  content: '';
  animation: pm-dots 1.5s infinite;
}
@keyframes pm-dots {
  0% { content: '' }
  25% { content: '.' }
  50% { content: '..' }
  75% { content: '...' }
}

/* Progress bar */
.pm-loading-progress {
  margin-top: 22px;
  height: 3px;
  width: 200px;
  border-radius: 2px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}
.pm-loading-progress::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, transparent, var(--pm-color, #E65100), transparent);
  animation: pm-progress 1.5s ease-in-out infinite;
}
@keyframes pm-progress {
  0% { left: -30% }
  100% { left: 100% }
}

/* ══════ Method color themes ══════ */

/* Credit Card (Orange — Premium) */
.pm-theme-credit_card {
  --pm-color: #E65100;
  --pm-color-2: #FF8F00;
  --pm-color-light: rgba(230,81,0,.18);
  --pm-color-fade: rgba(230,81,0,.05);
  --pm-color-border: rgba(230,81,0,.4);
  --pm-color-glow: rgba(230,81,0,.5);
}

/* SPEI (Teal — Mexican Banking) */
.pm-theme-spei {
  --pm-color: #00897B;
  --pm-color-2: #26A69A;
  --pm-color-light: rgba(0,137,123,.18);
  --pm-color-fade: rgba(0,137,123,.05);
  --pm-color-border: rgba(0,137,123,.4);
  --pm-color-glow: rgba(0,137,123,.5);
}

/* Rapipago (Blue — Argentina) */
.pm-theme-rapipago {
  --pm-color: #1976D2;
  --pm-color-2: #42A5F5;
  --pm-color-light: rgba(25,118,210,.18);
  --pm-color-fade: rgba(25,118,210,.05);
  --pm-color-border: rgba(25,118,210,.4);
  --pm-color-glow: rgba(25,118,210,.5);
}

/* Pagofacil (Pink/Magenta — Argentina) */
.pm-theme-pagofacil {
  --pm-color: #C2185B;
  --pm-color-2: #E91E63;
  --pm-color-light: rgba(194,24,91,.18);
  --pm-color-fade: rgba(194,24,91,.05);
  --pm-color-border: rgba(194,24,91,.4);
  --pm-color-glow: rgba(194,24,91,.5);
}

/* MercadoPago (Cyan/Yellow — Argentina) */
.pm-theme-mercadopago {
  --pm-color: #00B1EA;
  --pm-color-2: #FFCC29;
  --pm-color-light: rgba(0,177,234,.18);
  --pm-color-fade: rgba(0,177,234,.05);
  --pm-color-border: rgba(0,177,234,.4);
  --pm-color-glow: rgba(0,177,234,.5);
}

/* Webpay (Red/Orange — Chile/Transbank) */
.pm-theme-webpay {
  --pm-color: #CB001E;
  --pm-color-2: #FF6B35;
  --pm-color-light: rgba(203,0,30,.18);
  --pm-color-fade: rgba(203,0,30,.05);
  --pm-color-border: rgba(203,0,30,.4);
  --pm-color-glow: rgba(203,0,30,.5);
}

/* ══════ Mobile ══════ */
@media (max-width: 520px) {
  .pm-card { padding: 26px 20px; max-width: 100%; border-radius: 18px }
  .pm-badge { width: 64px; height: 64px; border-radius: 16px }
  .pm-badge i, .pm-badge svg { font-size: 28px }
  .pm-amount { font-size: 28px }
  .pm-loading-logo { width: 90px; height: 90px }
  .pm-loading-inner { width: 72px; height: 72px }
}
@media (max-width: 380px) {
  .pm-card { padding: 22px 16px; border-radius: 16px }
  .pm-badge { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 12px }
  .pm-badge i, .pm-badge svg { font-size: 24px }
  .pm-name { font-size: 13px }
  .pm-amount { font-size: 24px }
  .pm-amount small { font-size: 12px }
  .pm-desc { font-size: 12px; margin-bottom: 16px }
  .pm-code-value { font-size: 12px; padding: 8px 10px }
  .pm-btn { font-size: 13px; padding: 12px }
  .pm-btn-confirm { font-size: 14px; padding: 13px }
  .pm-loading-logo { width: 80px; height: 80px }
  .pm-loading-inner { width: 64px; height: 64px }
  .pm-loading-inner i, .pm-loading-inner svg { font-size: 28px; width: 32px; height: 32px }
  .pm-loading-method { font-size: 16px }
  .pm-loading-sub { font-size: 13px }
}
