/* Contenedor principal del método de pago */
.wompi-card-wrapper {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;

  width: 100%;
  margin: 1.5rem auto 0;   /* centrado dentro del payment_box */
  padding: 1.5rem;

  border-radius: 20px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.4);

  overflow: hidden;        /* evita que algo se “escape” visualmente */
}

/* Todo lo interno respeta el ancho del wrapper */
.wompi-card-wrapper * {
  box-sizing: border-box;
}

/* Tarjeta “preview” */
.wompi-card-preview {
  width: 100%;
  max-width: 100%;
  border-radius: 18px;
  padding: 18px 20px;

  background: radial-gradient(circle at 0% 0%, #4f46e5, #0f172a 55%, #020617 100%);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  position: relative;
}

/* Chip / marca / textos de la tarjeta */
.wompi-card-chip {
  width: 32px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e5e7eb, #9ca3af);
  margin-bottom: 14px;
}

.wompi-card-brand {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 14px;
}

.wompi-card-number {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 18px;
  letter-spacing: 0.18em;
  margin-bottom: 18px;
}

.wompi-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 11px;
  text-transform: uppercase;
}

.wompi-card-holder .label,
.wompi-card-expiry .label {
  display: block;
  opacity: 0.7;
  margin-bottom: 2px;
}

.wompi-card-holder .value,
.wompi-card-expiry .value {
  font-size: 13px;
  letter-spacing: 0.06em;
}

/* Formulario debajo de la tarjeta */
.wompi-card-form {
  width: 100%;
}

.wompi-card-form .form-row {
  margin-bottom: 0.75rem;
}

.wompi-card-form label {
  font-size: 13px;
  color: #e5e7eb;
}

.wompi-card-form input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  padding: 0.55rem 0.9rem;
  color: #e5e7eb;
  font-size: 14px;
}

.wompi-card-form input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

/* Fila MM/AA + CVV en dos columnas, sin romper el ancho */
.form-row.form-row-half-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-row.form-row-half-wrapper .form-row-first,
.form-row.form-row-half-wrapper .form-row-last {
  flex: 1 1 0;
  min-width: 0;
}

.wompi-card-secure {
  margin-top: 0.5rem;
  font-size: 12px;
  color: #cbd5f5;
  opacity: 0.9;
}

/* Ajustes móviles para evitar cualquier overflow */
@media (max-width: 480px) {
  .wompi-card-wrapper {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 1.25rem;
  }

  .wompi-card-number {
    font-size: 16px;
    letter-spacing: 0.14em;
  }

  .wompi-card-footer {
    flex-direction: row;
  }
}

#add_payment_method #payment div.form-row, .woocommerce-cart #payment div.form-row, .woocommerce-checkout #payment div.form-row {
    padding: 0 !important;
    gap: 0 !important;
}

/* Modal de 3DS - Estilo Senior */
.wompi-3ds-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wompi-3ds-modal-overlay.is-visible {
    opacity: 1;
}

.wompi-3ds-modal-content {
    background: #fff;
    width: 95%;
    max-width: 550px;
    height: 85vh;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.wompi-3ds-modal-overlay.is-visible .wompi-3ds-modal-content {
    transform: translateY(0);
}

.wompi-3ds-modal-header {
    padding: 15px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wompi-3ds-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.wompi-3ds-modal-notice {
    background: #fffbeb;
    color: #92400e;
    padding: 10px 20px;
    font-size: 12px;
    border-bottom: 1px solid #fde68a;
    text-align: center;
}

.wompi-3ds-modal-iframe {
    width: 100%;
    height: calc(100% - 60px);
    border: none;
}

/* Spinner de carga durante el proceso */
.wompi-checkout-loading {
    pointer-events: none;
    opacity: 0.6;
}

.wompi-button-loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: wompispin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes wompispin {
    to { transform: rotate(360deg); }
}